90769e4943311f8b3dc53a2abb85b57ca5e1317b
RAG Agent with Qdrant + Ollama
Stack
- Python 3.10+
- Qdrant — vector database
- Ollama — local LLM and embeddings (
llama3,nomic-embed-text) - LangChain — agent and RAG framework
Setup
1. Pull Ollama models
ollama pull llama3
ollama pull nomic-embed-text
2. Start Qdrant
docker run -p 6333:6333 qdrant/qdrant
3. Install Python dependencies
pip install -r requirements.txt
Usage
Initialize knowledge base from a directory
python init_knowledge_base.py ./docs
Loads all .txt and .md files from the given directory into the vector store.
Run the interactive client
python client.py
Client commands
| Command | Description |
|---|---|
/add <title> | <content> |
Add a document to the knowledge base |
/search <query> |
Semantic search in the knowledge base |
/quit |
Exit the client |
<any text> |
Send a question to the RAG agent |
Project Structure
.
├── vector_store.py # Qdrant + Ollama embeddings + chunking
├── tools.py # @tool: search_knowledge_base, add_to_knowledge_base
├── agent.py # create_react_agent with RAG tools
├── init_knowledge_base.py # Load documents from directory
├── client.py # Interactive CLI client
└── requirements.txt
Description
Languages
Python
100%