How vinhnxab/bean works
Bean is a self-hosted personal AI agent delivered as a Rust CLI and web/Telegram service. Users submit prompts through a client; the Router owns run admission and lifecycle, the agent uses an LLM and tools, and results return through the channel. Persistent sessions and related state use SQLite. Major documented branches include browser automation, scheduled tasks, voice, skills, and a read-only MCP server. Some subsystem paths and links rely on README statements or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: router.rs Run router · registry.rs Tool registry · main.rs Bean CLI · routes.rs Web API
Components 22
User interfaces
- Bean CLI
crates/bean/src/main.rs - Web UI
web/src/App.tsx - Web API
crates/bean-web/src/server/routes.rs - Telegram channel
crates/bean-channels/src/telegram/handlers.rs
Agent runtime
- Run router
crates/bean-core/src/router.rs - Agent execution
crates/bean-core/src/agent.rs - Tool dispatch
crates/bean-core/src/agent/tool_call.rs
Providers and tools
- LLM providers
crates/bean-llm/src/lib.rs - Tool registry
crates/bean-tools/src/registry.rs - Browser automation
crates/bean-browser/src/act_tools.rs - Memory query
crates/bean-tools/src/builtin/memory_query.rs
State and security
- Core store API
crates/bean-core/src/store.rs - SQLite persistence
crates/bean-memory/src/store/sqlite/worker.rs - Security controls
crates/bean-security/src/policy.rs
Product capabilities
- Read-only MCP
crates/bean-core/src/mcp_server/handler.rs - Scheduled tasks
crates/bean-core/src/scheduler.rs - Skills
crates/bean-skills/src/loader.rs - Push-to-talk voice
crates/bean-speech/src/lib.rs - Billing tools
crates/bean-billing/src/tool.rs - Marketing tools
crates/bean-marketing/src/publish.rs - Infrastructure scan
crates/bean-scan/src/tool.rs
Other components
- User
Connections 23
- User → Bean CLI: runs command
crates/bean/src/main.rs - Bean CLI → Run router: starts service
- User → Web UI: uses
README.md - Web UI → Web API: requests API
- Web API → Run router: serves agent operations
- Telegram channel → Run router: submits prompts
crates/bean-channels/src/telegram/handlers.rs - Run router → Agent execution: owns runs
crates/bean-core/src/router.rs - Agent execution → Tool dispatch: dispatches tools
crates/bean-core/src/agent.rs - Tool dispatch → LLM providers: requests completion
- Tool dispatch → Tool registry: invokes tools
- Tool registry → Browser automation: offers browser tools
- Tool registry → Memory query: offers memory query
crates/bean-tools/src/builtin/memory_query.rs - Run router → Core store API: uses persistence
crates/bean-core/src/router.rs - Core store API → SQLite persistence: persists state
- Run router → Security controls: applies policy
- Bean CLI → Read-only MCP: serves MCP
crates/bean/src/main.rs - Read-only MCP → Run router: calls tools
crates/bean-core/src/mcp_server/handler.rs - Run router → Scheduled tasks: runs scheduled tasks
- Tool registry → Skills: loads skills
- Web API → Push-to-talk voice: exposes voice endpoints
crates/bean-web/src/server/routes.rs - Tool registry → Billing tools: provides billing tools
- Tool registry → Marketing tools: provides publishing tools
- Tool registry → Infrastructure scan: provides scan tools