Update README.md
This commit is contained in:
@@ -1,44 +1,50 @@
|
|||||||
# Агент с RAG‑памятью
|
# RAG Agent with Qdrant and Ollama
|
||||||
|
|
||||||
## Описание
|
This repository contains a minimal but fully‑functional example of an AI agent that uses **Qdrant** as a local vector store, **Ollama** for embeddings and a local LLM, and **LangChain** for the agent logic.
|
||||||
|
|
||||||
Простой пример AI‑агента, использующего локальный RAG‑хранилище на базе **Qdrant** и **Ollama**. Агент умеет:
|
## Features
|
||||||
|
|
||||||
1. Добавлять документы в векторную базу.
|
* **Semantic search** – `search_knowledge_base` tool queries the vector store.
|
||||||
2. Выполнять семантический поиск по базе.
|
* **Document ingestion** – `add_to_knowledge_base` tool splits text into chunks and stores them.
|
||||||
3. Собирать ответы из найденных документов.
|
* **Interactive CLI** – simple command line interface for adding documents, searching and chatting with the agent.
|
||||||
|
* **Modular design** – vector store, tools and agent logic are separated into distinct modules.
|
||||||
|
|
||||||
## Стек
|
## Setup
|
||||||
|
|
||||||
* Python 3.10+
|
|
||||||
* Qdrant – векторная база данных
|
|
||||||
* Ollama – локальные LLM и эмбеддинги (`llama3`, `nomic-embed-text`)
|
|
||||||
* LangChain 1.x – фреймворк для агентов и RAG
|
|
||||||
|
|
||||||
## Установка
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Ollama
|
# 1. Install Ollama models
|
||||||
ollama pull llama3
|
ollama pull llama3
|
||||||
ollama pull nomic-embed-text
|
ollama pull nomic-embed-text
|
||||||
|
|
||||||
# Python пакеты
|
# 2. Install Python dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# 3. Start Qdrant (Docker recommended)
|
||||||
|
# docker run -p 6333:6333 qdrant/qdrant
|
||||||
```
|
```
|
||||||
|
|
||||||
## Запуск
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python agent.py "Какой последний прогресс в области ИИ?"
|
python -m workspace.task-6a02e23da6fe2e4ac16acf65.cli
|
||||||
```
|
```
|
||||||
|
|
||||||
## Структура проекта
|
The CLI accepts the following commands:
|
||||||
|
|
||||||
|
* `/add <title>` – add a new document. After the title you will be prompted to paste the content; finish with a line containing only `END`.
|
||||||
|
* `/search <query>` – perform a semantic search.
|
||||||
|
* `/quit` – exit.
|
||||||
|
|
||||||
|
Anything else is forwarded to the agent.
|
||||||
|
|
||||||
|
## Project structure
|
||||||
|
|
||||||
```
|
```
|
||||||
├── agent.py # основной скрипт агента
|
workspace/
|
||||||
├── qdrant_store.py # обёртка над QdrantVectorStore
|
├── task-6a02e23da6fe2e4ac16acf65/
|
||||||
├── chunker.py # разбиение документов на чанки
|
│ ├── agent.py # Agent and tool definitions
|
||||||
├── tools.py # инструменты для агента
|
│ ├── cli.py # Interactive command line interface
|
||||||
├── requirements.txt
|
│ ├── vector_store.py # Qdrant + Ollama wrapper
|
||||||
└── README.md
|
│ ├── requirements.txt
|
||||||
```
|
│ └── README.md
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user