This repository contains a research agent built using LangGraph, which combines the power of Claude (via Anthropic) and Tavily search to provide intelligent research capabilities.
- Interactive chat interface
- Integration with Claude 3.5 Sonnet
- Real-time web search using Tavily
- Stateful conversation management using LangGraph
- Python 3.8 or higher
- pip (Python package manager)
- Virtual environment (recommended)
- Clone the repository:
git clone <repository-url>
cd langraph_poc- Create and activate a virtual environment:
python -m venv lang_env
source lang_env/bin/activate # On Windows, use: lang_env\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
Create a
.envfile in the root directory with the following content:
ANTHROPIC_API_KEY=your_anthropic_api_key
TAVILY_API_KEY=your_tavily_api_keyYou can obtain these API keys from:
- Anthropic API: https://console.anthropic.com/
- Tavily API: https://tavily.com/
- Make sure your virtual environment is activated
- Run the research agent:
python research_agent.py-
Interact with the agent by typing your questions. The agent will:
- Process your input
- Use Claude for understanding and response generation
- Perform web searches when needed
- Provide comprehensive answers
-
To exit the conversation, type:
quitexitq
research_agent.py: Main application file containing the LangGraph implementation.env: Environment variables configurationrequirements.txt: Python dependencies
The project uses several key libraries:
- langchain: For LLM integration
- langgraph: For building stateful applications
- anthropic: For Claude API access
- tavily-python: For web search capabilities
- python-dotenv: For environment variable management
If you encounter issues with API keys:
- Verify that your
.envfile is properly formatted - Ensure the API keys are correctly set in your environment
- Check that you have sufficient API credits/quota
[Add your license information here]
[Add contribution guidelines here]