Skip to content

divinedev111/autopilot

Repository files navigation

CI Go Report Card License: MIT

autopilot

Your AI runs your digital life while you sleep.

A single Go binary that acts as your personal AI agent. It monitors your portfolio, tracks job applications, watches the web for changes, researches anything you ask, and sends you briefings on a schedule. Runs as a REPL, a background daemon, or one-shot from the command line. Your data stays on your machine.


$ autopilot

   ___       __            _ __     __
  / _ |__ __/ /____  ___  (_) /__  / /_
 / __ / // / __/ _ \/ _ \/ / / _ \/ __/
/_/ |_\_,_/\__/\___/ .__/_/_/\___/\__/
                   /_/
  Your AI runs your digital life while you sleep.

  Type a message to get started. 'exit' or Ctrl+C to quit.

autopilot> how is my portfolio doing?

  Portfolio Summary
  ──────────────────────────────────
  Holdings:        $47,832.50 (+$1,243.80 today, +2.67%)

  AAPL    10 shares   $1,952.50   +$23.40 (+1.21%)
  GOOGL    5 shares   $  891.25   +$15.75 (+1.80%)
  BTC     0.5         $44,988.75  +$1,204.65 (+2.75%)

  Market: S&P +0.8%, NASDAQ +1.2%, BTC +2.7%

  Note: Your BTC position is now 94% of your portfolio.
  Consider rebalancing — it was 85% last week.

autopilot> watch https://openai.com/careers for new backend roles

  Watcher "openai-careers" added for https://openai.com/careers (interval: 30m)
  First snapshot captured (42,387 bytes).

autopilot> what happened in AI this week?

  Searching... 12 sources found

  ## AI News — Week of April 7, 2026

  1. **Anthropic released Claude 4.6** with native 1M token context window,
     making long-document analysis practical without chunking.

  2. **OpenAI launched GPT-5.4** with built-in computer use capabilities,
     bypassing the need for external tool frameworks.

  3. **Meta open-sourced LLaMA 4** (405B parameter MoE), achieving GPT-4
     level performance with Apache 2.0 licensing.

  4. **Google DeepMind published AlphaCode 3** results, solving 78% of
     competitive programming problems at the Codeforces Division 2 level.

  Sources: TechCrunch, The Verge, Hacker News, ArXiv, Reuters

autopilot> track application: stripe, backend engineer

  Tracking: Backend Engineer at Stripe [found]

autopilot> prep me for that stripe interview

  Interview Prep: Backend Engineer at Stripe
  ───────────────────────────────────────────

  Company Overview:
  Stripe processes $1T+ in annual payment volume. Engineering culture
  emphasizes correctness, API design, and distributed systems reliability.

  Tech Stack:
  Ruby (legacy), Go (new services), AWS, custom PaaS ("Sorbet" type checker)

  Likely Interview Topics:
  - System design: payment processing pipeline, idempotency
  - API design: versioning, backwards compatibility
  - Distributed systems: consistency, failure handling at scale
  - Coding: string manipulation, graph problems (medium-hard)

  Talking Points From Your Background:
  - Distributed systems work at Intuit
  - Go expertise across your open source projects
  - Infrastructure and backend focus

autopilot> exit
Goodbye.

Features

  • Autonomous operation — Runs on a cron schedule. Morning briefings, evening digests, price alerts, and web change detection happen while you're away. No babysitting required.

  • Research anything — Ask a question, get a synthesized answer with sources. Uses DuckDuckGo search and page fetching to gather real data, not hallucinated facts.

  • Financial monitoring — Real-time stock and crypto quotes via Yahoo Finance. Portfolio tracking with cost basis, allocation analysis, and price alerts that fire when thresholds are crossed.

  • Job search and tracking — Searches job boards based on your keywords, tracks applications through the pipeline (found > applied > interviewing > offer), and generates interview prep briefs.

  • Web monitoring — Watch any URL for meaningful changes. Content-hashing with noise filtering ignores timestamps and CSRF tokens. Alerts only when something real changed.

  • Persistent memory — SQLite-backed storage that remembers your conversation history, learned facts about you, and all module state across restarts.

  • Multi-channel delivery — Talk to it in the terminal, get alerts on Discord via webhooks, or have a full two-way conversation through Telegram.

  • Local-first — All data lives in ~/.autopilot/data/. No cloud accounts, no telemetry, no third-party data storage. Your conversations and portfolio data stay on your machine.

  • Single binary — One go build, one binary. No Python, no Node, no Docker required. Drop it on any machine and run.


Quick Start

1. Install

go install github.com/divinedev111/autopilot/cmd/autopilot@latest

Or build from source:

git clone https://github.com/divinedev111/autopilot.git
cd autopilot
go build -o autopilot ./cmd/autopilot

2. Configure

cp config.example.yaml ~/.autopilot/config.yaml

# Set your API key (pick one):
export ANTHROPIC_API_KEY="sk-ant-..."
# or edit ~/.autopilot/config.yaml and set anthropic_key

3. Run

./autopilot

That's it. You're talking to your agent.


Usage

Interactive mode (REPL)

autopilot

Opens a terminal session where you can have a conversation. The agent has access to all tools — search, portfolio, job tracking, web monitoring — and will use them autonomously based on what you ask.

Background daemon

autopilot daemon

Runs in the background with scheduled tasks:

  • Morning briefing at 8:00 AM (configurable)
  • Evening digest at 8:00 PM (configurable)
  • URL watchers checked every 5 minutes
  • Price alerts evaluated on schedule

Alerts are delivered through configured channels (Discord, Telegram).

One-shot query

autopilot ask "what's the current price of NVDA?"

Ask a question, get an answer, exit. Useful for scripts and cron jobs.

Shortcuts

autopilot brief          # Run morning briefing now
autopilot portfolio      # Show portfolio summary
autopilot watch          # List active URL watchers
autopilot jobs           # Show tracked applications

Modules

Module Tools What it does
research web_search, fetch_page, summarize_findings Search the web, fetch pages, synthesize research
finance get_stock_quote, get_portfolio, get_market_summary, set_price_alert Live quotes, portfolio tracking, market overview, price alerts
monitor add_watch, list_watches, remove_watch, check_watch Watch URLs for changes, diff detection, intelligent alerting
jobs search_jobs, track_application, list_applications, prep_interview Job search, application pipeline, interview preparation

The agent decides which tools to call based on your message. You don't need to invoke tools directly.


Configuration

Configuration lives at ~/.autopilot/config.yaml. Copy config.example.yaml to get started.

# API key — or set ANTHROPIC_API_KEY env var
anthropic_key: "sk-ant-..."

# Model
model: "claude-sonnet-4-20250514"

# Where state is stored
data_dir: "~/.autopilot/data"

# Notification channels
discord:
  enabled: true
  webhook_url: "https://discord.com/api/webhooks/..."

telegram:
  enabled: true
  bot_token: "123456:ABC-DEF..."
  chat_id: "987654321"

# Scheduled tasks (cron syntax)
schedule:
  morning_briefing: "0 8 * * *"
  evening_digest: "0 20 * * *"

# Module-specific settings
modules:
  finance:
    portfolio:
      - symbol: AAPL
        shares: 10
      - symbol: BTC-USD
        shares: 0.5
  jobs:
    keywords: ["golang", "backend", "distributed systems"]
    location: "remote"

Environment variable overrides

Variable Overrides
ANTHROPIC_API_KEY anthropic_key
AUTOPILOT_MODEL model
AUTOPILOT_DATA_DIR data_dir
AUTOPILOT_DISCORD_WEBHOOK discord.webhook_url
AUTOPILOT_TELEGRAM_TOKEN telegram.bot_token
AUTOPILOT_TELEGRAM_CHAT_ID telegram.chat_id

Architecture

cmd/autopilot/main.go          CLI entry point, mode selection, wiring
internal/
  agent/
    agent.go                    Core agentic loop (prompt -> tool calls -> response)
    tool.go                     Tool type and Claude API conversion
  config/
    config.go                   YAML + env var config loading
  memory/
    memory.go                   SQLite-backed persistent storage
  scheduler/
    scheduler.go                Cron expression parser and task runner
  router/
    router.go                   Multi-channel notification dispatch
    discord.go                  Discord webhook sender
    telegram.go                 Telegram bot (bidirectional)
  modules/
    research/
      research.go               Web search, page fetching, synthesis
    finance/
      finance.go                Portfolio, quotes, market data, alerts
    monitor/
      monitor.go                URL watching, content hashing, diff detection
    jobs/
      jobs.go                   Job search, application tracking, interview prep

How the agent loop works:

  1. User message is added to conversation history (SQLite)
  2. System prompt is built with personality, user facts, and available tools
  3. Message is sent to Claude with all registered tools
  4. If Claude returns tool calls, they're executed and results fed back
  5. Loop continues until Claude returns a final text response
  6. Response is stored in history and returned to the user

The loop is bounded to 25 tool calls per turn to prevent runaway execution. Transient API errors (429, 5xx) are retried with exponential backoff.


Daemon Mode

autopilot daemon

The daemon runs two types of background work:

Scheduled tasks — Cron-based tasks like morning briefings and evening digests. The scheduler parses standard 5-field cron expressions and runs tasks in goroutines at their scheduled times.

Telegram bot — If configured, the daemon starts a long-polling loop that listens for incoming Telegram messages. Each message is routed through the agent, and the response is sent back. Only messages from your authorized chat_id are processed.

The daemon shuts down gracefully on SIGINT or SIGTERM.

Running with Docker

docker compose up -d

The docker-compose.yml runs the daemon with a persistent volume for data and mounts your config file.


Building from Source

Requirements:

  • Go 1.23+ (uses CGO for SQLite)
  • GCC (for sqlite3 compilation)
git clone https://github.com/divinedev111/autopilot.git
cd autopilot
CGO_ENABLED=1 go build -o autopilot ./cmd/autopilot

Docker build

docker build -t autopilot .
docker run -v ~/.autopilot:/root/.autopilot -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" autopilot

Running tests

go test ./...

Data Storage

All persistent data lives in a single SQLite database at ~/.autopilot/data/memory.db:

  • messages — Conversation history (prunable)
  • facts — Key-value pairs the agent learns about you over time
  • module_state — Per-module state (watchers, alerts, applications)

The database uses WAL mode for concurrent read/write safety and a 5-second busy timeout.

To start fresh:

rm ~/.autopilot/data/memory.db

License

MIT -- see LICENSE.

About

Your AI runs your digital life while you sleep. Research, finance, jobs, monitoring — terminal, Discord, Telegram. Go.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors