# RAG Agent with ChromaDB and Tavily This repository contains a simple RAG agent that uses **ChromaDB** as a local vector store and **Tavily** for web search. The agent can decide whether to answer from the local knowledge base or fetch fresh information from the internet. ## Project structure - `vectorstore.py` – utilities for creating/loading ChromaDB and adding documents. - `tools.py` – two LangChain tools: local KB search and Tavily web search. - `agent.py` – agent creation with routing logic. - `main.py` – CLI chat loop. - `documents/` – folder with sample `.txt` or `.md` files for the knowledge base. - `requirements.txt` – dependencies (LangChain >1.0, chromadb, tavily-python, etc.). ## Usage ```bash # 1. Install dependencies pip install -r requirements.txt # 2. Set Tavily API key export TAVILY_API_KEY=your_key_here # 3. Load documents into ChromaDB (once) python load_docs.py # 4. Run the chat interface python main.py ```