Spaces:
Running
Running
Research Agent with LangGraph
This project implements a research agent using LangGraph and LangChain. The agent is capable of researching any domain using three powerful tools and can be deployed with a Chainlit frontend.
Features
- Domain-specific research assistant
- Three specialized research tools:
- Web Search - For general queries and recent information
- Research Paper Search - For academic papers and scientific information
- Data Analysis - For analyzing data provided by the user
- Interactive Chainlit web interface
- Configurable research domain
Architecture
This project uses:
- LangGraph: For creating the agent's workflow graph with cyclic behavior
- LangChain: For tool integration and language model interactions
- Chainlit: For the web-based frontend
- OpenAI GPT-4o: As the underlying language model
Installation
- Clone this repository
- Install dependencies using UV (recommended) or pip:
# Using UV
uv pip install -r requirements.txt
Configuration
- Create a
.env
file in the project root with the following content:
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key
Usage
To run the application:
chainlit run app.py -w
This will start the Chainlit server and open a web browser with the interface.
File Structure
agent.py
: Contains the LangGraph implementation of the research agenttools.py
: Defines the three research toolsapp.py
: Chainlit web interfacechainlit.md
: Welcome page content for Chainlitrequirements.txt
: Dependencies for the project
Customization
You can customize the agent by:
- Modifying the
DOMAIN
variable inapp.py
- Adding new tools in
tools.py
- Changing the system prompt in
agent.py
Example Queries
- "What are the latest developments in quantum computing?"
- "Find research papers about climate change impacts on agriculture"
- "Analyze this data: [paste JSON or CSV]"
License
MIT