Files
povtornyy-ekzamen-2-sravnit…/README.md
T

64 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LangGraph Comparative Review Agent
This project implements a LangGraph agent that, given three entities (e.g., technologies, products, or approaches), produces a comparative review. The agent:
1. Generates 35 comparison criteria using an LLM.
2. Performs a web search for each entitycriterion pair via Tavily and stores a short note.
3. Builds a Markdown table with the findings.
4. Produces a verdict recommending which entity suits which use case.
## Features
- **LLM powered**: Uses OpenAIs GPT model to generate criteria and verdicts.
- **Web search**: Uses Tavily to fetch up-to-date information for each pair.
- **CLI**: Run from the command line with default or custom entities.
- **Modular**: Separate files for state, nodes, graph, and CLI.
## Setup
```bash
# 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
# Create a .env file with your API keys
cp .env.example .env
# Edit .env and fill in your keys
```
## Usage
```bash
python src/main.py
```
The script will compare the default entities: **Chroma, FAISS, Qdrant**.
You can also provide custom entities:
```bash
python src/main.py --entities "TensorFlow, PyTorch, JAX"
```
The output will display:
1. Generated comparison criteria.
2. The Markdown table of findings.
3. The final verdict.
## Project Structure
```
src/
├── cli.py # CLI entry point
├── graph.py # LangGraph definition
├── main.py # Script to run the graph
├── nodes.py # Node implementations
└── state.py # TypedDict for state
```
## License
MIT License