Back to list
yatarousan0227

agent-contracts-backend-runtime

by yatarousan0227

Contract-driven architecture for building LangGraph agents with declarative node definitions, automatic graph construction, and hybrid rule/LLM-based routing.

6🍴 0📅 Jan 20, 2026

SKILL.md


name: agent-contracts-backend-runtime description: Build an API-oriented agent using AgentRuntime/StreamingRuntime with predictable request/response slices and session support. metadata: short-description: Backend runtime patterns

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(session_id, action, params, message, image, resume_session)
  • Output: response.response_type + response.response_data (+ optional response.response_message)
  • State slices: request, response, _internal + domain slices (e.g., ticket, orders, workflow)
  1. Start from examples/05_backend_runtime.py.
  2. Define your domain slices and register them: NodeRegistry.add_valid_slice("your_slice").
  3. Implement nodes with NodeContract (keep reads/writes minimal).
  4. Build graph with build_graph_from_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

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon