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

1.7 KiB
Raw Blame History

Research Brief Generator

This project builds a LangGraph agent that produces a cohesive research brief comparing three entities (e.g., vector databases).
The agent:

  1. Generates comparison criteria using an LLM.
  2. Performs iterative web searches with Tavily for each entitycriterion pair.
  3. Aggregates findings into a concise research brief.
  4. Provides a recommendation verdict.

Prerequisites

  • Python 3.10+
  • An OpenAI API key (set in OPENAI_API_KEY environment variable).
  • A Tavily API key (set in TAVILY_API_KEY environment variable).

Setup

# Clone the repository
git clone https://github.com/yourusername/research-brief.git
cd research-brief

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate   # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create a .env file with your API keys
echo "OPENAI_API_KEY=your_openai_key" >> .env
echo "TAVILY_API_KEY=your_tavily_key" >> .env

Usage

Run the CLI with default entities (Chroma, FAISS, Qdrant):

python -m src.main

Provide custom entities:

python -m src.main --entities "EntityA, EntityB, EntityC"

The output will display the research brief followed by the verdict.

Project Structure

src/
├── cli.py          # CLI entry point
├── graph.py        # LangGraph workflow
├── main.py         # Package entry
├── nodes.py        # Node implementations
└── state.py        # State schema

Extending

  • Replace the LLM with a local model (e.g., Ollama) by adjusting the llm initialization in nodes.py.
  • Add more sophisticated parsing or error handling as needed.

License

MIT License