Setup
The workspace mounts Postgres read-only at/db and a SQLite database at
/notes, and keeps its sessions and jobs in Redis. The agent’s process sends
a trace for each line to Langfuse.
workspace.yaml
workspace.yaml
workspace.yaml
Send traces to Langfuse
Send traces to Langfuse
Mirage sends a trace for each line once the process sets up an
OpenTelemetry SDK. Langfuse accepts traces over OTLP, with the project’s
public and secret keys as basic auth:
- Python
- TypeScript
Load the workspace
Load the workspace
The agent runs its first lines in one process, then continues in a new
one:
- Python
- TypeScript
Files from Postgres and SQLite
Postgres shows each table as a folder with itsschema.json and its rows as rows.jsonl. SQL keeps the
files written under /notes in a SQLite database. The first process reads the
refunded orders from Postgres and writes their customers to SQLite:
Sessions in Redis
Withstore.type: redis, the sessions and
jobs live in Redis under support-agent, so any
process that builds the same workspace picks them up. The second process
starts where the first one stopped, with the same working directory and
variables:
Command Logs
Mirage records every line the agent runs as a command log. Redis holds no command logs, sohistory reads them from disk under ~/.mirage/state, on the machine that
ran the line.
Langfuse gets the same lines as traces, the record to read across machines.
Each line is a shell trace, with its command, exit code, output and session.
See Spans for every attribute.
Swap a Backend
Each part changes on its own, in the config, with nothing changed in the agent:- Virtualize S3, Google Drive or another virtual filesystem at
/notesinstead of SQLite. - Set
store.typetodiskto keep the state on one machine, or move one store elsewhere, such asstore.sessions. See Infrastructure. - Point the exporter at another OpenTelemetry backend, such as Jaeger or Honeycomb.