Skip to content

Nikhil-4404/Autonomous-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Research Agent (LangChain)

This project implements an autonomous research agent using LangChain. The agent accepts a topic, searches the web, consults a knowledge source, extracts insights, and generates a structured report.

Features

  • LangChain-based agent workflow
  • Supports 100% free models like Groq and Ollama, as well as OpenAI and Anthropic
  • Uses at least 2 tools:
    • Free Web search via DuckDuckGo
    • Knowledge lookup via Wikipedia
  • Produces reports with:
    • Cover Page
    • Title
    • Introduction
    • Key Findings
    • Challenges
    • Future Scope
    • Conclusion
  • Includes sample outputs

Project Structure

.
|-- main.py
|-- requirements.txt
|-- .env.example
|-- README.md
|-- outputs/
|   |-- sample_ai_healthcare.md
|   `-- sample_ev_education.md
`-- src/
    |-- __init__.py
    |-- agent.py
    |-- prompts.py
    `-- report_writer.py

Setup

  1. Create and activate a virtual environment.
python -m venv .venv
.venv\Scripts\Activate.ps1
  1. Install dependencies.
pip install -r requirements.txt
  1. Copy .env.example to .env and add your keys.

For Groq (Free & Fast):

LLM_PROVIDER=groq
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.3-70b-versatile

For Ollama (Free & Local - No API Key Needed!):

  1. Install Ollama from top-level and run ollama run llama3.
  2. Update your .env:
LLM_PROVIDER=ollama
OLLAMA_MODEL=llama3

You can also use OpenAI and Anthropic as shown in the .env.example.

Usage

Run from the project root:

python main.py --topic "Impact of AI in Healthcare"

Optional output path:

python main.py --topic "Role of Electric Vehicles in Sustainable Transportation" --output outputs\ev_report.md

How It Works

  1. The agent receives a topic.
  2. It uses:
    • web_search (DuckDuckGo) to collect current information from the web entirely free of API keys.
    • wikipedia to gather background knowledge.
  3. The research notes are consolidated by the agent.
  4. A report-writing chain converts the notes into a structured final report.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages