How kkxx939-bot/habitus works
Habitus is a conversation-driven memory system with retrieval, prediction, and foresight capabilities. A principal path is client request through the HTTP API into conversation ingestion, ordered workflow jobs, and memory editing; recall is handled by a separate retrieval service. Model-backed behavior fusion and foresight judging are additional domain capabilities. The README is empty, and many modules were not sampled, so links are limited to relationships visible in excerpts or SOURCE INDEX references; unsampled subsystems are shown without inferred wiring.
Main entry points: client.py Model client · ingest.py Conversation ingestion · service.py Memory retrieval · author.py Scene concepts
Components 26
API and workflow
- HTTP API
habitus/integrations/http_api/app.py - HTTP handlers
habitus/integrations/http.py - Conversation ingestion
habitus/memory/workflow/ingest.py - Workflow jobs
habitus/memory/workflow/jobs
Memory domain
- Conversation journal
habitus/memory/conversation/messages.py - Memory editor
habitus/memory/editor/engine.py - Memory domain model
habitus/memory/model.py - Memory retrieval
habitus/memory/retrieval/service.py - Conversation compaction
habitus/memory/conversation/compaction.py - Conversation retention
habitus/memory/conversation/retention.py - Conversation segmentation
habitus/memory/conversation/segmentation.py
Reasoning
- Behavior fusion
habitus/behavior/fusion/service.py - Foresight context
habitus/foresight/context.py - Foresight judge
habitus/foresight/judge/service.py - Prediction queries
habitus/prediction/query.py - Scene concepts
habitus/scene/concepts/author.py - Scene rhythms
habitus/scene/concepts/rhythm.py - Prediction nodes
habitus/prediction/nodes.py
Model and platform
- Configuration loading
habitus/config/loader.py - Model client
habitus/model_client/client.py - Model contracts
habitus/model_client/contracts.py - Observability manager
habitus/infrastructure/observability/manager.py - Observation contract
habitus/foundation/observability.py - Structured logging
habitus/infrastructure/observability/logging.py
Other components
- API client
- Model provider
Connections 21
- API client → HTTP API: sends requests
habitus/integrations/http_api/app.py - HTTP API → HTTP handlers: routes to
habitus/integrations/http_api/app.py - Conversation ingestion → Conversation journal: appends messages
habitus/memory/workflow/ingest.py - Conversation ingestion → Workflow jobs: enqueues jobs
habitus/memory/workflow/ingest.py - Memory editor → Memory domain model: plans memory edits
habitus/memory/editor/engine.py - Memory retrieval → Conversation journal: reads conversation
habitus/memory/retrieval/service.py - Memory retrieval → Memory domain model: uses memory model
habitus/memory/retrieval/service.py - Memory retrieval → Conversation compaction: uses compaction
habitus/memory/retrieval/service.py - Memory retrieval → Conversation segmentation: uses segmentation
habitus/memory/retrieval/service.py - Conversation ingestion → Conversation retention: plans retention
habitus/memory/workflow/ingest.py - Conversation ingestion → Conversation segmentation: chunks messages
habitus/memory/workflow/ingest.py - Behavior fusion → Model client: requests judgement
habitus/behavior/fusion/service.py - Foresight judge → Model client: requests judgement
habitus/foresight/judge/service.py - Scene concepts → Model client: uses model client
habitus/scene/concepts/author.py - Scene concepts → Scene rhythms: uses rhythm concepts
habitus/scene/concepts/author.py - Model client → Model contracts: uses contracts
habitus/model_client/client.py - Model client → Model provider: calls provider
habitus/model_client/client.py - Observability manager → Structured logging: records events
habitus/infrastructure/observability/manager.py - Observability manager → Observation contract: implements contract
habitus/infrastructure/observability/manager.py - Prediction queries → Prediction nodes: queries nodes
habitus/prediction/query.py - Foresight context → Scene concepts: uses scene views
habitus/foresight/context.py