650b443b05db38bd85446690ca9c21dae52f4fe2
RAG‑Agent with ChromaDB and Tavily
What is it?
A small demo of a LangChain agent that can answer questions using either a local knowledge base stored in ChromaDB or live web search via Tavily. The agent automatically chooses the source based on the query and returns the answer together with a source label.
Prerequisites
- Python 3.10+
- Ollama (downloaded models below)
ollama pull llama3
ollama pull nomic-embed-text
Installation
pip install -r requirements.txt
Create a .env file in the project root with your Tavily API key:
TAVILY_API_KEY=your_key_here
Data
Place any .txt or .md files you want to index into the documents/ folder.
Usage
python main.py
You will see a prompt. Type your question and press Enter. Type exit to quit.
The output shows the answer and the source (chromadb or tavily).
Description
Languages
Python
100%