moyai README

项目的 README,来自 github.com/BerriAI/moyai。合并为一个 markdown 文件:README.md。

Moyai

Moyai is a shared AI workspace for coding and connected-service tasks. Chat with an agent, steer its work, answer questions, inspect its computer, and keep the resulting files and history. Pydantic AI and Harness provide the agent; Temporal runs durable execution, Modal or AWS Lambda MicroVMs provide its computer, and LiteLLM supplies models.

The application has one Python installation, one lockfile, and one React frontend. An existing deployment keeps its users, permissions, historical sessions, credentials and accounting through the shared product services.

Moyai's composer with a keyboard-shortcut task ready to send, a model selector, and a widened sidebar of recent and participated sessions.

The current composer, captured at 2× resolution in light and dark mode. Account, model, and session data are synthetic; the task is an unsent demo draft.

Quickstart

Try Moyai on your laptop with Docker, or deploy it on a server so it stays available when your laptop is off. The local quickstart manages SQLite, encrypted file storage and a local Temporal development server automatically. You only need a model gateway, an enabled Responses-capable model, and Modal credentials. Agents execute in Modal computers; Docker hosts the Moyai application.

For AWS ARM64 computers, follow the native Lambda MicroVM setup. Modal remains the default for the quickstart below.

Option 1: Try locally with Docker

Prerequisites: Docker Desktop on macOS/Windows, or Docker Engine with Docker Compose on Linux. The commands below use a macOS/Linux shell or WSL.

Create moyai.env in your working directory and replace the placeholders:

WORKSPACE_PASSWORD=replace-with-a-long-private-password
LITELLM_API_BASE=https://your-gateway.example.com/v1
LITELLM_API_KEY=YOUR_MODEL_KEY
AGENT_MODEL=YOUR_RESPONSES_MODEL
MODAL_TOKEN_ID=YOUR_MODAL_TOKEN_ID
MODAL_TOKEN_SECRET=YOUR_MODAL_TOKEN_SECRET

Start the image with persistent local data:

docker run -d --name moyai --init --restart unless-stopped \
  --stop-timeout 90 \
  --env-file ./moyai.env \
  -p 127.0.0.1:8787:8787 \
  -v moyai-data:/data \
  ghcr.io/berriai/moyai:quickstart \
  moyai dev --host 0.0.0.0 --port 8787

The quickstart image is built from main for AMD64 and ARM64 after the Docker startup checks pass. If it is not yet publicly available, use the checkout fallback below. See image publication for release status and maintainer setup.

Open http://127.0.0.1:8787 and sign in as admin with WORKSPACE_PASSWORD. The first start may download Temporal and build the Modal computer image. Model and computer usage are billed by those providers.

Try: “Create /workspace/hello.py that prints Hello from Moyai, run it, and save it for download.” The chat should show the observed output and a downloadable file. Follow up in the same conversation to change it.

Use docker logs -f moyai to inspect startup and docker stop moyai / docker start moyai to stop and start it. Keep the moyai-data volume to retain history, files and encryption keys. This is a local trial; use Option 2 for a team deployment with managed storage and durable Temporal.

Checkout fallback: if you cannot pull the prebuilt image, build it locally with Git and Docker, keeping moyai.env in your current directory:

git clone https://github.com/BerriAI/moyai.git
docker build --build-arg MOYAI_BUILD_SHA="$(git -C moyai rev-parse HEAD)" \
  -t moyai-local ./moyai

Then replace ghcr.io/berriai/moyai:quickstart with moyai-local in the run command above. From an existing checkout, you can alternatively copy .env.example to .env, fill in the same credentials, and run docker compose up --build.

Option 2: Deploy for your team

Use the Docker installation guide for a persistent server deployment. Bring PostgreSQL, private S3-compatible storage, a reachable HTTPS origin, and the model/Modal settings above. The guide includes a complete environment example and instructions to obtain a release bundle or build one from a checkout.

From the deployment directory, with the required settings exported:

sh moyai.sh up

Choose the topology and Temporal option before the first startup:

Setting Behavior
MOYAI_INSTALL_TOPOLOGY=standalone One application container with an embedded worker and dispatcher; this is the default.
MOYAI_INSTALL_TOPOLOGY=split API, coordinator, broker and worker as four containers using the same image.
MOYAI_TEMPORAL_MODE=external Connect to Temporal Cloud or your existing server using its address, namespace and TLS/API-key settings.
MOYAI_TEMPORAL_MODE=bundled Start the included persistent Temporal server and database; setup generates the internal database password.

The helper configures the installation, checks dependencies, prepares schemas, retains generated keys, starts the selected services and waits for activation. Use sh moyai.sh password to retrieve a generated sign-in password and sh moyai.sh status to check readiness. A real file task separately verifies model and computer access.

Keep the deployment configuration and persistent volumes, and keep credentials exported for later starts. Existing installations must use the documented migration and upgrade procedures. The local quickstart's data is not automatically migrated into this topology.

Option 3: Develop from source

Prerequisites: Python 3.13, Node.js 22 or newer, Rust 1.88 or newer (to build AgentChat), and uv.

git clone https://github.com/BerriAI/moyai.git
cd moyai
uv sync --frozen
cp .env.example .env
chmod 600 .env

Edit .env with your workspace password, model gateway/model and Modal token pair, then start:

uv run --frozen moyai dev --port 8787

Open http://127.0.0.1:8787 and sign in as admin. This runs the same local application, worker and Temporal development server. Installation builds the UI from source. An authenticated local Modal CLI profile also works for source development. Preserve .data and its generated encryption key across restarts.

Use and operate

Develop

uv run --frozen pytest -q tests
uv run --frozen pytest -q native/tests
uv run --frozen --directory native ruff check src tests
uv run --frozen --directory native pyright
npm run typecheck
npm test
npm run test:ui

Install Chromium once with npx playwright install chromium. PostgreSQL tests need a disposable local database; see the verification guide. Build frontend changes with npm run build. The generated native/src/moyai/static directory is ignored by Git and included by the package build. The Python image serves those assets without Node.js.

moyai (BerriAI/moyai)

正在搜索数据库…

这是什么?Moyai 是一个自托管的、面向后台工作的编程代理:从浏览器或 Slack 给它一个任务,它就会修改代码、运行测试,并开一个拉取请求供你审阅。
它是托管服务,还是我自己运行的东西?它是一个由你自行部署的自托管 Web 应用,部署在 Modal(默认)或你自己的 Substrate 集群上,而不是托管式 SaaS 产品。
怎么让它跑起来?安装 Git、Python 3.12+ 和 uv,克隆并运行安装程序,把你的 Modal 令牌和 LiteLLM 网关设置复制进 .env,然后部署到 Modal,并使用生成的工作区密码登录。
部署之前需要哪些账号?你需要一个 Modal 账号和一个已启用模型的 LiteLLM 网关(默认指南使用 GPT-6 Astra),本地还要有 Git、Python 3.12+ 和 uv。
部署时有什么要注意的坑?部署会立即开始产生计费计算,而且在已有安装之上重新部署会中断它当前正在运行的任务;Windows 用户需要 WSL,因为命令都假定 macOS/Linux shell。
我的服务商 API 密钥会到哪里去?服务商密钥只保存在 Moyai 服务器本身;代理实际修改代码和执行命令的隔离沙箱永远接触不到它们。
一个会话可以选用哪些编程代理运行框架?每个会话都可以跑在 Hermes、Claude Agent SDK、Codex、OpenCode、Deep Agents 或 Tool Loop 上,都在同一个隔离工作区里使用相同的工具和权限。新会话默认使用启用了提示词缓存的 Claude Agent SDK。
Moyai 比 Devin 便宜多少?BerriAI 把内部编程代理从 Devin 迁到了 Moyai,同样一个月的工作量从约 101,872 美元降到约 21,700 美元——便宜了约 79%。
能中断或恢复正在运行的任务吗?你可以在代理工作时给它发送纠正意见,也可以稍后恢复某个会话,连同它保存的文件和完整对话历史。
能搜索过去的代理会话吗?可以——搜索覆盖会话标题、原始请求以及已保存消息中的词语,无论较新还是较早的会话,匹配的摘录都会显示在侧边栏中。
有哪些类似的项目?open-swe, orca, qm, pstack-claude, endo, useagent, openrig, Raven
作者
BerriAI
大小
66 MB
星标
349
时长
2个月
提交 · 90 天