2026-06-04 23:12:47 +00:00
2026-06-02 07:23:59 +00:00
2026-06-04 20:08:13 +00:00
2026-06-04 20:08:19 +00:00
2026-06-01 17:36:32 +00:00
2026-06-03 10:25:19 +00:00
2026-06-03 10:25:26 +00:00
2026-06-04 20:08:36 +00:00
2026-06-04 20:08:42 +00:00
2026-06-02 07:47:17 +00:00
2026-06-04 20:09:00 +00:00
2026-06-03 10:25:50 +00:00

RAG Agent with Qdrant and Tavily

This repository implements an AI agent that can answer questions using a local knowledge base stored in Qdrant and uptodate information fetched from the web via Tavily. The agent is built with LangChain 1.x and Ollama for local LLM and embeddings.

Features

  • Local RAG Semantic search in Qdrant using Ollama embeddings.
  • Web search Tavily integration for realtime information.
  • Automatic source selection The LLM decides whether to use the local KB or the web.
  • Persistent vector store Data is saved in ./qdrant_db and reused across runs.
  • Interactive CLI Add documents, ask questions, and see the source.

Installation

# 1. Pull required Ollama models
ollama pull llama3
ollama pull nomic-embed-text

# 2. Install Python dependencies
pip install -r requirements.txt

# 3. Run Qdrant (Docker recommended)
#    If you prefer a local binary, download from https://qdrant.tech
#    Docker command:
#    docker run -p 6333:6333 qdrant/qdrant

Usage

# Start the CLI
python -m workspace.task-6a1864f78a94f887e50d46da.cli

Commands:

  • /add <directory> Load all .txt and .md files from the directory into Qdrant.
  • /search <question> Ask the agent a question.
  • /quit Exit.

Example:

> /add ./documents
Loaded 12 chunks into Qdrant.
Documents added.
> /search What is LangGraph?
Answer:
LangGraph is a framework for building ...
Source: chromadb

Environment Variables

  • TAVILY_API_KEY Your Tavily API key.

Create a .env file in the project root:

TAVILY_API_KEY=your_api_key_here

Project Structure

workspace/
├─ task-6a1864f78a94f887e50d46da/
│  ├─ vector_store.py          # Qdrant vector store helpers
│  ├─ tools.py                 # Local KB and web search tools
│  ├─ agent.py                 # Agent definition
│  ├─ cli.py                   # Interactive command line
│  ├─ requirements.txt
│  └─ README.md

License

MIT

S
Description
Экзамен: RAG-агент с ChromaDB и веб-поиском
Readme 192 KiB
Languages
Python 100%