Files
2026-06-01 16:44:55 +00:00

27 lines
960 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```