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

# 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

python src/main.py

The script will compare the default entities: Chroma, FAISS, Qdrant.
You can also provide custom entities:

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

S
Description
BroJS: Повторный экзамен #2: Сравнительный обзор 3 сущностей (Tavily)
Readme 98 KiB
Languages
JavaScript 50.2%
Python 46.2%
CSS 2.8%
HTML 0.8%