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