A smart, tool-using research assistant powered by LangChain and OpenAI/Anthropic LLMs. It can search the web, extract information from Wikipedia, and save structured research summaries to a text file.
- ๐งพ Accepts a user query and returns a structured response with:
- Topic
- Summary
- Sources
- Tools used
- ๐ Uses DuckDuckGo for web search
- ๐ Queries Wikipedia for relevant info
- ๐พ Saves output to
research_output.txt
- LangChain
- OpenAI GPT-4o
- Anthropic Claude (optional)
- Python 3.10+
- Pydantic
- Dotenv
- Clone the repository
git clone https://github.com/your-username/research-assistant-agent.git cd research-assistant-agent - Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Set up .env file
OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key (optional)
๐งช Run the App
python main.py
๐ File Structure
- main.py # Entry script
- tools.py # Web, Wikipedia, and file-saving tools
- requirements.txt # Dependencies
- research_output.txt # Saved outputs
- .env # API keys