feat: run Data on a self-hosted Letta agent instead of a Zo persona - #10
Merged
Merged
Conversation
Data's brain becomes a self-hosted Letta agent (Letta Code 0.33.1, `--backend local`) on the Zo host, whose memory is a local git repository of markdown. `channels/http/` now turns a question into one headless turn of that agent and reuses the `conversation_id` it returns for the next question on the same session, so continuity survives without a Cloud round trip. - `agent/instructions.md` stays the source of truth; `scripts/sync-persona.ts` renders it into the agent's memory as `system/persona.md` and commits it, so the prompt cannot drift silently. - The agent reads its provider key under its canonical name only, so the service exports `DATA_OPENROUTER_API_KEY` as `OPENROUTER_API_KEY` at startup. - Turns are serialized: the local backend is a file-backed store, so two concurrent turns must never interleave. - `DATA_BRAIN=zo` restores the persona path as the rollback, and `/health` now reports the brain, the agent id, and the resolved CLI path. Verified from a service-like environment (`env -i` with `HOME`, `PATH`, and the secret file): `/health` reports `brain: letta`, a cited answer named `channels/http/index.ts` lines 356-357 and `readJsonBody` 289-300 — both checked by hand — and a second question on the same session continued the conversation. Refs #9
|
This pull request, "feat: run Data on a self-hosted Letta agent instead of a Zo persona" (#10), transitions the Data agent from a Zo persona to a self-hosted Letta agent. This change is driven by the goal to run Data on a local agent, improving continuity and streamlining prompt management. The core changes involve updating how Data's "brain" processes questions, centralizing the agent's prompt, and adapting to the new Letta-based execution environment. Here's a breakdown of the changes:
Reviewers should start by examining |
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the third open item in #9: Data stops being a Zo persona and becomes the first self-hosted Letta agent on the Zo host.
What changes
channels/http/turns a question into one headless turn of the local agent (letta --backend local --agent <id> -p <question> --output-format json) and reuses theconversation_idit returns for the next question on the same session. Continuity no longer needs a Cloud round trip.agent/instructions.mdis still the source of truth;scripts/sync-persona.ts(npm run sync-persona,--dry-runsupported) renders it into the agent's memory assystem/persona.mdand commits it. Covered bylib/sync-persona.test.ts.DATA_OPENROUTER_API_KEYasOPENROUTER_API_KEYat startup.DATA_BRAIN=zoanswers from the persona again. Both paths share framing and session bookkeeping, and/healthnow reports the brain, the agent id, and the resolved CLI path.Verification
Run from a service-like environment —
env -iwith onlyHOME,PATH, the secret file, andDATA_LETTA_BIN:/health→brain: letta,lettaBin: /usr/bin/letta, agent id reported.channels/http/index.tslines 356-357 (POST /ask) andreadJsonBodylines 289-300; both checked against the file by hand.conversation_id, contextual answer).system/persona.mdseeded fromagent/instructions.md(commit190caa4), and a live turn answered "who are you" in Data's voice with its read-only boundary.npm run typecheckclean;npm test17/17.