feat: solution for 'Агент с RAG-памятью'
CI / build (push) Has been cancelled

This commit is contained in:
2026-06-29 17:42:08 +03:00
parent f3a37e6521
commit e47bfa261d
6 changed files with 222 additions and 80 deletions
+89 -18
View File
@@ -1,25 +1,96 @@
# Агент с RAG-памятью
# Agent with RAG Memory
Главная
Мои задания
Агент с RAG-памятью
EN
Агент с RAG-памятью
Зачёт
Версия 10
Дедлайн сдачи: 31.08.2026
This project demonstrates a simple RAG (Retrieval-Augmented Generation) agent that uses LangChain tools to perform basic operations via an interactive command line interface (CLI).
В работе
## Features
Требуется доработка
- **Add Numbers** Add two integers using the `add_numbers` tool.
- **Search Items** Search a predefined list of strings for a query using the `search_item` tool.
- **Interactive CLI** Use `/add`, `/search`, and `/quit` commands to interact with the agent.
В работе обнаружены несоответствия требованиям задания: отсутствуют инструменты, реализованные через декоратор @tool с требуемыми именами, и README не отражает фактическую реализацию. Пожалуйста, внесите необходимые правки и повторно отправьте решение.
## Installation
Редактирование ответа
```bash
# Clone the repository
git clone https://git.brojs.ru/kuzakhmetovartur/agent-s-rag-pamyatyu.git
cd agent-s-rag-pamyatyu
Заполните ответ и отправьте работу на проверку преподавателю.
# Create a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\\Scripts\\activate`
Тип ответа
Текст
Ссы
# Install dependencies
pip install -r requirements.txt
```
## Usage
Run the CLI:
```bash
python -m src.main
```
You will see a prompt:
```
Welcome to the RAG Agent CLI!
Available commands:
/add <int> <int> - Add two numbers.
/search <query> - Search items in memory.
/quit - Exit the program.
```
### Commands
- **/add**
Add two integers.
```text
>> /add 5 7
Result: 12
```
- **/search**
Search the internal memory for a query string.
```text
>> /search python
Matches found:
1. Python programming
```
- **/quit**
Exit the program.
```text
>> /quit
Goodbye!
```
## Project Structure
```
agent-s-rag-pamyatyu/
├── src/
│ ├── __init__.py
│ ├── cli.py
│ ├── main.py
│ └── tools.py
├── README.md
├── requirements.txt
└── pyproject.toml
```
## Dependencies
- `langchain` The core library for building language model agents.
- `python-dotenv` (Optional) For loading environment variables if needed.
## License
MIT License
---
Feel free to extend the tools or the CLI to suit your needs!