Files
2026-05-28 16:59:38 +00:00

42 lines
904 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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.
# RAGAgent 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
* Python3.10+
* Ollama (downloaded models below)
```bash
ollama pull llama3
ollama pull nomic-embed-text
```
## Installation
```bash
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
```bash
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`).