1.2 KiB
1.2 KiB
FAQ Bot with ChromaDB and LangChain
This project implements a simple FAQ bot that uses ChromaDB for vector storage and LangChain for building an intelligent agent. The bot can answer questions based on a small knowledge base stored in ChromaDB.
Features
- Stores documents in ChromaDB with embeddings from OpenAI.
- Uses the latest LangChain agent creation method (
initializeAgentExecutorWithOptions). - Simple CLI interface for interacting with the bot.
- Easy to extend with more documents or tools.
Setup
-
Clone the repository
git clone https://github.com/your-username/faq-bot-chromadb.git cd faq-bot-chromadb -
Install dependencies
npm install -
Configure environment
Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_api_key CHROMA_DB_PATH=./chromadb -
Run the bot
npm startYou can also use
npm run devfor automatic restarts with nodemon.
Adding Documents
The bot comes with two sample FAQ entries. To add more, edit src/index.js or use the addDocument function from src/vectorstore.js.
License
MIT License