How phamhanam/lifemate works
LifeMate is an offline, per-sample agent that turns Vietnamese audio and sample context into ordered tool calls and a state hash. The CLI loads samples and wires the five stages; the pipeline coordinates perception, context building, planning, and guarded execution, then returns a snapshot for JSONL submission. The stages share typed contracts rather than importing each other. The README documents the stage boundaries and tool-environment constraints; unsampled stage internals are represented only where documented or supported by the source index.
Main entry points: pipeline.py Agent pipeline · cli.py CLI runner · planner.py LLM planner · executor.py Tool executor
Components 22
Runtime and contracts
- CLI runner
lifemate/cli.py - Runtime config
lifemate/core/config.py - Sample reader
lifemate/core/dataset.py - Stage contracts
lifemate/core/contracts.py - Timeout controls
lifemate/core/timing.py - Agent pipeline
lifemate/pipeline.py
Perception
- Whisper ASR
lifemate/stage1_perception/asr.py - Audio perception
lifemate/stage1_perception/perceiver.py
Context
- Tool catalog
lifemate/stage2_context/catalog.py - Context builder
lifemate/stage2_context/builder.py - Time anchors
lifemate/stage2_context/temporal.py
Planning
- LLM planner
lifemate/stage3_planning/planner.py - Few-shot index
lifemate/stage3_planning/fewshot.py - Prompt builder
lifemate/stage3_planning/prompt.py - Local LLM
lifemate/stage3_planning/llm.py - Action parser
lifemate/stage3_planning/parser.py
Execution
- Tool executor
lifemate/stage4_execution/executor.py - Tool gateway
lifemate/stage4_execution/gateway.py - Grounding guard
lifemate/stage4_execution/grounding.py
Submission
- JSONL writer
lifemate/stage5_submission/writer.py
Other components
- Sample provider
- ToolEnv
Connections 24
- Sample provider → CLI runner: supplies split
README.md - CLI runner → Runtime config: loads settings
lifemate/cli.py - CLI runner → Sample reader: reads samples
lifemate/cli.py - CLI runner → Agent pipeline: builds pipeline
lifemate/cli.py - CLI runner → JSONL writer: writes results
lifemate/cli.py - Agent pipeline → Runtime config: uses settings
lifemate/pipeline.py - Agent pipeline → Stage contracts: uses interfaces
lifemate/pipeline.py - Agent pipeline → Timeout controls: enforces deadlines
lifemate/pipeline.py - Agent pipeline → Audio perception: perceives audio
lifemate/pipeline.py - Agent pipeline → Context builder: builds context
lifemate/pipeline.py - Agent pipeline → LLM planner: plans actions
lifemate/pipeline.py - Agent pipeline → Tool executor: opens session
lifemate/pipeline.py - Audio perception → Whisper ASR: transcribes audio
lifemate/stage1_perception/__init__.py - Context builder → Tool catalog: selects tools
lifemate/stage2_context/builder.py - Context builder → Time anchors: derives anchors
lifemate/stage2_context/builder.py - LLM planner → Prompt builder: builds prompts
lifemate/stage3_planning/planner.py - LLM planner → Few-shot index: retrieves examples
lifemate/stage3_planning/planner.py - LLM planner → Local LLM: queries model
lifemate/stage3_planning/planner.py - LLM planner → Action parser: parses output
lifemate/stage3_planning/planner.py - Tool executor → Tool gateway: validates and calls
lifemate/stage4_execution/executor.py - Tool executor → Grounding guard: checks grounding
lifemate/stage4_execution/executor.py - Tool executor → ToolEnv: creates environment
lifemate/stage4_execution/executor.py - Agent pipeline → JSONL writer: returns result
README.md - CLI runner → Stage contracts: passes results
README.md