Retail stores and logistics companies work with enormous data volumes: accumulated reference guides, templates, information in 1C and Bitrix24. Employees ask similar questions daily about inventory, contractor details, document preparation. An internal AI assistant handles this load: an employee asks in Russian, the system answers based on the company's own database and systems.
When documents contain customs declarations, personal data, and contractor details, sending them to OpenAI abroad is prohibited. Law 152-FZ requires storing personal data in Russia. That's why the architecture uses a self-hosted framework on the client's server and Yandex AI Studio LLM instead of cloud services.
This article covers how to build such a system from scratch, what tools to use, real implementation examples, and where the assistant is effective versus overkill. For CTOs and lead developers in retail and logistics who want to understand capabilities and limitations before investing.
What is an internal AI assistant and how it works
An internal AI assistant is not a separate cloud service, but rather part of your company's infrastructure. It runs on your server, works with your documents, and integrates with the systems you already use (1C, Bitrix24, others). Essentially, it is an assistant that knows your company's history, accumulated expertise, processes, and policies. For a retail or logistics business, this means instead of searching through network folders or asking colleagues, an employee simply describes what they need, and the assistant finds the answer.
The interface is straightforward. The assistant is accessible via Telegram, a corporate chat, a web interface, or any other messenger your employees already have open. A question is posed as a regular text message, and the response arrives in the same channel. Searching for a document, looking up a contact, drafting a document, creating a task, or pulling data from 1C, all of this the employee phrases in words. No special training is required. If a person can ask questions, they are ready to use it.
Behind the scenes, the assistant retrieves documents from your knowledge base, queries 1C and Bitrix24, processes information through a language model, and returns an answer. All of this happens locally on your server. Your data, customer personal information, customs declarations, and trade secrets do not go to the cloud and remain under your full control.
| Scenario | What an employee asks | What the assistant does |
|---|---|---|
| Document search | Find the proposal for client ABC from May | Searches the knowledge base, returns text and file link |
| Data lookup | What is the address for Company XYZ? | Queries 1C, returns current contact information |
| Document assist | Help me draft a customs declaration | Retrieves template and similar examples, provides a draft |
| Auto-task | Remind Ivan to verify the warehouse receipt | Creates a task in Bitrix24, assigns it to the employee |
| Status check | How many shipments are in transit? | Finds active orders, returns count and details |
It is important to acknowledge real limitations. AI can hallucinate, meaning it may invent information that does not exist in the knowledge base or databases. For critical documents (contracts, financial reports, customs declarations), a human always reviews and approves. The assistant is a powerful helper, not a substitute for judgment. Additionally, answer quality depends directly on your knowledge base quality. If documents are poorly labeled, contain outdated information, or have gaps, the assistant returns incomplete or inaccurate results.
For companies in Russia, this solution ensures compliance with data protection requirements. The language model runs on Yandex servers, the framework is deployed on your infrastructure, and all integrations use local channels. Data remains within Russian borders. This is critical for compliance with federal regulations and management of confidential information.
Core capabilities in real scenarios
The assistant works in a familiar interface - a messenger or web application. An employee writes a request in natural language, the system processes it through an LLM on Yandex AI Studio servers, accesses tools in 1C and Bitrix24, and returns the result. Here is what it can concretely do.
RAG: search and answers across internal document library
When the assistant receives a query about a regulation, procedure, or example document, it searches across the accumulated knowledge base. This can be hundreds of procedures, regulations, supplier letters, and document examples. The system finds relevant fragments, the LLM composes an answer with source references. In logistics this is critical. Documents are scattered across folders, versions become outdated, new employees often ask experienced colleagues. The assistant becomes an accessible reference that can answer in real time. However, quality depends on corpus preparation. If documents are dirty or outdated, RAG will yield a processed version of those same errors. Initial cleanup and indexing are required.
Queries to systems: 1C, Bitrix24, balances and counterparties
Instead of navigating interfaces, an employee simply writes: "Which orders are in Awaiting Payment status?" or "Tell me about counterparty ABC". The system translates the request into an API call, retrieves data, and displays it in understandable form. Product balances, cargo information, reconciliations, and Bitrix24 statuses become accessible with a single natural language query. Tools are connected via MCP or function-calling based on API schema. Initial setup is required, but then it works reliably as long as APIs remain stable.
Assistance with document drafting: templates based on examples
A typical scenario: an employee asks "Draft a customs declaration for cargo ABC". The assistant collects data from 1C, finds similar examples in the knowledge base, and generates a draft. The employee reviews, supplements, signs, and submits. The same works for proposals, reports, notices - standard documents for which examples already exist. The assistant saves hours searching for old files and re-entering the same fields. But it is not auto-submission. On financial documents the LLM can hallucinate or insert a wrong account number. Human-in-the-loop is mandatory: the employee always reviews before sending. The assistant also creates tasks in Bitrix24 - "Create a task for the accountant to review this report", and it integrates into the workflow. All described above is based on the experience of our client in logistics, where this approach has proven itself.
Practical limitations
An LLM can "invent" a regulation that looks plausible but does not match reality. On documents with financial figures this is unacceptable. Answer quality depends on the completeness and currency of the knowledge base. If an important document is not indexed or outdated, RAG will not find it. Corpus preparation will take approximately 2-4 weeks: cleaning, annotation, and tuning. The base will require regular updates as new regulations and documents appear.
Solution architecture: components and integrations
Architecture: Three Layers
The solution is built on three layers. The first layer is an agent framework with open source code, running on the client's server (self-hosted). The second is an LLM on Yandex AI Studio, a cloud infrastructure located in Russia. The third layer comprises integrations via MCP and function-calling with 1C and Bitrix24, plus a RAG index for searching client documents.
The agent framework orchestrates the assistant. It receives a question from an employee, sends it to the LLM, processes the response, and calls tools (document search, database queries). The framework does not send data to Anthropic or OpenAI clouds. All LLM text processing goes through Yandex AI Studio with servers in Russia. This is critical for compliance with Federal Law 152-FZ on data protection and for handling counterparty information and customs declarations.
System Components
| Component | Purpose | Location |
|---|---|---|
| Agent framework | Dialogue orchestration, tool invocation | Client server (self-hosted) |
| LLM (Yandex AI Studio) | Text processing, response generation | Yandex cloud (Russia) |
| RAG index | Document search in knowledge base | Client database on server |
| 1C/Bitrix24 integrations | Function-calling, data queries | Client API via MCP |
| Web UI or Telegram | Frontend for users | Browser or messenger |
Integrations via MCP
Model Context Protocol is a standard allowing LLMs to invoke tools. In our system, tools are functions in 1C (export order data, check inventory) and Bitrix24 (create task, update status). The assistant decides which tool to use based on the employee's question. If asked 'which counterparties have debt,' the system invokes a 1C function to filter by payment status.
RAG works in parallel with function calls. For each question, the system searches relevant documents in the client's knowledge base (procedures, policies, templates) and passes their context along with the question to the LLM. The LLM sees both the employee request and company documents, so answers are accurate and personalized.
Why Self-Hosted and Russia-Based Cloud
Counterparty information, orders, customs declarations, and employee personal data must not leave Russia (Federal Law 152-FZ on data protection). An open-source framework on the client's server remains under full company control. Yandex AI Studio does not transmit request data to third parties; storage is within Russia. This differs from global LLM services where data may be processed abroad and used to improve models.
Some open-source projects send logs and requests to OpenRouter or other cloud services by default. You must verify the configuration, disable default endpoints, and configure direct connection to Yandex AI Studio. Otherwise, data will be sent to public cloud, violating security requirements.
Example: Logistics Case
In one of our logistics projects, we deployed such an assistant. A logistics employee can ask via Telegram or web 'what documents are needed for a customs declaration for shipment 12345' or 'which counterparties are overdue more than a month'. The assistant searches relevant documents (customs procedures, declaration examples) in the company database, retrieves 1C data (counterparty details, shipment parameters, payment status), and drafts a response with embedded data. The employee reviews and uses the result. For legal and financial documents, a person always verifies. This is assistance, not full automation.
Honest Limitations
- LLMs can produce plausible but incorrect answers (hallucinate). For legal, financial documents, and customs declarations, human verification is mandatory before submission.
- Answer quality depends directly on how well the company's knowledge base is structured and updated. Preparation is needed: remove duplicates, keep information current, mark up documents.
- Implementation is not instantaneous. The system grows in stages with user feedback. In phase one, employees use the assistant for search and reference. In phase two, for document drafts. In phase three, routine task automation in the tracker.
Security and compliance with Law 152-FZ
Developing automation systems for logistics and retail requires careful handling of personal data and sensitive business information. Customs declarations contain details about counterparties, delivery routes, and goods costs - information that under Russian Federal Law 152-FZ must not be transmitted to cloud services outside the country. This is the core argument against using ChatGPT, Claude, or other Western LLMs for tasks involving the Russian data perimeter.
We take a different approach: the LLM is deployed on Yandex AI Studio infrastructure, physically located in Russia and certified for data localization. The agent framework itself runs as a self-hosted solution on the client's server, without transmitting raw documents or requests to third-party clouds. This eliminates personal data leakage and guarantees full control over intellectual property.
A common mistake: developers select a popular framework based on LangChain or similar tools that by default route requests through OpenRouter or directly to OpenAI API. Without explicit reconfiguration, client data flows out. We block such channels in advance and lock endpoints to the internal network and Yandex AI only.
Security architecture layers
- LLM layer: Yandex AI Studio, certified for personal data storage and compliant with Roskomnadzor requirements.
- Framework layer: self-hosted agent runs locally on client infrastructure, does not send logs or metadata to third parties.
- Integration layer: MCP tools for 1C and Bitrix24 connect via internal network, requests are encrypted, user accounts are role-separated.
- Storage layer: documents and conversation histories remain on the client's server, no synchronization to external clouds without explicit consent.
When working with customs declarations and financial records, the system generates drafts but does not auto-submit to state agencies. Legal responsibility for document content stays with the human operator. This is the human-in-the-loop principle we enforce strictly: the AI suggests, analyzes, and accelerates the process, but signing and approval are operator-only.
| Approach | Data location | Russian language strength | Implementation effort | Compliance |
|---|---|---|---|---|
| OpenAI/ChatGPT | US cloud | Good | Low | Violates 152-FZ |
| Self-hosted open LLM | Client server | Weak | High | Compliant |
| Yandex AI plus self-hosted framework | RF server plus RF cloud | Strong | Medium | Compliant |
No AI system guarantees 100 percent accuracy on contract details or customs rules. The model can hallucinate, especially at knowledge boundaries, so documents with legal or financial consequences require human review. Answer quality depends heavily on how the knowledge base is prepared - duplicate removal, relationship tagging, and regular updates are necessary. Implementation takes time: phase one handles corpus preparation, phase two covers integration and testing, phase three involves team training.
In one of our logistics projects, we deployed such an assistant to work with a large archive of cargo and counterparty documents. The system answers questions clearly, such as 'show all open tasks for cargo XYZ' or 'find contracts with supplier ABC above N rubles.' Customs declarations are prepared faster because the AI instantly locates relevant data in the archive and proposes a filled template. But before filing, a specialist always reviews the document.
The solution requires investment in infrastructure and data preparation, but pays for itself through speed and reliability, especially if a company works with government agencies where data leakage restrictions are strict and fines for non-compliance are substantial.
Implementation preparation: where to start
An AI assistant is not magic, and its results depend directly on preparation quality. If the knowledge base is unstructured, RAG will return irrelevant fragments. If employees do not know what and how to ask, the tool simply will not be used. Therefore, preparation is not a formality but a key stage that determines the real outcome of implementation.
Preparing the document corpus
Gather all relevant internal documents, regulations, instructions, form examples, and previous case studies. In a project with a logistics company, we worked with a library of hundreds of documents: cargo handling instructions, customs declaration templates, counterparty directories, examples of commercial offers. Documents must be current (remove outdated versions) and in digital form. If regulations are stored on paper or in legacy formats, scan and recognize them.
Markup and data structuring
Markup determines RAG quality. Unstructured text means the assistant will not understand context and will return disconnected fragments. You will need:
- Text cleanup. Remove duplicate documents, fix encodings, ensure there are no recognition artifacts. Use text parsing tools or conduct manual review for critical documents.
- Logical markup. Add structured metadata: document type, author, update date, responsible department, subject tags. This helps RAG find answers more precisely and filter relevant sources.
- Semantic chunking. Divide long documents into paragraphs or sections so each block is self-contained and has a clear topic. The assistant works better with smaller, semantically coherent fragments.
Team training
Employees must understand what the assistant can and cannot do. This includes functional capabilities: it can find counterparty data from 1C, help with a document draft, but will not make final decisions on legal questions. They should also know about LLM limitations: the model can hallucinate by generating fictional numbers or references. Run a demo session, show typical scenarios and several failure examples where the assistant misinterpreted a request. Identify which employees will use the tool first and conduct a separate workshop with them.
When working with personal data, customs declarations, or financial documents, the assistant operates in an RF-regulated environment: a self-hosted framework on your company's Russian server and LLM via Yandex AI Studio. Ensure your IT department confirms that data is not sent to cloud services outside Russia. This is critical for PDPA 152-FZ compliance.
Pilot and rollout
Launch a pilot with power users from one or two departments. Based on feedback, fine-tune integrations, expand the knowledge base, and refine prompts and error handling. Only after this expand access to the entire organization. In parallel, create a process for regular knowledge base updates so new documents and regulations are added consistently. Otherwise, the assistant will work with outdated information within months.
| Stage | What to do | Timeline (guideline) |
|---|---|---|
| Document collection | Aggregate current regulations, instructions, templates | 1-2 weeks |
| Cleanup and markup | Remove duplicates, add metadata, break into chunks | 2-4 weeks |
| Integration setup | Configure endpoints in 1C and Bitrix24 | 1-2 weeks |
| Pilot group training | Demos, examples, usage documentation | 1 week |
| Feedback and tuning | Refine prompts, expand knowledge base | 1-2 weeks |
| Company-wide launch | Access for all users, support, monitoring | ongoing |
Preparation for implementation is a multi-stage process, not a one-month sprint. By investing 4-8 weeks in quality knowledge base preparation and team training, you will avoid disappointment at the pilot stage and ensure rapid tool adoption.
Case study from logistics: how it works in practice
Logistics companies constantly navigate large volumes of documents: contracts, invoices, bills of lading, customs declarations. Specialists spend hours searching for counterparty information, inventory levels, and transaction history. An internal AI assistant becomes a practical tool that helps employees work faster with documents and company systems.
In one of our logistics projects, we built an assistant that works directly with the client's accumulated document library, 1C, and Bitrix24. Employees type questions in a messenger or web interface in natural language: 'Find the May customs declaration for Roga LLC', 'Show stock levels in warehouse 3', 'Help me draft a customs declaration for this shipment'. The assistant retrieves information, combines data, and delivers results.
What the system actually does
- Search through internal document libraries using RAG - finds the right document by meaning, without requiring exact names or reference numbers
- Retrieve information about counterparties, shipments, orders, inventory levels directly from 1C and Bitrix24 in response to questions asked in natural language
- Help prepare draft customs declarations, commercial proposals, and reports based on structured data and patterns from similar historical documents
- Automatically create tasks in Bitrix24 and assign them to specific team members
- Maintain persistent context about projects and workflows, accessible through a messenger or web interface
In practice it works like this: a logistics specialist asks 'What emails have we received from ACME in the last two months?' The RAG system finds all matching emails, filters by date, and returns a list with quotes. If they need a customs declaration for export of goods to Kazakhstan for Alpha Logistics, the assistant finds the template in the knowledge base, fills in real data from 1C such as commodity codes, customs values, and consignee information, then delivers a draft for human review.
Why human judgment always stays in the loop
LLM models can make mistakes, alter information incorrectly, or generate false details (hallucination). The system creates drafts while the specialist remains responsible for final review before submission. This is not full automation but human-in-the-loop: the assistant saves time on search and data structuring, while the person ensures accuracy and legal compliance.
Critical security point: all data stays on the client's server. The assistant uses Yandex AI Studio (hosted in Russia), not OpenAI, so customs declarations, counterparty personal data, and payment details never leave the country. This is a requirement of Federal Law 152-FZ and the core reason for this architectural choice.
Quality depends on how well the document library is prepared. If documents are scattered with poor indexing or 1C records are outdated, the assistant cannot perform better than standard search tools. Implementation requires preparation: document cleanup, data tagging, and regular updates to data sources. But the payoff is measurable: employees save hours on information retrieval, document errors decrease, and client interactions move faster.
Real limitations nobody talks about
LLM Hallucinations: Not Everywhere a Disaster
Language models generate convincing falsehoods. A model is trained on billions of texts, but confidence in the answer and its correctness are different things. When the assistant says "according to contract No. 12345, the amount is 50,000 rubles," while the actual contract is No. 12346 with 45,000 rubles, that is a hallucination.
But hallucinations carry different risk levels depending on context. If the system suggests a letter template or a search phrase to help a person find documents, the error is easily caught. If the assistant generates a customs declaration or an invoice, an error can slip through and cause legal or financial problems.
Human-in-the-Loop for Financial and Legal Documents
That is why we excluded automatic document submission from the system. The assistant can help draft a customs declaration based on existing 1C data, but only a human submits it. The assistant prepares a project document or invoice, but people are responsible for the final version.
This is not a limitation. It is sound design. The workflow looks like this.
- Employee instructs the assistant to draft a declaration
- System fetches data from 1C (product codes, cost, weight) and from the knowledge base
- Generates a draft with gaps, questions, and notes
- Human reviews it against actual documents and clarifies details
- Submits to customs or to a counterparty
The error probability drops. The employee saves 30-40 minutes of routine work instead of writing from scratch.
Knowledge Base Quality Drives Answer Quality
If your document base is an unstructured pile of text, a RAG system will inevitably pull noise. For example, if instructions for "how to file a customs declaration" exist in seven versions stacked together, the system may mix up requirements because it does not know which one is current.
Preparing the base requires systematic work.
| Stage | What to do | Why it matters |
|---|---|---|
| Audit existing sources | Collect all documents, instructions, templates that people use every day | Without a full inventory, the base stays incomplete |
| Cleaning and versioning | Remove duplicates, approve current versions, mark obsolete ones | The model should not confuse old and new requirements |
| Metadata structuring | Add tags, sections, update dates, owners | Search becomes sharper, the system understands context |
| Continuous updates | When processes, requirements, or law change, sync the base | Otherwise in a month the assistant will give outdated advice |
Example from Logistics
In one of our logistics projects, a company stored customs declaration instructions in PDFs, Word files, and email archives. People worked by memory or asked senior colleagues. We collected the entire base, picked current versions, added tags (product code, country of origin, trade benefits), and integrated it into RAG.
Result: the assistant began suggesting not just "file a declaration," but "for this product code you need documents A, B, C, and for this country these trade benefits apply." People saved time on searching, but still checked the final version. Base preparation took 3-4 weeks, then monthly syncs when regulations changed.
When the System Works and When It Is Overkill
The assistant is useful for searching information, drafting documents, and logging tasks in a tracker. It saves time on repetitive, information-heavy tasks.
But there are scenarios where the system is not needed.
- If the solution is already automated (for example, invoices are generated by 1C at the click of a button)
- If a task requires complex analysis, choosing between options, or creativity
- If data is poorly structured and base preparation would take months
Deployment does not save a company that has not organized its processes and knowledge. First comes the base. Then the system amplifies it.
When the assistant is effective and when it's overkill
An internal AI assistant needs specific conditions to justify its investment. The most critical factor is the volume of routine work that can be automated and how prepared the company is for implementation.
When the assistant pays for itself and when it's excessive
| Scenario | When It Pays Off | When It's Overkill |
|---|---|---|
| Large document flow (100+ docs per month) | ERP, Bitrix24, internal systems are synchronized; knowledge base is at least partially structured | Small office, rare data requests, staff works intuitively; no budget for corpus preparation |
| Frequent standard queries (contractors, inventory, order statuses) | Employees repeat the same process several times daily; data is rigid and verifiable | Queries are non-standard; analysis is needed, not just retrieval |
| Document preparation (drafts of quotes, reports, customs declarations) | Library of templates and examples exists; documents follow consistent format | Each document is unique; requires creative work by lawyer or specialist, not generation |
| Task assignment and solution logging | High task turnover; employees often forget to create actions in task tracker | Tracker is rarely used; weak culture of systematization |
Practical scenarios where implementation makes sense
- Logistics company: searching through 10,000+ accumulated documents (contracts, invoices, statements), retrieving data on shipments and contractors on demand, generating draft customs declarations based on transaction history. The assistant saves 30-60 minutes per day on document search and data gathering for paperwork. Typically pays for itself within 6-12 months.
- E-commerce store: instant answers to frequently repeated questions (order status, payment status, manager contact). Integration with the ERP system provides fresh data without manual syncing. Support staff reduces time per customer from 5 minutes to 2-3.
- B2B SaaS: help preparing commercial proposals from a database of closed examples and price lists. The assistant accelerates proposal turnaround, but final calculation and approval remain with humans.
- HR department: searching through accumulated employment decrees, legal documents, company policies. Answering standard employee questions about vacation, sick leave, compensation. The assistant reduces HR workload, but complex disputes go to the legal department.
Implementation typically costs 150-400k rubles (depending on integration volume, knowledge base preparation, and number of users). Payback depends on three factors: daily routine volume (higher volume means higher ROI), knowledge base quality (requires 2-4 weeks of preparation), and team readiness to adopt the tool. If a company expects to recoup part of the investment within 6-12 months through reduced employee time on routine work, the assistant can be economically justified at average salary levels. But if the company has only 10-15 people and the assistant is used 30 minutes a week, the investment will remain unprofitable.
The key point: implementation is neither quick nor always cheap. It requires a preparation phase (clarifying integrations, cleaning documents, staff training), and results depend less on LLM quality than on how well it is fed with current and structured information. LLMs hallucinate on financial documents, so lawyers and accountants still review drafts; this is not a replacement but an assistant. If you are ready to invest, can identify routine bottlenecks, and can dedicate time to corpus preparation, the assistant becomes a useful tool. If the conditions don't align, it is better to postpone.