mariahberdnikova 10ed9f8617 revert 1748a39f01
revert Обновить vector_store.py
2026-05-28 16:07:36 +00:00
2026-05-28 13:04:50 +00:00
2026-05-28 13:05:10 +00:00
2026-05-28 13:05:38 +00:00
2026-05-28 13:33:05 +00:00
2026-05-28 16:07:36 +00:00

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
S
Description
No description provided
Readme 64 KiB
Languages
Python 100%