How itzshrvsh/moshi works
Purpose and Entry Points
This repository appears to be a local “Moshi” agent/runtime workspace: it combines lifecycle/process management, Android and tunnel capabilities, persistent memory, and Telegram bot interfaces. There is no README content, so behavior must be confirmed from implementation.
Likely operational entry points:
• start_moshi.sh
• start_moshi.bat
• memory_server.py
• telegram/bot.py
Moshi Runtime Orchestration
The Moshi-prefixed modules form the primary runtime/control plane. They likely define startup configuration, lifecycle transitions, process execution, capability registration, and health diagnostics:
• moshi_config.py
• moshi_lifecycle.py
• moshi_process.py
moshi_manifest.py and moshi_capability.py likely provide the declared contract for enabled functions/components, separating what the runtime can expose from how each capability executes.
Device, Artifact, and Connectivity Capabilities
Android interaction, artifact handling, and external connectivity appear to be distinct capability domains:
• moshi_android.py
• moshi_artifact.py
• moshi_tunnel.py
This separation suggests the core runtime delegates infrastructure-specific work rather than embedding device or network logic directly in lifecycle management. Tunnel behavior is a material boundary because it may expose local services or connect the runtime to remote consumers.
Memory Service Boundary
Persistent or retrievable agent memory is isolated under a dedicated package and service wrapper:
• mem0/memory.py
• memory_server.py
• memory_mcp.py
mem0/memory.py is the apparent storage/domain layer. memory_server.py likely exposes it as a running service, while memory_mcp.py likely adapts memory operations to an MCP-oriented protocol or client boundary. This keeps agent memory usable independently of a specific chat interface.
Chat and Agent Interfaces
Telegram is an external-facing channel with several implementation variants:
• telegram/bot.py
• telegram/bot_agent_final.py
• telegram/bot_upgraded.py
The primary intended bot should be established before deployment; the variant names indicate iterative or backup implementations rather than a single unambiguous production entry point. The bot layer should call into the Moshi runtime and/or memory service rather than own core execution state.
Operational Validation and Diagnostics
Runtime verification is represented by dedicated orchestration and diagnostic modules:
• moshi_doctor.py
• moshi_e2e.py
• moshi_manifest.py
moshi_doctor.py likely checks environment/runtime prerequisites, while moshi_e2e.py appears to exercise integrated flows across services. moshi_manifest.py is architecturally important as the likely source of truth for what a running Moshi instance exposes.
Deployment Shape
The repository is primarily Python with platform-specific launch wrappers:
• start_moshi.sh
• start_moshi.bat
• opencode.json
Expected execution flow is: launcher initializes Moshi configuration and lifecycle management; the runtime starts required processes/capabilities; optional memory and Telegram services connect at their respective boundaries; diagnostics/e2e paths validate the assembled system.
Main entry points: moshi_lifecycle.py Lifecycle manager · memory_server.py Memory server · moshi_capability.py Capability registry · moshi_config.py Runtime config
Components 18
Moshi Runtime
- Shell launcher
start_moshi.sh - Windows launcher
start_moshi.bat - Runtime config
moshi_config.py - Lifecycle manager · Coordinates runtime startup and transitions.
moshi_lifecycle.py - Process manager
moshi_process.py - Capability manifest · Declares functions and components exposed by Moshi.
moshi_manifest.py - Capability registry
moshi_capability.py - Runtime doctor · Checks environment and runtime prerequisites.
moshi_doctor.py - End-to-end validation · Exercises assembled service flows.
moshi_e2e.py
Capabilities
- Android capability
moshi_android.py - Artifact capability
moshi_artifact.py - Tunnel capability · Exposes local services or connects remote consumers.
moshi_tunnel.py
Memory Service
- Memory domain
mem0/memory.py - Memory server
memory_server.py - Memory MCP adapter
memory_mcp.py
External Interfaces
- Telegram bot · Primary bot implementation is not confirmed.
telegram/bot.py - Final bot variant
telegram/bot_agent_final.py - Upgraded bot variant
telegram/bot_upgraded.py
Connections 19
- Shell launcher → Runtime config: loads
- Windows launcher → Runtime config: loads
- Runtime config → Lifecycle manager: configures
- Lifecycle manager → Process manager: manages
- Lifecycle manager → Capability manifest: uses
- Capability manifest → Capability registry: declares
- Capability registry → Android capability: registers
- Capability registry → Artifact capability: registers
- Capability registry → Tunnel capability: registers
- Lifecycle manager → Memory server: starts optionally
- Memory server → Memory domain: serves
- Memory MCP adapter → Memory server: adapts
- Telegram bot → Lifecycle manager: invokes runtime
- Telegram bot → Memory server: uses memory
- Final bot variant → Lifecycle manager: alternative interface
- Upgraded bot variant → Lifecycle manager: alternative interface
- Runtime doctor → Lifecycle manager: checks
- End-to-end validation → Lifecycle manager: validates
- End-to-end validation → Memory server: validates