Open-source · Self-hosted · 100% Local

Your thoughts,
organized.
Your life, understood.

2BAgent is a privacy-first AI agent that captures your thoughts from anywhere, finds them by meaning, and delivers daily briefings — all running on your own machine. No subscriptions. No cloud lock-in. No data leaving your device.

1024
vector dimensions
32
MCP tools
8
AI jobs/day
0
cloud required
🌅
Good morning — here's your day
2BAgent · morning briefing · 7:00 am
You captured 11 thoughts yesterday — 3 decisions, 2 insights, 4 tasks.
Active theme: database optimization has appeared 6× this week.
2 stale tasks: "Review PR" (3d) and "Follow up with Alice" (6d).
Next meeting: Q2 planning at 2pm. Alice confirmed. Agenda not set.
Pattern: Decisions made on Fridays tend to be revisited Monday — consider a decision log.
just now · discord
Captured
DECISION: use asyncpg over SQLAlchemy — raw SQL gives us full control over query planning
decision#database#architecture
3 mins · mcp
Semantic Match · 0.93
"I asked 'what database decisions did I make?' and it found this from 3 weeks ago — without remembering the exact words."
insight#semantic-search
⚙️ Python 3.12
🗄️ PostgreSQL + pgvector
🤖 Ollama (local)
🐳 Docker Compose
💬 Discord Bot
🧩 32 MCP Tools
📧 Gmail + Calendar
📓 Obsidian

Sound familiar?

Your brain captures thousands of ideas, decisions, and commitments every week. Most of them disappear. 2BAgent is built to fix exactly that.

💭
Brilliant ideas go missing
You had a flash of insight during your commute. By the time you're at your desk, it's gone. You remember you had the idea but not what it was.
"I know I thought about this before… I just can't find where I wrote it down."
😵
Monday morning paralysis
Inbox has 47 unread messages. Three tasks are overdue. A meeting is in 30 minutes. You have no idea where to start or what matters most.
"Every week I spend the first hour just figuring out what I was doing."
🤝
Relationships fading silently
You meant to reconnect with an old colleague. Three months passed. Another relationship gone quiet — not from conflict, just from forgetting.
"I genuinely care, I just lose track of people when life gets busy."
📋
Tasks with no lifecycle
You captured a to-do six days ago. It has no due date, no status, no follow-up. It's just sitting there — and you don't know about the backlog growing in silence.
"My tasks pile up until they become small disasters."
🔒
Cloud services you can't trust
Your thoughts are personal. Strategies are confidential. You don't want your second brain living in a corporate data center, subject to policy changes and breaches.
"I stopped using Notion for sensitive work. I need something I own."
🔍
Keyword search fails you
You search for "database performance" but you wrote "asyncpg bottleneck." You search for "Alice" but you tagged it "team lead." You know the thought exists. You can't reach it.
"I know I wrote this down somewhere — but the search can't find it."

Three pillars of a real second brain

2BAgent is built around three capabilities that work together to turn scattered thoughts into a living knowledge system that grows smarter over time.

Capture everywhere
One Discord command. A direct API call. A message in Claude Desktop. However you work, 2BAgent receives your thoughts, auto-classifies them by type and topic, and stores them with a semantic embedding — in under 200ms.
🔍
Find by meaning
Hybrid search combines 1024-dimensional vector embeddings (Ollama, local) with full-text search. Ask "what did I decide about the database?" and find results even if you never used those exact words. Zero cloud calls.
🧠
Understand your patterns
Eight AI jobs run while you sleep. Morning briefings, evening reviews, relationship decay alerts, stale task nudges, weekly pattern recognition. The agent reads your context and delivers synthesized insights to Discord each day.

A complete second brain stack

From capture to synthesis, every component is purpose-built and runs locally.

💬
Discord Integration
Full slash command suite: /capture, /search, /recent, /todo, /stats, /agent. Works in any server you add the bot to.
slash commands
🔍
Hybrid Search
Vector cosine similarity (0.7×) merged with full-text search (0.3×). Finds by meaning when keywords fail. Switch modes per query.
semantic + FTS
🌅
Daily AI Briefings
Morning and evening synthesis via Claude CLI → Gemini → raw fallback. Briefings include thoughts, calendar, Gmail, habits, and open tasks.
7am + 9pm daily
📧
Gmail & Calendar
Read your inbox and calendar via OAuth2 (shared token). Email content wrapped in guardrails before synthesis. Calendar events pulled into morning briefing.
Google OAuth2
Task Lifecycle
Full CRUD for tasks: capture (any capitalization), list open, complete, reopen, search overdue. Staleness check nudges you at 8am for any task idle 48h+.
case-insensitive
🌱
Habit Tracking
Configure pillars in HABITS.md. Log completion via MCP or Discord. Evening check at 8:30pm nudges unchecked habits. Streak tracking included.
pillar-based
📓
Obsidian Vault
Read any note, search the vault, and write new notes via Local REST API. Write access is gated to a configurable folder for safety.
read + write
🤖
ReAct Agent
Interactive conversational AI in Discord. Ask questions, get it to research tasks and return links, search notes, check your calendar — all in one reply.
12 tools
📊
Pattern Recognition
Weekly deep-analysis job surfaces recurring themes, accelerating projects, and silent ones. Delivered every Sunday morning before you start the week.
Sunday 6am
🔗
32 MCP Tools
Claude Desktop connects via stdio transport. Search, create tasks, read Gmail, browse calendar, manage habits, write to Obsidian — all from a conversation.
stdio transport
🛡️
Autonomy Levels
Four levels: observer (read-only), advisor (Discord posts), assistant (draft creation), partner (send email + calendar writes). You control how much it acts.
configurable
Smart Scheduling
8 default cron jobs. Add custom jobs from Discord using plain English: "every Friday at 5pm". The agent interprets it into a cron expression for you to confirm.
APScheduler

Simple in use, powerful in practice

Three things you do. Hundreds of things the agent does for you.

Capture a thought
Use Discord, the REST API, or Claude Desktop to send any thought. No formatting required. Type it as you'd say it.
Discord /capture POST /capture MCP tool
🔍
Find it by meaning
Ask in plain English from Discord, Claude Desktop, or the web UI. The hybrid search combines semantic and full-text modes automatically.
Discord /search GET /search semantic_search
🧠
Wake up to insights
Every morning a briefing lands in your Discord. Patterns, stale tasks, relationship nudges, and your calendar — synthesized by your local AI agent.
7am briefing 9pm review Discord DM

Everything connected, nothing in the cloud

2BAgent sits at the center of your digital life. It reads from the tools you already use and brings it all into one private context layer.

💬
Discord
Capture, search, agent commands, briefings
bi-directional
📧
Gmail
Read, search, send — OAuth2 token shared
OAuth2
📅
Google Calendar
Events pulled into morning briefing
OAuth2
📓
Obsidian
Read vault, search notes, write to safe folder
Local REST API
2B
Agent
🧩
Claude Desktop
32 MCP tools via stdio transport
MCP
🤖
Ollama (local)
mxbai-embed-large · 1024-dim embeddings
100% local
🗄️
PostgreSQL + pgvector
Thoughts, tasks, agent runs, scheduled jobs
Docker
🌐
Web Search
Brave Search API → DuckDuckGo fallback
optional

Your data. Your machine.
Your rules.

2BAgent was designed from day one for the privacy-conscious. The only data that ever leaves your machine is what you explicitly configure — and everything has a zero-cloud fallback.

🔒 PostgreSQL on localhost 🤖 Ollama embeddings never leave host 🏠 Docker, not cloud 📵 Runs fully offline
🗄️
PostgreSQL database
Bound to 127.0.0.1 — never exposed beyond your machine
always local
🤖
Ollama embeddings
mxbai-embed-large runs on your CPU/GPU — no API calls
always local
🧠
AI synthesis (Claude CLI)
Uses your own Claude subscription — same privacy guarantees
your account
🌐
Brave Search API
Used only when you explicitly trigger web_search
opt-in only
📧
Gmail / Calendar
Your own Google OAuth2 token, stored locally in data/agent/tokens/
opt-in only
🚫
Telemetry, analytics, tracking
Zero. None. Not a single call home.
never
Interactive Demo

See 2BAgent in action

The interactive demo walks through every major feature — capture pipeline, hybrid search, Think-Act-Observe cycle, scheduled jobs, MCP tools, and the full architecture. No installation required.

Capture & auto-classify
🔍 Hybrid semantic search
🤖 Think-Act-Observe cycle
💬 ReAct interactive agent
Scheduled jobs
🧩 32 MCP tools
🏗️ Architecture explorer

Up and running in 15 minutes

You need Docker and Ollama. Everything else is included.

1
Prerequisites
Install Docker (OrbStack recommended on Mac) and Ollama, then pull the embedding model:
ollama pull mxbai-embed-large
Create a Discord bot at discord.com/developers and copy the bot token.
2
Configure & launch
cp .env.example .env
# Fill in POSTGRES_PASSWORD,
# TWOBAGENT_API_KEY,
# TWOBAGENT_DISCORD_TOKEN

docker compose --profile discord up -d
API at localhost:8900 · Web UI at localhost:8900/ui
3
Start the agent runner
docker compose --profile agent up -d
Set autonomy: TWOBAGENT_AGENT_AUTONOMY_LEVEL=advisor

Morning briefing fires at 7am. Evening review at 9pm. First run: type /agent run in Discord.
4
Connect Claude Desktop (MCP)
Add to claude_desktop_config.json:
{
  "mcpServers": {
    "2bagent": {
      "command": "/bin/bash",
      "args": ["~/2bagent/scripts/start-mcp.sh"]
    }
  }
}
5
Google & Obsidian (optional)
Gmail & Calendar OAuth:
python scripts/setup-google-auth.py
Obsidian: install Local REST API plugin, then set TWOBAGENT_OBSIDIAN_API_KEY in .env.
6
Verify everything works
localhost:8900/health — all green

Discord: /health — services up

Capture your first thought:
/capture INSIGHT: I'm building my second brain
Then search: /search second brain