A Retrieval-Augmented Generation (RAG) chatbot that uses ChromaDB for vector storage and LangChain for LLM integration.
RAGChat/
│
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ │
│ ├── database/
│ │ ├── __init__.py
│ │ ├── chroma_client.py
│ │ └── vector_store.py
│ │
│ ├── retrieval/
│ │ ├── __init__.py
│ │ └── retriever.py
│ │
│ ├── llm/
│ │ ├── __init__.py
│ │ ├── model.py
│ │ └── prompt.py
│ │
│ └── chat/
│ ├── __init__.py
│ └── bot.py
│
├── data/
│ ├── raw/
│ ├── processed/
│ └── embeddings/
│
│
├── tests/
│ ├── __init__.py
│ ├── test_retrieval.py
│ └── test_chat.py
│
├── requirements.txt
├── .env
├── README.md
└── .gitignore
Place your documents in the data/raw/ directory. The system supports:
- Text files (.txt)
- PDF files (.pdf)
- Markdown files (.md)
- HTML files (.html)
Create virtual environment.
python -m venv venvActivate virtual environment.
source venv/bin/activatepip install -r requirements.txtOPENAI_API_KEY=your_openai_api_key
To test the vector store functionality and see how documents are retrieved:
python -m app.main --demoThis will:
- Load sample documents from the
data/raw/directory - Run test queries against the vector store
- Display the retrieved documents and their relevance scores
To start an interactive chat session with the RAG chatbot:
python -m app.main --chatThis will:
- Initialize the vector store with your documents
- Start an interactive command-line chat interface
- Retrieve relevant documents for each query
- Generate responses based on the retrieved context
To see all available options:
python -m app.main --help