Walk through every major feature — from capturing a thought in Discord to how the Think-Act-Observe cycle synthesizes your context into a morning briefing. Then explore the full system architecture and service map.
Each tab shows a realistic trace of what happens when you use that feature — from the command you type to what the system does internally.
You type a thought in Discord. Here is exactly what happens in the next 200ms.
Discord → API
What gets stored in PostgreSQL
DECISION: insight: ToDo: todo- task: meeting: PERSON: — or plain text → auto-classified as note
Hybrid search combines vector cosine similarity with PostgreSQL full-text search. Here's a real query trace — including what happens when your keywords don't match what you wrote.
Discord query
SQL executed (hybrid)
Result details — ranked by hybrid score
Every morning at 7:00 AM the agent synthesizes your last 24 hours of captures, open tasks, calendar events, and recent emails into a single briefing — then posts it to your Discord agent channel.
Sample output — Discord
How the briefing is generated
agent_runs table, appended to USER.md (episodic memory), and posted to your Discord agent channel. The next synthesis automatically includes this run as context.
| morning_briefing | 7:00 AM daily · synthesis + email + calendar + tasks |
| evening_review | 9:00 PM daily · synthesis + habit check |
| task_staleness | 8:00 AM daily · nudge for tasks idle 48h+ |
| relationship_decay | Mon 9:00 AM · surface fading relationships |
| pattern_recognition | Sun 6:00 AM · weekly deep analysis |
| weekly_review | Sun 6:00 PM · topic clusters + forgotten items |
| idea_roulette | Mon 10:00 AM · surface a forgotten old thought |
| memory_consolidation | 2:00 AM daily · promote facts to MEMORY.md |
Type any question or request in your interactive Discord channel. The ReAct loop (Reason + Act) plans which tools to call, executes them, observes the results, and replies — all in one response.
Discord conversation
ReAct loop — internal trace
list_tasks · complete_task · reopen_task · research_task · add_task_note · semantic_search · list_recent · get_stats · web_search · get_calendar_event · list_calendar_events · list_emails
Full task lifecycle via Discord slash commands. Capture in any format, list open tasks, mark done, reopen, or ask the agent to research what to do next.
Open task list — /todo list
After /todo done asyncpg pool
open (default), done, or all.
/todo list open.
Case-insensitive capture — all map to type=task
2BAgent is built from five cooperating processes and a shared PostgreSQL data layer. All local. No cloud required.
Key data flows
| Source | Path | What happens | Tech |
|---|---|---|---|
| Discord /capture | Bot → :8900/ | Thought extracted, embedded by Ollama, stored in PostgreSQL with vector + FTS index | PythonasyncpgOllama |
| MCP capture tool | stdio → FastAPI | Claude Desktop calls create_task or semantic_search MCP tool → HTTP to :8900 |
MCP SDKDocker |
| APScheduler 7am | Runner → Ollama → Claude CLI → Discord | Morning briefing: fetch recent thoughts + Gmail + Calendar → synthesize via Claude/Gemini → post to agent channel | APSchedulerClaude CLI |
| Discord /ask | Bot → :8766/ask → ReAct loop | Interactive agent: multi-step Reason + Act cycle across up to 12 tools, reply to Discord channel | ReActDiscord.py |
| Gmail fetch | Runner → gmail.py → Google API | OAuth2 token refreshed, inbox fetched, body wrapped in guardrails XML before synthesis prompt | OAuth2guardrails |
| Search query | Client → :8900/search → DB | Query embedded by Ollama, hybrid SQL merges cosine (0.7×) + FTS ts_rank (0.3×), returns ranked results | pgvectorOllama |
| Memory consolidation 2am | Runner → consolidator.py → USER.md / MEMORY.md | Nightly: promote durable facts from episodic USER.md to curated MEMORY.md via AI synthesis | PythonClaude/Gemini |
Each service has a single responsibility. They communicate over HTTP and a shared PostgreSQL database — no message queues, no pub/sub.