A robust, production-ready Retrieval-Augmented Generation (RAG) assistant designed to provide accurate, context-aware answers based exclusively on your documentation.
This assistant is built to eliminate AI hallucinations by implementing a strict "Context-Only" policy. It uses vector search via ChromaDB to retrieve relevant information from your documents and leverages Azure OpenAI to generate precise answers, while being strictly prohibited from using external training data.
-
Strict RAG Architecture: Answers are generated only from the provided knowledge base.
-
Hallucination Prevention: Includes a similarity threshold mechanism to ignore irrelevant queries.
-
Professional Observability: Integrated logging to monitor system metrics (CPU, Memory, and Query Performance).
-
Modular Design: Easy to maintain and extend.
-
Configurable Behavior: Custom roles and instructions via JSON configuration.
-
Retrieval: ChromaDB with a document chunking strategy (500-character chunks with 50-character overlap).
-
Generation: Azure OpenAI (gpt-4.1-mini) with a temperature set to 0 for deterministic output.
-
Observability: Custom logger tracking process health and query relevance.
-
Python 3.10+
-
Azure OpenAI Service
-
Telegram Bot Token
Clone the repository:
git clone https://github.com/E1DIGITALPF/e1digital-rag-assistant.git
cd e1digital-rag-assistantSet up environment variables:
Create a .env file in the root directory:
TELEGRAM_BOT_TOKEN=your_telegram_token
AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_DEPLOYMENT=gpt-4.1-miniInstall dependencies:
pip install -r requirements.txtInitialize Knowledge Base:
Place your documents in the source folder and run the ingestion script:
python build_knowledge_base.pyRun the bot:
python main.pyContributions are welcome! Please feel free to submit a Pull Request.
MIT