Skip to content

AI agents that autonomously completes tasks using web browsing, code execution, and self-evaluation - Built with LangGraph

Notifications You must be signed in to change notification settings

nihal-5/autonomous-task-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Task Assistant

AI agent that autonomously completes complex tasks using web browsing, code execution, real-time data APIs, and self-evaluation - Built with LangGraph

🚀 Live Demo

View in AI Portfolio Dashboard | Direct Access

Part of Nihal's AI Portfolio - Unified dashboard featuring 5 cutting-edge AI services

Features

🤖 Autonomous Execution - Agent works independently with self-correction loops
🌐 Real-Time Data - Live stock prices, crypto, forex rates, weather
🔍 Web Search - Google search integration for current information
💻 Code Execution - Safe Python environment for calculations
📁 File Management - Read, write, copy, move, and delete files
📊 Workflow Transparency - See every step and tool usage in real-time
🎨 Modern Dashboard - Clean, professional UI with live progress updates

Quick Start

Prerequisites

  • Python 3.11+
  • OpenAI API key
  • (Optional) Serper API for Google Search
  • (Optional) Alpha Vantage API for financial data
  • (Optional) OpenWeatherMap API for weather

Installation

# Clone repository
git clone https://github.com/nihal-5/autonomous-task-assistant.git
cd autonomous-task-assistant

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Add your API keys to .env

Usage

Web Dashboard:

python app.py

Visit https://unharmable-threadlike-ruth.ngrok-free.dev:8000

CLI:

python assistant.py "Calculate 100 factorial and save to result.txt"

API Integration

API Purpose Free Tier
OpenAI GPT-4o-mini for intelligence Pay-as-you-go
Serper Google Search 2,500 searches/month
Alpha Vantage Stocks, Crypto, Forex 25 requests/day
OpenWeatherMap Weather data 1,000 calls/day

Get your API keys:

Example Tasks

# Financial Analysis
"Get Apple and Tesla stock prices, then calculate which is a better buy with $10,000"

# Multi-Data Query
"What's the weather in Tokyo and the current Bitcoin price?"

# Currency Conversion
"Convert 5000 USD to EUR and INR using today's rates"

# Research & Calculation
"Find Python's latest version and calculate how many days since release"

# File Operations
"Calculate the first 50 prime numbers and save to primes.txt"

Architecture

Built with LangGraph using a worker-evaluator pattern:

┌─────────────┐
│    User     │
└──────┬──────┘
       │
       ▼
┌─────────────┐     ┌──────────────┐
│   Worker    │────▶│    Tools     │
│   (GPT-4o)  │◀────│  Execution   │
└──────┬──────┘     └──────────────┘
       │
       ▼
┌─────────────┐
│  Evaluator  │──── Success? ──▶ Complete
│   (GPT-4o)  │                    │
└──────┬──────┘                    │
       │                           │
       └──── Needs Work ────▶ Loop Back

Available Tools

  • search_web - Google search for real-time info
  • get_stock_price - Real-time stock prices (AAPL, TSLA, etc.)
  • get_crypto_price - Cryptocurrency prices (BTC, ETH, etc.)
  • get_forex_rate - Currency exchange rates
  • get_weather - Weather for any city
  • wikipedia - Encyclopedic knowledge
  • execute_python_code - Python calculations
  • python_repl - Interactive Python
  • File tools - read, write, copy, move, delete

Technology Stack

  • LangGraph - Agent workflow orchestration
  • OpenAI GPT-4o-mini - Language model
  • FastAPI - Web backend with SSE streaming
  • Playwright - Browser automation (optional)
  • Python 3.11+ - Runtime

Configuration

Edit .env file:

# Required
OPENAI_API_KEY=your_key_here

# Optional (but recommended)
SERPER_API_KEY=your_key_here
ALPHA_VANTAGE_API_KEY=your_key_here
OPENWEATHER_API_KEY=your_key_here

# Settings
MODEL=gpt-4o-mini
TEMPERATURE=0.7
MAX_TURNS=30

Safety Features

  • 15 iteration limit - Prevents infinite loops
  • Sandboxed Python - 10 second timeout on code execution
  • Smart reasoning - Plans before acting, knows when to stop
  • Graceful fallbacks - Provides estimates when data unavailable

License

MIT - See LICENSE file

Contributors

Special thanks to all who contribute to this project!nse

Author

Built by nihal-5


Note: This agent requires API keys to unlock full functionality. Without them, it falls back to basic tools (Python execution and file operations).

About

AI agents that autonomously completes tasks using web browsing, code execution, and self-evaluation - Built with LangGraph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages