liki-agent-runtime is a generic multi-agent runtime. Prompts, skill workflow, tool
semantics, domain schemas, and domain evaluation belong to the Liki
skill/project.
| Concept | Meaning |
|---|---|
| AgentDeployment | External deployment artifact containing one or more Agent definitions |
| AgentDefinition | One Agent's instruction, optional output schema, server-scoped tool allowlist, and per-Agent model settings with runtime-wide fallback |
| MCP server | A logical external tool dependency bound through environment references |
| Run | One stateless execution identified by RunID and ThreadID |
| Tool execution | One allowlisted MCP tool invocation |
| LLM call | One auditable model invocation inside a run |
| Audit event | Immutable evidence of a lifecycle fact |
| Delegation | A root agent delegating a subtask to a sub-expert via a task tool; lifecycle audited separately |
| ADK working session | The run-scoped ADK session (run:<RunID>); deleted at terminal state, never carries cross-run history |
| Skills binding | The artifact-declared skills root plus the built-in skill tools (list/load/resource) |
- The artifact is loaded from the filesystem and cannot be uploaded at runtime.
- Prompt and output schema are external files, not Go defaults.
output.textPointerselects the user-facing string from validated output.- An empty tool allowlist means the Agent has no tool access.
- Tool authorization is scoped to a declared logical MCP server and explicit tool name.
- Instruction and schema digests identify exact behavior; a plain-text Agent has an empty schema digest.
- Deployment, instruction, and schema digests enter audit evidence.
| Aggregate root | Invariants | Single implementation |
|---|---|---|
Run (RunID) |
Idempotent and exclusive while active; terminal evidence appended exactly once and in order (close in-flight → compensate → terminal event → release state) | closeRunEvidence (run_evidence.go) |
AgentDefinition (Name) |
Acyclic delegation graph; explicit deny-by-default tool allowlists; one effective model value per Agent | agentGraphBuilder (agent_graph.go) |
| AuditEvent (event ID) | Append-only; lifecycle events close with stable IDs | audit package + startup recovery |
- Only allowlisted MCP tools can be exposed or invoked.
- Tool input/output are audited as canonical digests and sizes, never raw payload.
- Run, thread, and user identifiers are required; an active RunID is exclusive.
- ADK working sessions are run-scoped and removed at terminal execution.
- Plain text is the default output mode.
- Structured output is optional and validated against the Agent's external JSON Schema.
RunResult.Outputis generic validated JSON for structured Agents.RunResult.Textis final model text for plain Agents or the configured JSON Pointer value for structured Agents.- Failed runs mark pending executions and delegations as interrupted so every lifecycle has terminal audit evidence.
- Audit events are append-only at the database boundary.
- Every run has started and terminal lifecycle evidence.
- Every model call has started and terminal lifecycle evidence.
- Every tool call has started and terminal lifecycle evidence, including interrupted calls.
- Every delegation has started and terminal lifecycle evidence, including interrupted delegations.
- A hard interruption is represented at startup by an append-only synthetic
runtime_interruptedterminal failure, never by editing an old event. - Audit records protocol, trace correlation, version, and digest provenance, but not secrets, prompts, raw model output, or tool payloads.
- Audit write and recovery failures fail closed; cancellation does not prevent terminal audit events.
- A reconciled terminal event (interrupted run, model call, tool, or delegation) carries the same trace and definition provenance as its started fact.
liki-web owns users, products, entitlements, quota, and durable conversations.
The Liki skill/project owns domain behavior and MCP tool semantics.
liki-agent-runtime owns generic execution, protocol adaptation, evidence, and
operations.