smithery.ai

agent-contracts-backend-runtime

Build an API-oriented agent using AgentRuntime/StreamingRuntime with predictable request/response slices and session support.

First seen Apr 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
short-description
Backend runtime patterns

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,586 B
  • docs SUMMARY.md 164 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

agent-contracts Backend Runtime

Use this skill when you are implementing an AI agent as a backend service (HTTP API, jobs, or SSE streaming).

Target Shape

  • Input: RequestContext(sessionid, action, params, message, image, resumesession)
  • Output: response.responsetype + response.responsedata (+ optional response.response_message)
  • State slices: request, response, _internal + domain slices (e.g., ticket, orders, workflow)

Recommended Workflow

  1. Start from examples/05backendruntime.py.
  2. Define your domain slices and register them: NodeRegistry.addvalidslice("your_slice").
  3. Implement nodes with NodeContract (keep reads/writes minimal).
  4. Build graph with buildgraphfrom_registry(...) and compile.
  5. Wrap with AgentRuntime for request/response execution.
  6. If you need progressive updates, use StreamingRuntime and emit SSE via StreamEvent.to_sse().

Guardrails

  • Prefer response.response_type for flow termination and client branching.
  • Avoid writing to request (discouraged).
  • Keep large blobs out of state slices; sanitize before LLM routing (see GenericSupervisor).

References (load only when needed)

  • docs/getting_started.md
  • docs/core_concepts.md
  • docs/cli.md
  • docs/skills/official/agent-contracts-backend-runtime/references/patterns.md