From c9b557514de902166df01e7688ab56669d7365fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=B8=D1=8F=20=D0=91=D0=B5=D1=80=D0=B4?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=D0=B0?= Date: Thu, 28 May 2026 13:05:38 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 78 +++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 64019df..c837cb4 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,58 @@ -# RAG-Agent — AI-агент с локальной базой знаний +# RAG Agent with Qdrant + Ollama -## Стек -- **Python 3.10+** -- **Qdrant** — векторная база данных -- **Ollama** — локальные LLM и эмбеддинги (`llama3`, `nomic-embed-text`) -- **LangChain / LangGraph** — агент с инструментами +## Stack +- Python 3.10+ +- Qdrant — vector database +- Ollama — local LLM and embeddings (`llama3`, `nomic-embed-text`) +- LangChain — agent and RAG framework -## Быстрый старт - -### 1. Установка зависимостей - -```bash -pip install -r requirements.txt -``` - -### 2. Запуск Ollama и загрузка моделей +## Setup +### 1. Pull Ollama models ```bash ollama pull llama3 ollama pull nomic-embed-text ``` -### 3. Запуск Qdrant (Docker) - +### 2. Start Qdrant ```bash -docker run -d -p 6333:6333 -p 6334:6334 \ - -v qdrant_storage:/qdrant/storage \ - qdrant/qdrant +docker run -p 6333:6333 qdrant/qdrant ``` -### 4. Инициализация базы знаний из директории - +### 3. Install Python dependencies +```bash +pip install -r requirements.txt +``` + +## Usage + +### Initialize knowledge base from a directory ```bash -# Поместите .txt / .md файлы в папку docs/ python init_knowledge_base.py ./docs ``` +Loads all `.txt` and `.md` files from the given directory into the vector store. -### 5. Запуск интерактивного клиента - +### Run the interactive client ```bash python client.py ``` -## Команды в клиенте +### Client commands +| Command | Description | +|---------|-------------| +| `/add \| <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 | -| Команда | Описание | -|---------|----------| -| `/add <текст>` | Добавить текст в базу знаний | -| `/add-file <путь>` | Загрузить файл в базу знаний | -| `/search <запрос>` | Прямой семантический поиск (без агента) | -| `/quit` | Выйти | -| `<любой текст>` | Отправить запрос агенту | - -## Архитектура +## Project Structure ``` -client.py ← интерактивный CLI-клиент -│ -├── agent.py ← create_react_agent (llama3 + RAG-инструменты) -│ └── tools.py ← @tool: search_knowledge_base, add_to_knowledge_base -│ -└── vector_store.py ← Qdrant + OllamaEmbeddings + RecursiveCharacterTextSplitter - -init_knowledge_base.py ← загрузка документов из директории +. +├── 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 ``` \ No newline at end of file