Skip to content

avrtt/RAG-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG-chatbot is a production-grade chatbot app that combines LLMs with RAG techniques. It leverages semantic text embeddings, vector search using ElasticSearch and LLM integration (via OpenAI API or open-source alternatives) to produce context-rich responses for customer service and automated content generation.

This project was some sort of PoC/demo as part of my freelance work.

Features

  • LLM integration: communicate with LLMs (e.g., OpenAI GPT) for natural language understanding and generation.
  • Retrieval augmentation: retrieve relevant documents from a knowledge base using vector search to augment chatbot responses.
  • Text similarity & reranking: utilize SOTA text similarity methods to rerank retrieved content.
  • Data preprocessing: clean and preprocess text and generate embeddings using modern transformer-based models.
  • Modular architecture: clearly separated modules for LLM integration, vector database operations, retrieval augmentation and chatbot logic.
  • Real-time chat interface: CLI for immediate testing and demonstration.
  • Testing suite: unit tests covering major modules and components.

Architecture

For a detailed description of the system architecture, please refer to docs/architecture.md.

Installation

  1. Clone the repository:

    git clone git@github.com:avrtt/RAG-chatbot.git
    cd RAG-chatbot
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Configure the application:
    Update config.py with your API keys, ElasticSearch settings and other configuration parameters as needed.

Usage

Start the chatbot by running:

python main.py

You will be prompted with a CLI where you can enter your queries. The chatbot will process your input, retrieve relevant documents and generate a context-aware response.

Testing

Run the full test suite using pytest:

pytest

Contributing

Contributions are welcome.

License

MIT