百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
momo-code

momo-code

> 开发工具
免费

MOMO CODE — 一款随您成长的 AI 编码代理

536 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

MOMO CODE — 一款随您成长的 AI 编码代理

MOMO CODE

txt

███╗   ███╗ ██████╗ ███╗   ███╗ ██████╗    ██████╗ ██████╗ ██████╗ ███████╗
████╗ ████║██╔═══██╗████╗ ████║██╔═══██╗  ██╔════╝██╔═══██╗██╔══██╗██╔════╝
██╔████╔██║██║   ██║██╔████╔██║██║   ██║  ██║     ██║   ██║██║  ██║█████╗  
██║╚██╔╝██║██║   ██║██║╚██╔╝██║██║   ██║  ██║     ██║   ██║██║  ██║██╔══╝  
██║ ╚═╝ ██║╚██████╔╝██║ ╚═╝ ██║╚██████╔╝  ╚██████╗╚██████╔╝██████╔╝███████╗
╚═╝     ╚═╝ ╚═════╝ ╚═╝     ╚═╝ ╚═════╝    ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝

MOMO CODE v1.0.0

AI-powered coding agent that evolves with you.
Built on opencode with a unique dual-speed self-evolution system based on Pioneer Agent.

Architecture

Two-Speed Evolution Algorithm System Technical Architecture

Table of Contents

  • Features
  • Installation
  • Quick Start
  • Usage
  • CLI Commands
  • Configuration
  • Experience Fast Loop (/evolve)
  • Self-Evolution Training (/fine-tune)
  • Migrating from Claude Code
  • Environment Variables
  • Architecture
  • Changelog
  • License

Features

  • 25+ LLM Providers — Deepseek, Zhipu (GLM), Moonshot (Kimi), Claude, GPT-4, Gemini, Doubao, OpenRouter, Groq, Mistral, and more. The \chat command uses OpenAI-compatible protocol only
  • Custom Provider — Plug in any OpenAI-compatible API with MOMO_CUSTOM_* env vars
  • Model Tiers — Zero-config selection: ultra / standard / lite
  • Experience Fast Loop (/evolve) — Second-level prompt injection via KEP protocol. Tactics distilled from success are auto-selected via Thompson sampling
  • Self-Evolution Training (/fine-tune) — Hour-level weight improvement via Monte Carlo Graph Search (MCGS) + LoRA
  • Self-Refinement (/refine) — Reviews session trajectories and proposes small, evidence-based improvements (tactics/prompt patches) that only take effect after human approval
  • Recursive Subagents (/agent) — RLM-style task decomposition: plan → parallel child processes → synthesis, with depth/budget rails
  • Graph Engine (/graph) — Long-horizon tasks as a resumable DAG of subagents: LLM-planned dependency graph, parallel execution, retries, and /sim world-agent nodes
  • Long-Running Work (/goal + /heartbeat + /daemon) — Persistent goals injected into every session, timed tasks, and a daemon loop for multi-hour autonomy
  • Simulation Agent (/sim) — LLM-driven control of a persistent Genesis physics world: the agent writes Python into a long-lived namespace (RLM-style), with skills-as-code loaded from ~/.momo/sim/skills/
  • Voice Input (/voice) — Speak your prompt: mic recording (sounddevice) → OpenAI-compatible STT (Whisper/Groq) → coding session
  • Claude Code Interop — Seamless migration, inherits .claude/ config, MCP servers, prompts
  • Local-first — Your code never leaves your machine. Open source, auditable
  • Effect-powered — Built with Effect for composable, type-safe code

Installation

Prerequisites

  • macOS or Linux (Windows via WSL)
  • Node.js ≥ 20.0.0 — install from https://nodejs.org if you don't have it
  • git and curl

Check with:

bash
node -v   # should print v20.x or later
npm -v
git --version
curl --version

Quick install (recommended)

bash
curl -fsSL https://momozi.cc/install | bash

The installer:

  1. Clones the repo into `~/.momo/lib/momo-code`
  2. Runs `npm install` + `npm run build` (about 30-60 s)
  3. Drops a wrapper at `~/.momo/bin/momo`
  4. Appends `/.momo/bin` to your PATH in `/.zshrc` or `~/.bashrc`

Open a new terminal (or run `source ~/.zshrc`) and then:

bash
momo --version    # 1.0.0
momo --help

If you see `command not found: momo`, your PATH didn't pick up the change — see INSTALL.md.

From source (manual)

bash
git clone https://github.com/momozi1996/momo-code.git
cd momo-code/packages/opencode
npm install                # installs all deps including TypeScript
npm run build              # compiles TS + fixes ESM imports
node bin/momo --version

From npm

npm package coming in v1.1. Use the Quick install above for v1.0.

Uninstall

bash
# Remove install artifacts
rm -rf ~/.momo

# Remove the PATH line from your shell rc
sed -i.bak '/# momo Code CLI/,+1d' ~/.zshrc    # zsh
sed -i.bak '/# momo Code CLI/,+1d' ~/.bashrc   # bash

1. Set up API key

bash
# Generic key (works with any provider)
export MOMO_API_KEY=your-api-key

# Or provider-specific
export MOMO_ANTHROPIC_API_KEY=sk-ant-...
export MOMO_OPENAI_API_KEY=sk-...

2. Start coding

bash
# Interactive mode
momo

# One-shot task
momo "Refactor auth to use Effect"

# Use a model tier
momo --model ultra "Complex architecture review"
momo --model standard "Fix the login bug"
momo --model lite "Quick code review"

3. First run

On first run, momo creates ~/.momo/:

~/.momo/
├── momo.jsonc          # Config
├── sessions/           # History
├── experience/         # Learned tactics (auto-created)
│   ├── tactics.json
│   └── ledger.jsonl
└── ...

Usage

Model Tiers

Tier Use Case
ultra Complex tasks, large context
standard Daily coding work
lite Quick tasks, low latency

CLI Options

bash
momo [options] [prompt]

Options:
  --model, -m        Model ID or tier
  --provider, -p   Provider
  --help                 Show help
  --version              Show version

CLI Commands

Coding Session

bash
momo                     # Show help and banner
momo "prompt"            # One-shot task
momo --model claude-sonnet-4 "task"

Experience Fast Loop (/evolve)

bash
momo /evolve                       # Run evolution with default settings
momo /evolve --mode=explore        # Favor exploration of new tactics
momo /evolve --mode=harden         # Favor proven high-win-rate tactics
momo /evolve --mode=convention-only # Only convention-type tactics
momo /evolve --list                # Show all learned tactics
momo /evolve --inject              # Inject tactics for current task
momo /evolve --solidify            # Apply verdict, update stats

Self-Evolution Training (/fine-tune)

bash
momo /fine-tune              # Diagnose, show training proposal
momo /fine-tune run          # Execute training pipeline
momo /fine-tune run --dry-run # Preview without executing
momo /fine-tune status       # Check training status
momo /fine-tune promote      # Promote candidate to production

Self-Refinement (/refine)

Reviews recent session trajectories and proposes small, reviewable improvements. Nothing is applied without human approval.

bash
momo /refine                 # Generate proposals from recent sessions
momo /refine list            # List proposals
momo /refine show        # Inspect evidence + content
momo /refine approve     # Approve (review gate)
momo /refine apply       # Apply: tactic → draft, patch → prompt file
momo /refine reject      # Reject

Recursive Subagents (/agent)

RLM-style recursion: the model decomposes a complex task, subagents run as child momo processes (parallel where possible), and a synthesizer merges results.

bash
momo /agent "Refactor the provider layer and update all callers and tests"

Rails: MOMO_RLM_MAX_DEPTH (3), MOMO_RLM_BUDGET (8), MOMO_RLM_TIMEOUT_MS (300000).

Graph Engine (/graph)

Turns a long-horizon task into a directed acyclic graph of self-contained subagent tasks. The model plans the DAG (with real dependencies), nodes run as child momo processes — in parallel per topological level, with dependency outputs passed downstream — failed nodes retry, and a final LLM pass synthesizes the report. State persists to ~/.momo/graphs/.json after every batch, so runs survive restarts.

bash
momo /graph run "Design + implement + test a persistence layer"   # plan → execute → synthesize
momo /graph resume         # Continue a long-horizon run where it stopped
momo /graph status         # Node states + outputs
momo /graph list               # Recent runs

Nodes can be marked "kind": "sim" by the planner — those become simulation agents driving the Genesis world via /sim run, so a graph can mix coding subagents with physics experiments.

Rails: MOMO_GRAPH_MAX_NODES (12), MOMO_GRAPH_MAX_RETRIES (2), MOMO_GRAPH_CONCURRENCY (defaults to MOMO_RLM_BUDGET).

Long-Running Work (/goal, /schedule, /heartbeat, /daemon)

bash
momo /goal add "Ship v2.0" "with full test coverage"   # Persistent goal
momo /goal list | log  "progress" | done       # Manage goals
momo /schedule add --every=60m "run tests and report"  # Timed task
momo /schedule add --at=07:30 "daily standup summary"  # Daily task
momo /heartbeat            # Run due tasks once
momo /daemon               # Foreground loop (Ctrl+C to stop)

Active goals are injected into every chat session. The daemon is a foreground process by design — background it with nohup/systemd/Task Scheduler. Budget rails: MOMO_DAEMON_MAX_RUNS, MOMO_DAEMON_MAX_HOURS (24).

Simulation Agent (/sim)

An LLM-driven agent that controls a persistent Genesis physics world. Requires Python with genesis-world installed (pip install genesis-world).

bash
momo /sim doctor                      # Check python/genesis/provider setup
momo /sim run "Stack the red cube on the blue cube"   # LLM control loop
momo /sim run "" --steps=40 --viewer            # Budget + live viewer
momo /sim exec "print(42)"            # One-shot world REPL
momo /sim exec --file=scene.py        # Run a script in a fresh world
momo /sim skills                      # List installed world skills
momo /sim eval --tasks=tasks.json     # Batch evaluation (fresh world per episode)

How it works: the CLI spawns a persistent Python process (python/genesis_world/server.py) holding a Genesis scene. Each loop step, the model replies with {"thought": ..., "code": ...}; the code runs in the persistent world namespace (gs, scene, step(n), your variables survive across steps). Skills are plain .py files dropped into ~/.momo/sim/skills/ — auto-loaded into every world. Sim runs are recorded as trajectories, feeding the /refine self-improvement loop.

Env: MOMO_SIM_PYTHON, MOMO_SIM_BACKEND (cpu/gpu), MOMO_SIM_MAX_STEPS (20), MOMO_SIM_SERVER.

Reasoning-Driven Optimization (/optim)

Parameter tuning driven by code understanding + explicit reasoning (inspired by optim-agent). The agent reads your code first and infers the physical/business meaning of every parameter, then proposes configurations with explicit _reasoning and a _note scratchpad fed forward across trials. Invalid proposals degrade to random sampling — a flaky agent can never crash a study.

bash
momo /optim scan src/serve.py --param=threshold:0.05:0.95   # read code → semantic map
momo /optim init quality --target=src/serve.py \
  --param=threshold:0.05:0.95 --param=budget:10:200:int,log \
  --metric=score --direction=max --cmd="python eval.py --threshold {threshold}"
momo /optim semantics quality approve     # human review gate
momo /optim run quality --trials=20       # reasoning-driven loop
momo /optim history quality               # full reasoning trace

Evaluators: --cmd (business command, metric from stdout) or --sim (experiment in the Genesis world, ESTOP-honored). Studies persist under ~/.momo/optim/studies// and resume automatically. See docs/optim.md.

Env: MOMO_OPTIM_HISTORY (5), `MOMO_OPTIM_N_INIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

agentaicli

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年9月9日
最后更新2026年9月17日
分类开发工具
定价免费

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具