{ "module": "letta", "version": "1", "capabilities": [ "container-runtime" ], "requires": [ "postgres-database", "route" ], "contributes": { "postgres-database": { "name": "letta" }, "route": { "label": "letta", "endpoint": "web" } }, "binds": { "postgres-database": "${dir:state}/database.json", "route": "${dir:state}/route.json" }, "secrets": { "postgres-database": "${dir:state}/database.secret" }, "own-secrets": { "server-password": "${dir:state}/server-password.secret", "openai-api-key": "${dir:state}/openai-api-key.secret", "broker": "/var/lib/mesh/letta/broker" }, "listens": [ { "name": "web", "port": 8283, "protocol": "tcp", "from": "mesh", "why": "the Letta agent server REST API and web UI, password-protected (--secure); a public name is the route's" } ], "resources": [ { "id": "mesh-state", "type": "directory", "path": "/var/lib/mesh/letta", "mode": "0700" }, { "id": "state", "type": "directory", "mode": "0700", "place": "." }, { "id": "server-env", "type": "file", "path": "${dir:state}/server.env", "mode": "0600", "content": "LETTA_PG_URI=postgresql://${bound:postgres-database:as}:${secret:postgres-database}@${bound:postgres-database:at}:${bound:postgres-database:port}/${bound:postgres-database:as}\nLETTA_SERVER_PASSWORD=${secret:server-password}\nOPENAI_API_KEY=${secret:openai-api-key}\nSECURE=true\nTZ=Europe/Brussels\n" }, { "id": "net", "type": "network", "name": "letta" }, { "id": "server", "type": "container", "name": "letta", "image": "letta/letta@sha256:bfd1e49ce45b9a208c941e832c1d1d194017ff210a3784b0ca6c323aed767a29", "network": "letta", "env-file": [ "${dir:state}/server.env" ], "ports": [ "8283" ], "secrets-in-environment": "letta 0.6.x reads its settings from the environment only (pydantic settings, no secrets_dir or _FILE twin), and its startup.sh starts an embedded PostgreSQL unless LETTA_PG_URI is set - so the database password travels inside that URI (startup.sh also echoes it to the log); LETTA_SERVER_PASSWORD and OPENAI_API_KEY have no file source either" }, { "id": "runtime-config", "type": "file", "path": "/var/lib/mesh/letta/config.json", "mode": "0600", "content": "{\n \"password\": \"${secret:server-password}\"\n}\n", "merge": "json" }, { "id": "runtime", "type": "container", "name": "mesh-letta", "network": "letta", "volumes": [ "/var/lib/mesh/letta/broker:/run/secrets/broker:ro", "/var/lib/mesh/letta/config.json:/run/config/config.json:ro" ], "env": { "MESH_BROKER_FILE": "/run/secrets/broker", "MESH_LETTA_URL": "http://letta:8283", "MESH_LETTA_CONFIG_FILE": "/run/config/config.json" }, "restart-on": [ "runtime-config" ], "artifact": "runtime" } ], "build": { "on": [ { "arg": "BUILD_BASE", "module": "mesh-tools", "artifact": "build" }, { "arg": "RUNTIME_BASE", "module": "mesh-tools", "artifact": "runtime" } ], "artifacts": [ { "name": "runtime", "kind": "image", "from": "Dockerfile" } ] } }