2cf8df92ed67429c8464c94bc2967bc51c594673
FAQ Bot – ChromaDB + LangChain
This project implements a simple FAQ bot that uses ChromaDB for vector storage and LangChain as the single MCP‑tool to retrieve and generate answers.
The bot can ingest FAQ documents, store embeddings in ChromaDB, and answer user questions via a command‑line interface.
Features
- Vector storage – ChromaDB (DuckDB + Parquet backend)
- Embedding model – OpenAI embeddings (
text-embedding-3-small) - LLM – OpenAI Chat (
gpt-4o-miniby default) - MCP‑tool – LangChain (only one MCP‑tool used)
- CLI –
python -m src.main ingest|ask - Unit tests –
pytest
Setup
-
Clone the repository
git clone https://git.brojs.ru/kuzakhmetovartur/povtornyy-ekzamen-faq-bot-chromadb-odin-.git cd povtornyy-ekzamen-faq-bot-chromadb-odin- -
Create a virtual environment
python3 -m venv .venv source .venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Set OpenAI API key
export OPENAI_API_KEY="sk-..."
Usage
Ingest FAQ file
Prepare a text file with FAQ pairs in the following format:
Q: What is Python?
A: Python is a programming language.
Q: What is ChromaDB?
A: ChromaDB is a vector database.
Run:
python -m src.main ingest path/to/faq.txt --collection faq_collection
Ask a question
python -m src.main ask "What is Python?" --collection faq_collection
The bot will print the generated answer.
Testing
Run the test suite:
pytest
Project Structure
src/
├── main.py # CLI entry point
├── ingest.py # Ingestion logic
└── retriever.py # Retrieval & answer generation
tests/
├── test_ingest.py
└── test_retrieval.py
requirements.txt
README.md
Notes
- The bot uses the default OpenAI embeddings and LLM.
If you want to change the model, edit theOpenAIEmbeddings()andOpenAIChat()calls insrc/ingest.pyandsrc/retriever.py. - ChromaDB data is persisted in the
chromadb/directory relative to the project root. - The deadline for the assignment is 31.08.2026. All code is committed to the specified Git repository.
Happy coding!
Description
Languages
Python
100%