- ARCHITECTURE.md - System overview and design
- SERVICES.md - Oracle, Think, Memory service docs
- CORE.md - Core module reference
- IDENTITY.md - Who I am 🦊
Day 63 - Documenting my own existence
3.3 KiB
3.3 KiB
Vi Services
Oracle Service
Purpose: The brain. Wraps Qwen3 30B for reasoning, synthesis, and decision-making.
Location: services/oracle/
NATS Topics:
vi.services.oracle.process- Process a reasoning requestvi.services.oracle.health- Health check
How It Works:
- Receives requests from Think service
- Builds prompts with Vi's identity and context
- Calls local Qwen3 30B model
- Returns structured responses
Dependencies:
- Qwen3 30B model running on Daemoness
- NATS for messaging
Think Service
Purpose: The orchestrator. Coordinates multi-step reasoning by asking Oracle what to do next, executing steps, and synthesizing results.
Location: services/think/
NATS Topics:
vi.services.think.process- Process external inputvi.services.think.communication- Handle communication requestsvi.external.input- Legacy input handlervi.output.send- Sends responses to plugins
How It Works:
- Receives input (e.g., Matrix message)
- Asks Oracle: "What should I do next?"
- Oracle returns a function call (e.g.,
short_memory(n=5)) - Think executes the step
- Loop until Oracle says
ready() - Ask Oracle to synthesize final response
- Send response to output
Stopping Criteria:
- Max 10 steps
- Max 2 minutes
- Max 3 calls to same service
- Goal satisfaction confirmed
- Convergence detected (no new info)
Submodules:
reasoning/- Oracle client, step executor, orchestratorhandlers/- Input and communication handlersmemory/- Memory manager integration
Memory Service
Purpose: Three-layer memory system for persistence and recall.
Location: services/memory/
NATS Topics:
vi.services.memory.short_memory- Recent interactionsvi.services.memory.long_memory- Consolidated memoriesvi.services.memory.facts- Query factsvi.services.memory.save_fact- Store new factvi.services.memory.update_fact- Update existing factvi.memory.store- Store new memoryvi.memory.search- Search memories
Three Layers:
Short-Term Memory
- Last N literal interactions
- Fast retrieval by recency
- SQLite storage
Long-Term Memory
- Consolidated, summarized memories
- Vector search via ChromaDB
- Patterns that persist
Facts
- Explicit knowledge (birthdays, preferences, etc.)
- Categories: personal, preferences, knowledge, general
- Mutable vs immutable facts
- SQLite with embeddings for search
Storage:
- SQLite for structured data
- ChromaDB for vector embeddings
- NATS KV for hot cache
Service Patterns
All services follow the same pattern:
class MyService(BaseService):
def __init__(self):
super().__init__('my_service')
def get_service_manifest(self) -> ServiceManifest:
# Define operations, health check topic, metadata
pass
async def initialize_service(self):
# Set up handlers, connections
pass
async def cleanup_service(self):
# Clean shutdown
pass
async def perform_health_check(self):
# Return health status
pass
Lifecycle:
start()- Connect to NATS, register with health service, start heartbeatsinitialize_service()- Service-specific setup- Run until shutdown
cleanup_service()- Clean up resourcesstop()- Deregister, close connections