How bretthoffman/luna_architecture works
Luna is a personal-assistant application: messages enter through chat transports, the routing spine interprets requests, and deterministic domain tools perform reads or mutations whose results are shaped for a response. The tree also shows proactive conversation, scheduled work, wearable-data integration, and an operator Control Center. The README documents launching the lightweight chat app; sampled source and the SOURCE INDEX support the core routing/tool relationships. Several domain and integration implementations are not excerpted, so their internal links are omitted rather than inferred.
Main entry points: runner.py Tool Runner · router.py Routing Spine · calendar/pipeline.py Calendar · finance/pipeline.py Finance
Components 21
Messaging
- Chat Lite
luna_control_center/chat_lite_app.py - SMS Adapter
integrations/twilio_sms_adapter.py - Message Relay
relay/app/api/message/route.ts
Assistant Runtime
- Routing Spine
luna_core/router.py - Context Builder
luna_core/context_builder.py - Tool Execution
luna_core/executors.py - Tool Selector
luna_core/tool_selector/model_client.py - Tool Runner
luna_core/tools/runner.py - Result Shaping
luna_core/tools/result_shaping.py
Domain Tools
Proactive Services
- Conversation Starter
luna_core/conversation_starter/controller.py - Body Signals
luna_core/body_signals/engine.py - Scheduled Invocations
luna_core/tools/scheduled_invocations/controller.py - Oura OAuth
integrations/oura_oauth_routes.py
Operations
- Operator Config
config/operator_config.py - Control Center
luna_control_center/app.py
Other components
- Owner
Connections 24
- Owner → Chat Lite: opens chat
- Owner → SMS Adapter: sends message
- Chat Lite → Routing Spine: submits message
- SMS Adapter → Routing Spine: forwards message
- Message Relay → Routing Spine: relays message
- Routing Spine → Context Builder: builds context
luna_core/router.py - Routing Spine → Tool Selector: selects tools
luna_core/router.py - Routing Spine → Tool Execution: dispatches
luna_core/router.py - Tool Execution → Tool Runner: invokes tools
- Tool Runner → Calendar: dispatches
luna_core/tools/calendar/pipeline.py - Tool Runner → Finance: dispatches
luna_core/tools/finance/pipeline.py - Tool Runner → Fitness: dispatches
luna_core/tools/fitness/pipeline.py - Tool Runner → Household: dispatches
luna_core/tools/household/pipeline.py - Tool Runner → Reminders: dispatches
luna_core/tools/reminders/pipeline.py - Calendar → Tool Runner: calls runner
luna_core/tools/calendar/pipeline.py - Finance → Tool Runner: calls runner
luna_core/tools/finance/pipeline.py - Fitness → Tool Runner: calls runner
luna_core/tools/fitness/pipeline.py - Tool Runner → Result Shaping: shapes response
- Finance → Result Shaping: shapes result
luna_core/tools/finance/pipeline.py - Calendar → Result Shaping: shapes result
luna_core/tools/calendar/pipeline.py - Body Signals → Conversation Starter: feeds signals
luna_core/conversation_starter/controller.py - Operator Config → Conversation Starter: sets intensity
config/operator_config.py - Control Center → Operator Config: configures
- Oura OAuth → Owner: reports connection
integrations/oura_oauth_routes.py