letta-code — system architecture (client harness ⇄ Backend contract ⇄ model)

letta-code — system architecture (client harness ⇄ Backend contract ⇄ model) An architecture diagram generated by Archify. User / host · TUI · -p · Desktop · chat · Architecture component User / host TUI · -p · Desktop · chat letta CLI entry · index.ts main() · one letta process (Node) letta CLI entry index.ts main() Client turn loop · headless · TUI · listener · one letta process (Node) · owns execution Client turn loop headless · TUI · listener owns execution Permission checker · modes · rules · guards · one letta process (Node) · default: unrestricted Permission checker modes · rules · guards default: unrestricted Tool manager · batch · hooks · clamp · one letta process (Node) Tool manager batch · hooks · clamp Workspace + shell · files · bash -c · Architecture component · opt-in bwrap/seatbelt Workspace + shell files · bash -c opt-in bwrap/seatbelt Sub-agent process · child letta, stream-json · Architecture component Sub-agent process child letta, stream-json Backend interface · getBackend() · one letta process (Node) · Letta REST contract Backend interface getBackend() Letta REST contract APIBackend · @letta-ai/letta-client · one letta process (Node) APIBackend @letta-ai/letta-client LocalBackend · in-process server emulation · one letta process (Node) · messages.jsonl LocalBackend in-process server emulation messages.jsonl Letta Cloud / server · agent state · web_search · Architecture component Letta Cloud / server agent state · web_search LLM provider APIs · via pi-ai Models · Architecture component LLM provider APIs via pi-ai Models MemFS git repo · per-agent memory · Architecture component MemFS git repo per-agent memory prompt start turn stream req classify calls approved batch cloud mode HTTPS/SSE local mode 1 step/run server-side loop files · shell Agent tool Edit + git commit HEAD → prompt one letta process (Node) Legend Frontend Backend Database Cloud Security External