Employee AI Assistant: Telegram, Project Memory and RAG Search
AI Assistant · Telegram · RAG · Project Memory · Qdrant
AI assistant for employees with project memory and correspondence search
Developed an internal AI-platform that collects working data from Telegram, documents, mail and cloud storage, links them to projects and helps employees quickly find solutions, tasks, accesses and history of agreements.
The assistant does not work as a separate chat. Behind it is the knowledge base, project memory, hybrid search, background handlers and security rules. Answers are based on the facts of a specific project and are accompanied by source reports.
From Employee Task to Architecture
The user needs a response to a specific project with a confirmation, not just a list of messages. Therefore, the task is divided into collecting raw data, project memory, searching and preparing a response with sources.
Why is this stack?
Laravel links business logic, API and queues, MySQL stores accurate facts and connections. Qdrant complements the search with coincidences in meaning, and Telegram gives the employee a familiar interface. Redis and background tasks serve the synchronization and processing of materials.
How to start with a smaller volume
For a similar MVP, you can choose one project and one source of documents, saving access verification and answers with sources. Mail, cloud drives, advanced analytics, and additional ranking ways to connect after checking the main scenario. This case describes an already more developed system.
Project task
In working correspondence, solutions, tasks, links, contacts and technical details appear daily. After a few weeks, an important fact is difficult to find, and the status of the project has to be restored manually.
Gather knowledge
Combine correspondence, files, letters and documents in a single loop.
Preserve the context of the project
Link messages to projects, tasks, solutions, contacts, domains, and repositories.
Simplify the search
Allow an employee to ask a question directly in Telegram.
Don't reveal secrets
Masking passwords, tokens, and API keys prior to AI analysis and prior to outputting a response.
The main idea
The platform consists of two related levels. The knowledge base stores and indexes individual materials. Project memory collects from them the current state of the project.
The employee does not need a list of found messages, but a confirmed response with an understanding of the project and links to primary sources.
Therefore, the system stores both the original content and the extracted entities. As a result, one question can take into account correspondence, documents, tasks, recent decisions, and project metadata.
What data is connected
Telegram
Personal dialogs and selected work chats, including message history and project communication.
Emails from IMAP boxes, folders, senders, recipients and text of supported attachments.
Google Docs
Text of all document tabs, file version and automatic update of modified materials.
Yandex. Disc.
Selected directories and supported files with periodic change checks.
Files and audio
TXT, Markdown, PDF, DOCX, tables and audio recordings with transcription.
Webhooks and API
PLAUD, external integrations, manual addition of materials and Custom GPT Actions.
How communication becomes knowledge
-
Collection of a message
Telegram collector or a personal bot receives the message and stores it with the author, date, dialog ID, and link to the response.
Collector · Webhook · Deduplication
-
Linkage to the project
The selected dialog connects with an existing project or creates a new project on the team of an employee.
Project · Chat · Contact
-
Masking sensitive data
Before AI processing, the system hides passwords, tokens, API keys, authorization headers and private keys.
Sanitizer · Secrets · Privacy
-
AI analysis
From the text extracted summary, participants, tasks, facts, decisions, category and name of the project.
Summary · Tasks · Facts · Decisions
-
Indexation
The content is divided into semantic fragments. Embeddings and metadata are stored in Qdrant, structured data remain in MySQL.
Chunks · Embeddings · Qdrant · MySQL
-
Updating project memory
The system adds tasks, solutions, events, contacts, domains and links to repositories to the project card.
Project State · Events · Repositories
What an assistant can do with Telegram
Respond to full correspondence
The employee points the user and asks a question. The assistant selects relevant messages and adds fresh context to the dialogue.
Making arrangements
An individual regime seeks the latest decisions, commitments, and unsolved questions in the history of communication.
Search for the mentioned sites
The system analyzes the complete history and forms a list of the domains in question.
Working with accesses safely
The registry records the type and context of access granted, but hides passwords and tokens in responses.
Create a project from dialogue
The team links the user to the project and triggers synchronization of the available history.
Show the sources
The confirmed response contains the date, identifier and fragment of the original message.
If there are no suitable messages or there is insufficient confidence in the answer, the assistant does not invent the fact and reports that no confirmation has been found.
Project memory
Each connected dialogue can be associated with the project. After processing messages, the system maintains a structured status card.
Challenges
Name, description, priority, term, status and message from which the task was derived.
Decisions
Accepted agreements, date and reference to the source material.
Events
Chronology of project activity and summary of processed messages.
Contacts
Participants identified by AI in the project materials.
Domains
Sites found in correspondence and documents.
Repositories
Links to GitHub, GitLab and Bitbucket related to the project.
How to respond to the employee
-
Search area defined
The request is limited to a specific project or correspondence with the selected user.
-
Candidates are selected
The system takes into account exact coincidences, semantic intimacy, fresh messages and neighboring context.
-
Data cleared
Sensitive values are masked before the context is transferred to the model.
-
Model prepares answer
The instruction prohibits adding information that is not in the state of the project and found materials.
-
Verified confirmation
A response is considered confirmed only with sufficient confidence and the presence of initial messages.
-
The sources are coming back
The employee receives a short response and fragments of messages on which to verify the conclusion.
Hybrid search
There are several ways to search for the knowledge base. This is important because the working data contains both ordinary questions and short exact values.
Vector search
Qdrant finds snippets in meaning, even if the user has phrased the question in other words.
Accurate search
MySQL looks for matches in titles, content, tags, facts, tasks, and solutions.
Request options
For short questions, keywords, numbers and subject formulations are highlighted.
Overall ranking
Results are combined, cleared of duplicates and sorted by relevance.
Automatic synchronization
Updating sources is performed by the scheduler and individual queues. Long-term operations do not block the web interface and can be repeated after a temporary error.
Yandex. Disc.
Checking the connected directories starts every 5 minutes.
New emails and attachments are synced every 10 minute.
Google Docs
Versions of documents are checked every 15 minute. Unmodified files are not indexed again.
Telegram
New messages are received constantly, and the delayed AI processing is automatically resumed.
Security
Protected by webhook
The personal Telegram webhook only accepts JSON and checks the secret header.
Restriction of the user
Personal bot commands are available only to the authorized account.
Masking secrets
Passwords, tokens, private keys and authorization data are replaced with secure tokens.
Protection of API
Integration and Custom GPT use separate keys with secure value comparison.
Two-factor authorization
Access to the administrative panel is protected by TOTP and backup codes.
Closed infrastructure
Redis, Qdrant and processors operate on an internal Docker network and do not require public access.
Administrative panel
The Web interface is used to manage knowledge and sources without manual configuration.
Knowledge base
Add records, search, view summary, tasks, facts, solutions, and remove materials.
Projects
Managing project cards, codes, statuses and related information.
Sources
Files, Google Docs, mailboxes, folders Yandex.Disk and Telegram-dialogues.
Processing
Synchronization statuses, errors, reprocessing start and background task control.
Stack and infrastructure
The result
Common working context
Correspondence and documents no longer exist separately from the project card.
Quick answers
An employee asks a question in a familiar Telegram and gets the result without manually reviewing the story.
Verified findings
The answer is accompanied by sources and is not issued as confirmed if there is a lack of data.
Living project memory
Tasks, solutions, events, contacts, domains and repositories are updated as new materials become available.
Automatic update
Mail, cloud documents and messages enter the system through a scheduler and queues.
Basis for new agents
Protected API allows you to connect Custom GPT and other interfaces to the shared project memory.
Discuss the internal AI assistant
If important information is stored in correspondence, documents and mail, you can collect a single project memory and give employees a convenient search through the Telegram, web-interface or internal system.
To evaluate, it is sufficient to describe the main data sources, user roles and questions to which the assistant must answer.
AI Assistant · Telegram · RAG · Project Memory · Qdrant · Laravel
