ef8bb1bd2c090958b88411f021fd0d5a780a59be
RAG Agent with ChromaDB and Web Search
This project demonstrates a simple Retrieval-Augmented Generation (RAG) agent that uses ChromaDB as the vector store and performs web search as a fallback. The agent is written in Node.js and uses only the required dependencies.
Features
- Vector storage with ChromaDB (in-memory by default).
- Simple embedding function (placeholder) – replace with a real model for production.
- Web search using DuckDuckGo’s HTML interface.
- RAG agent that retrieves relevant documents or falls back to web search.
Installation
npm install
Usage
node src/index.js "Your query here"
If no query is provided, it defaults to "What is ChromaDB?".
Running Tests
npm test
Project Structure
src/
index.js # Entry point
agent.js # RAG agent logic
vectorStore.js # ChromaDB wrapper
webSearch.js # Simple web search helper
test.js # Basic test for vector store
Extending
- Replace the
embedfunction invectorStore.jswith a real embedding model (e.g., OpenAI, HuggingFace). - Persist the ChromaDB collection by configuring the client with a storage path.
- Add a language model to generate responses from retrieved documents.
License
MIT
Description
Languages
Python
82.6%
JavaScript
16.6%
Dockerfile
0.8%