Lu is a local, multi-channel Agent runtime written in Go. It unifies model calls, tool execution, multi-channel message ingress, and on-device memory into an extensible runtime.
The current codebase includes a CLI, WebSocket/Web UI, macOS iMessage channel, skills system, memory search, multi-agent support, scheduler/heartbeat, and optional FaceTime voice features.
- Multiple entrypoints:
cmd/cli(interactive terminal) andcmd/server(WebSocket + iMessage unified server) - Multiple model providers: OpenAI-compatible API and Anthropic, with configurable
base_url - Multi-agent runtime: per-agent provider/system/tools/work_dir/security
- Tool calling: built-ins
shell/read/write/edit/apply_patch, plus optionalprocess/schedule/facetime_call/skill/sub_agent - Skills: auto-discover from
./skillsand~/.lu/skills, with hot reload - Memory: Markdown chunking + vector search + FTS5 keyword search (requires
-tags fts5) - Observability: OpenTelemetry (metrics/traces) + optional full payload NDJSON sink
- Automation:
scheduler(cron-like jobs) +heartbeat(periodic task file checks) - Multimodal: image input, voice transcription (Whisper/FunASR), optional FaceTime pipeline
Core flow:
- A channel receives user messages (CLI / WebSocket / iMessage)
- The agent loads conversation history (SQLite)
- The agent calls an LLM provider
- When the model requests tool calls, the runtime executes tools and appends results to context
- The final response is delivered back to the channel
Key packages:
internal/agent: agent loop, tool execution, context managementinternal/server+internal/channel: WebSocket/iMessage services and routinginternal/provider: provider adapters and registryinternal/tool: tool definitions, registry, filteringinternal/skill: discovery, parsing, hot reloadinternal/memory: indexing, search, memory toolsinternal/scheduler/internal/heartbeat: scheduling and periodic wake-upsinternal/security: workspace + shell policyinternal/observability: OTel and full-payload sink
.
├── cmd/
│ ├── cli/ # CLI entrypoint
│ └── server/ # unified server entrypoint
├── internal/ # core runtime
├── web/ # static Web UI assets
├── skills/ # project-level skills
├── scripts/ # helper scripts
├── tools/
│ ├── audiocap/ # audio capture tool (Xcode)
│ └── screencap/ # screen capture tool (Swift Package)
├── config.example.yaml # config template
├── config.yaml # local config (do not commit)
├── lu.db # SQLite sessions + memory index
└── docs/ # design docs and plans
- Go 1.25.6+
- C toolchain (required by
go-sqlite3) - macOS (only required for iMessage / FaceTime features)
Optional dependencies (enable per feature):
imsg(iMessage send/receive)osascript(macOS UI automation)ffmpeg(audio conversion)whisper-cli/whisper-cpp(local transcription)- Python environment (FunASR realtime transcription)
AudioCapCLI(built fromtools/audiocap)screencap(built fromtools/screencap)
- Create config
cp config.example.yaml config.yamlAt minimum, configure:
provider:openaioranthropic- corresponding API key (prefer environment variables)
- enable features you need:
channels.websocket/channels.imessage/memory/facetime
- Build and run (recommended)
make build
make run-cli
make run-server- Or use Go directly (FTS5 build tag is required)
go run -tags fts5 ./cmd/cli --config config.yaml
go run -tags fts5 ./cmd/server --config config.yamlWhen server is running (default port 8080):
http://localhost:8080/(Web UI)ws://localhost:8080/ws(WebSocket)http://localhost:8080/api/conversations(conversation list)
go run -tags fts5 ./cmd/cli --config config.yaml --list-models
go run -tags fts5 ./cmd/cli --config config.yaml --conversation <conversation_id>Client message:
{
"type": "message",
"conversation_id": "uuid",
"content": "hello"
}Server events:
chunk: streaming output chunkdone: end of responseerror: error message
providers/provider: model providers (useprovidersfor multi-provider setups)agents: multi-agent definitions (provider/system/tools/work_dir/security)channels.websocket.agent/channels.imessage.agent: bind channels to agentsmemory.*: vector + keyword hybrid search parametersscheduler.enabled: cron-like jobsheartbeat.*: periodic checks forHEARTBEAT.mdand agent wake-upslogging.otel.*: OTel exporter settingslogging.full_payload.*: full payload NDJSON archive + redactionfacetime.*: optional FaceTime voice pipeline
See config.example.yaml for the full configuration surface.
make fmt
make test
make buildEquivalent:
go fmt ./...
go test -tags fts5 ./...
go build -tags fts5 ./cmd/cli ./cmd/serverNote: some tests depend on external tools (e.g., ffmpeg, whisper-cpp, osascript). They may be skipped or fail if the tools are missing.
- Do not commit real API keys, tokens, or private conversation data
- Prefer environment variables for secrets
- Set
channels.imessage.allow_listbefore enabling iMessage - If you enable the shell tool, configure per-agent
securitypolicies
MIT License. See LICENSE.