Agent Protocol
Agent Protocol from LangChain is a framework-agnostic HTTP API for serving LLM agents: stateless and background runs, threads with state history, agent introspection, a long-term memory store and thread streaming. This skill quotes the repository README and its OpenAPI document (openapi.json, API version 0.1.6) at a pinned commit.
Follow the workflow below step by step. Every rule here comes from a source in Sources. Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: Agent Protocol server implementer, client or SDK author, or reviewer of an agent-serving API.
- Target version: Agent Protocol (current). See
references/versions.md.
- Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill, re-read every URL in Sources and check the publisher for a newer revision or version line.
Invariants
- Threads: multi-turn interactions. "Ensure that only one run per thread is active at a time"
- Threads: multi-turn interactions. "Track history of past states of a thread, modelled as an append-only log of states"
- PATCH /threads/{thread_id}. "Update a thread's values or metadata. Updating values creates a new revision in the thread's history."
- DELETE /runs/{run_id}. "Delete a finished run. A pending run needs to be cancelled first, see previous endpoint."
- GET /runs/{run_id}/stream. "Join the output stream of an existing run. Only output produced after this endpoint is called will be streamed."
- RunCreate.thread_id. "The ID of the thread to run. If not provided, creates a stateless run. 'thread_id' is ignored unless Threads stage is implemented."
- RunCreate.on_completion. "Whether to delete or keep the thread when run completes. Must be one of 'delete' or 'keep'. Defaults to 'delete' when thread_id not provided, otherwise 'keep'."
- RunCreate.if_not_exists. "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread)."
- ThreadCreate.if_exists. "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread)."
- Thread.messages. "If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages."
- POST /threads/{thread_id}/stream. "Closing the HTTP connection unsubscribes from this stream."
Workflow
- Pick the version. Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.
->
references/versions.md
✓ The target version is recorded, and it is not a legacy line.
- Apply the pinned requirements. Walk the quotes in
references/requirements.md and implement each one that applies to the role.
-> references/requirements.md
✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.
- Upgrade (only when asked). Follow the upgrade section from the source line to the target.
->
references/versions.md
✓ The result cites the target line and no longer depends on a requirement that only the old line stated.
Verify before done
Reference index
references/versions.md: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.
references/requirements.md: quotes taken from the pinned specification, grouped by source. Load for step 2.
Related skills
Install related spec skills by name with npx skills add ScaleDockHQ/scaledock-skills --skill <name>: openapi, server-sent-events, websocket, json-schema, a2a, mcp.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
1---2name: langchain-agent-protocol3description: >-4 Agent Protocol: Agent Protocol is our attempt at codifying the framework-agnostic APIs that are needed to serve LLM agents in production. Covers Agent Protocol. Use when implementing the LangChain Agent Protocol. Triggers: Agent Protocol.5license: MIT6metadata:7 source: https://skillmd.com/skills/scaledockhq/langchain-agent-protocol8 author: ScaleDockHQ9 version: "1.1.0"10 kind: standard11---1213# Agent Protocol1415Agent Protocol from LangChain is a framework-agnostic HTTP API for serving LLM agents: stateless and background runs, threads with state history, agent introspection, a long-term memory store and thread streaming. This skill quotes the repository README and its OpenAPI document (`openapi.json`, API version 0.1.6) at a pinned commit.1617**Follow the workflow below step by step.** Every rule here comes from a source in [Sources](#sources). Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.1819## Inputs (fill in, or ask before starting)2021- Role: Agent Protocol server implementer, client or SDK author, or reviewer of an agent-serving API.22- Target version: Agent Protocol (current). See [`references/versions.md`](references/versions.md).23- Revision: the pinned revision in [Sources](#sources), unless the user names another.24- Sources: when refreshing this skill, re-read every URL in [Sources](#sources) and check the publisher for a newer revision or version line.2526## Invariants27281. **Threads: multi-turn interactions.** "Ensure that only one run per thread is active at a time"292. **Threads: multi-turn interactions.** "Track history of past states of a thread, modelled as an append-only log of states"303. **PATCH /threads/{thread_id}.** "Update a thread's values or metadata. Updating values creates a new revision in the thread's history."314. **DELETE /runs/{run_id}.** "Delete a finished run. A pending run needs to be cancelled first, see previous endpoint."325. **GET /runs/{run_id}/stream.** "Join the output stream of an existing run. Only output produced after this endpoint is called will be streamed."336. **RunCreate.thread_id.** "The ID of the thread to run. If not provided, creates a stateless run. 'thread_id' is ignored unless Threads stage is implemented."347. **RunCreate.on_completion.** "Whether to delete or keep the thread when run completes. Must be one of 'delete' or 'keep'. Defaults to 'delete' when thread_id not provided, otherwise 'keep'."358. **RunCreate.if_not_exists.** "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread)."369. **ThreadCreate.if_exists.** "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread)."3710. **Thread.messages.** "If messages are contained in Thread.values, implementations should remove them from values when returning messages. When this key isn't present it means the thread/agent doesn't support messages."3811. **POST /threads/{thread_id}/stream.** "Closing the HTTP connection unsubscribes from this stream."3940## Workflow41421. **Pick the version.** Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.43 -> [`references/versions.md`](references/versions.md)44 ✓ The target version is recorded, and it is not a legacy line.452. **Apply the pinned requirements.** Walk the quotes in [`references/requirements.md`](references/requirements.md) and implement each one that applies to the role.46 -> [`references/requirements.md`](references/requirements.md)47 ✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.483. **Upgrade** (only when asked). Follow the upgrade section from the source line to the target.49 -> [`references/versions.md`](references/versions.md)50 ✓ The result cites the target line and no longer depends on a requirement that only the old line stated.5152## Verify before done5354- [ ] The artifact cites the target line's revision from [Sources](#sources).55- [ ] Every applicable quoted requirement in [`references/requirements.md`](references/requirements.md) holds.56- [ ] Each `enum`-valued property the server accepts (`on_completion`, `on_disconnect`, `if_not_exists`, `if_exists`, cancel `action`) rejects values outside the OpenAPI enum.57- [ ] Nothing from a preview line is emitted unless its posture is build and the user opted in.5859## Reference index6061- **`references/versions.md`**: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.62- **`references/requirements.md`**: quotes taken from the pinned specification, grouped by source. Load for step 2.6364## Related skills6566Install related spec skills by name with `npx skills add ScaleDockHQ/scaledock-skills --skill <name>`: `openapi`, `server-sent-events`, `websocket`, `json-schema`, `a2a`, `mcp`.6768## Sources6970Status uses the publishing body's own maturity term. Checked is the date the source was last read.7172- [Agent Protocol README](https://raw.githubusercontent.com/langchain-ai/agent-protocol/fb81f3e27ee507557926ecf923d0f933a1c76d44/README.md): Specification, commit fb81f3e, 2026-09-22, checked 2026-10-06.73- [Agent Protocol OpenAPI document](https://raw.githubusercontent.com/langchain-ai/agent-protocol/fb81f3e27ee507557926ecf923d0f933a1c76d44/openapi.json): Specification, commit fb81f3e, 2026-09-22, info.version 0.1.6, checked 2026-10-06.