A voice-first AI companion for macOS. Floating presence widget, natural realtime conversation, persistent memory, and local computer tools.
Core loop: Press hotkey -> speak naturally -> Samantha listens in realtime -> uses tools and memory -> speaks back -> remembers what matters
Mental model: Samantha is a native desktop companion, not a chat window. Voice is primary. The floating presence widget is the interface.
macOS app (SwiftUI/AppKit, AVAudioEngine, hotkey, desktop context tools)
│
└── WebSocket (localhost:9090, PCM audio + JSON control/events)
│
└── Python backend (OpenAI Agents SDK)
- RealtimeAgent / RealtimeRunner
- Tool layer (bash, files, web search, visual context)
- Memory layer (SQLite + FTS5 + sqlite-vec)
- AppleScript via osascript
| Directory | Stack | Purpose |
|---|---|---|
app/ |
SwiftUI, AppKit, AVAudioEngine | Presence widget, audio I/O, hotkey loop, websocket client, desktop context tools |
backend/ |
Python, OpenAI Agents SDK, websockets, SQLite | Realtime runtime, tool layer, memory, local IPC server |
docs/ |
Markdown | Product spec, architecture, IPC contract, frontend handoff, design direction |
scripts/ |
Shell | Local bootstrap and health checks |
- Backend realtime session runtime is wired and tested
- Local IPC protocol is versioned and documented
- First visual-context phase is implemented as:
frontmost_app_contextcapture_display
- Backend-only integration coverage exists for the app-tool RPC path via the mock websocket harness
- Swift app source exists, but the checked-in Xcode project/workspace is still pending, so full macOS build verification is not yet complete
- The first Mac bring-up work is now staged in Beads under epic
sam-nzeand mirrored indocs/first-mac-session.md - A pure Swift alternative using Deepgram Voice Agent API (no Python backend) has been extracted to DeepVoice
# Rehydrate Beads after a fresh clone, if needed
bd init --from-jsonl --force --prefix sam
# Backend bootstrap
cd backend
./.venv/bin/ruff check samantha tests
./.venv/bin/python -m pytest -q
./.venv/bin/python -m pytest -q -m e2e
# Run backend
cd backend
./.venv/bin/samantha
# Mock websocket client
cd backend
./.venv/bin/python -m samantha.mock_client --get-state
./.venv/bin/python -m samantha.mock_client --auto-visual-context-tools --idle-timeout 2- Product Spec
- Architecture
- IPC Protocol
- Frontend Handoff
- Design Direction
- First Mac Session
- Implementation Reference
Latest verified backend state in this repo:
ruff check samantha testspytest -q->304 passedpytest -q -m e2e->3 passed, 301 deselected
The remaining verification gap is the macOS app runtime/build path.