selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

agent-second-brain logo

Self-host agent-second-brain

v3.0.3

Voice-first Telegram bot for an Obsidian knowledge graph

ReleaseOpen SourceMIT
Updated4 months ago
LanguagePython
Setup difficultyAdvanced
Stars
411
RAM
1GB RAM (minimum), 2GB recommended
Requires
Claude Code CLI, Deepgram API, Node.js, Python, Telegram Bot API, Tmux, Uv
Install with Systemd
Telegram chat interface showing the bot responding to a voice noteHero image showing the Agent Second Brain concept

What is agent-second-brain?

Agent Second Brain is a self-hosted personal assistant that turns Telegram into a voice-first capture interface for a persistent, long-term memory system. You send voice notes, text, photos, documents, or forwarded posts to a Telegram bot; a long-lived interactive Claude Code session (running in tmux) classifies the input, writes typed, wiki-linked markdown cards into your Obsidian vault, manages reminders and recurring tasks from natural language, and runs nightly processing to update goals, rebuild a knowledge graph with Ebbinghaus-style decay, and send a daily report. The vault stays on your server as plain markdown — no lock-in. It requires a VPS (Ubuntu 22.04+), a Claude Pro/Max subscription, and a free Deepgram API key for transcription. Installation is a single bootstrap command that sets up systemd services, a dbrain CLI, and health monitoring. The memory engine (autograph) is also usable standalone.

Should you self-host agent-second-brain?

agent-second-brain scores 50/100 on selfhost.directory (how scoring works) and ranks #40 of 120 in AI Assistant. It has 411 GitHub stars.

It shipped 6 stable releases in the past year. The latest, v3.0.3, came out on 20 June 2026. New versions land roughly every 3 days.

Setup is advanced: plan for several services and some ongoing maintenance. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is hermes-agent (89/100, 257 885 stars). It scores higher overall, so compare the two before you pick. See agent-second-brain vs hermes-agent side by side.

Features

  • Automatic MOC generation and vault maintenance
  • Claude Code integration with MCP support
  • Ebbinghaus-style memory decay
  • Knowledge graph memory
  • Multi-modal input capture
  • Nightly processing and daily reports
  • Plain markdown vault with no lock-in
  • Self-healing watchdog and health monitoring
  • Self-managed routines and reminders
  • Voice capture and transcription

agent-second-brain README

How to install agent-second-brain

Install agent-second-brain with Systemd

Environment variables
TELEGRAM_BOT_TOKEN, DEEPGRAM_API_KEY, VAULT_PATH, ALLOWED_USER_IDS, TZ, CLAUDE_MODEL, CRON_ENABLED, and advanced options

One-command bootstrap installer that sets up systemd user units (dbrain-bot, dbrain-watchdog, dbrain-process.timer, dbrain-doctor.timer), dbrain CLI, and runs a health check. Requires Ubuntu 22.04+ with 1GB+ RAM.

How to configure agent-second-brain

  • ALLOW_ALL_USERSfalseAllow EVERYONE to talk to the bot — security risk, leave false

    Allow EVERYONE to talk to the bot — security risk, leave false

    values: true, false

  • BRAIN_SESSION_NAMEtmux session name (empty = generated and persisted per install)

    tmux session name (empty = generated and persisted per install)

  • CLAUDE_MODELModel for the persistent session. Empty = Claude Code default (Opus). Set to "sonnet" to reduce weekly-limit pressure for a 24/7 bot.

    Model for the persistent session. Empty = Claude Code default (Opus). Set to "sonnet" to reduce weekly-limit pressure for a 24/7 bot.

    values: sonnet

  • CRON_ENABLEDtrueScheduled jobs (the agent manages them itself via the cron skill). Defaults are sensible; set CRON_ENABLED=false to turn the ticker off.

    Scheduled jobs (the agent manages them itself via the cron skill). Defaults are sensible; set CRON_ENABLED=false to turn the ticker off.

    values: true, false

  • CRON_JOB_TIMEOUT600Cron tuning: per-job timeout

    Cron tuning: per-job timeout

  • CRON_MAX_CONSECUTIVE_ERRORS3Cron tuning: failures before auto-disable

    Cron tuning: failures before auto-disable

  • CRON_RETRY_SECONDS300Cron tuning: retry delay for a failed one-shot

    Cron tuning: retry delay for a failed one-shot

  • CRON_TICK_SECONDS60Cron tuning: ticker interval

    Cron tuning: ticker interval

  • DEEPGRAM_API_KEYDeepgram API key for voice transcription

    Deepgram API key for voice transcription

  • RUNTIME_DIR~/.dbrainRuntime dir for session locks/logs and cron state (must be a LOCAL fs)

    Runtime dir for session locks/logs and cron state (must be a LOCAL fs)

  • TELEGRAM_BOT_TOKENTelegram Bot API token from @BotFather

    Telegram Bot API token from @BotFather

  • TZUTCTimezone for systemd timers and reports (e.g. Asia/Tashkent, Europe/Moscow)

    Timezone for systemd timers and reports (e.g. Asia/Tashkent, Europe/Moscow)

  • VAULT_PATH./vaultPath to Obsidian vault directory

    Path to Obsidian vault directory

agent-second-brain releases & version history

More in Personal Productivity

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…