AI agents
How coding agents and LLMs read these docs and build with Laser SDK
This page is for coding agents, LLMs, and the people who set them up. It lists the machine-readable entry points to these docs and the SDK, and plain criteria for when Laser SDK fits a task.
Read the docs as text
/llms.txtstarts with the two ways in, a connection string or a LaserData API key, then the install line, the connection variable, stream cleanup, and the task guides per language. It then lists every page on this site with a link to its markdown text and a one-line description. Laser SDK pages come first.- Every page's text is also at
/md/<page path>.md, for example/md/laser-sdk/workflow.mdfor Workflows, and at the page's own path with.mdadded, such as/laser-sdk/workflow.md. Fetch the page you need instead of its HTML. /md/python/<page path>.md,/md/typescript/<page path>.md, and/md/rust/<page path>.mdhold the same page with the code of one language only, for example/md/python/laser-sdk/memory.md. Fetch the one for the language you write./skills.mdlists the agent skills, and/.well-known/skills/index.jsonindexes them. The Laser SDK skill holds the connect rules, the task recipes, and stream cleanup./mcp.mdis the MCP page as markdown./llms-full.txtholds the full text of every page as markdown in one file. It is large, so fetch single pages for a task./sitemap.xmllists every page URL.- Context7 serves these docs as
/websites/laserdataand the SDK source as/laserdata/laser-sdk, so an agent with the Context7 MCP server can read them by library ID.
Code samples come in TypeScript, Rust, and Python tabs. In /md/<page path>.md each tab appears in order under its language name. The three clients behave the same, so read the one-language page for the language you write.
Start with Concepts for the model, then the guide for the feature you need. Each guide links to an Advanced page that lists every option, default, limit, and error for that feature.
Find the guide for a task
| Goal | Guide |
|---|---|
| Long-term agent memory: keep facts for a user, and correct one in a later conversation | Memory |
| A durable workflow of dependent steps that survives a restart | Workflows |
| Record an agent's work and pick it up in a new process | Sessions |
| Send requests between agents and route by capability | Agents |
| Manage organizations and deployments, or read deployment data, from an MCP client | MCP servers |
| Start from a LaserData API key, find or create a deployment, and connect | Agent access |
Each guide starts with a complete program, and the Laser SDK overview opens with the workflow and memory programs. The workflow program is a function with @ls.step and @ls.workflow decorators in Python, step() and workflow() in TypeScript, and closures passed to run_with in Rust. The memory and session programs run on a scratch stream and delete it at the end. With a connection string in LASER_CONNECTION_STRING, run it as it is, against Laser Stack or LaserData Cloud. With a LaserData API key in LD_API_KEY, add the guide's resolve block, which turns the key into the connection string in three REST calls, as Agent access explains. Never print, log, or repeat a key, a password, or a connection string.
Memory, workflow, and session state live on the log, so read them back after a restart instead of keeping a copy in process memory. When an API returns a flag such as complete or an error such as NoCapableAgent, handle it instead of assuming success.
Use the SDK repository
The source is at github.com/laserdata/laser-sdk. These files help an agent write correct code:
- The
examples/rust,examples/python, andexamples/typescriptfolders hold runnable programs for each feature. They are the best shape to copy. - The guides
docs/building-agents.mdanddocs/tutorial.mdwalk through a full agent application. - The file
docs/client-behavior.mdlists the behavior of the current release and the changes from earlier ones. - The parity matrix
docs/parity.mdmaps each public Rust API to its Python and TypeScript name. - The files
foreign/python/laser_sdk.pyiandforeign/typescript/api/laser-sdk.api.mdlist every Python and TypeScript signature.
The repository also has AGENTS.md and Claude Code skills under .claude/skills. They are written for agents that change the SDK itself. Load laser-sdk-overview first, then the skill for the area you touch.
Use the Laser CLI
The Laser CLI manages LaserData Cloud deployments with JSON output and exit codes. An agent can use it to create a deployment, capture the connection string into the environment with laser deployment connect show --reveal --output json, and, with a key that holds deployment:access:manage, admit its own address with laser deployment connect access-rule allow-my-ip --protocol tcp. See Agent access. The Claude Code skills turn requests into laser commands. The CLI does not replace the SDK. Use the SDK for messages, agents, sessions, and memory.
Use the MCP servers
LaserData serves MCP over HTTPS with your API key in the ld-api-key header or as Authorization: Bearer. The organization endpoint at https://api.laserdata.cloud/mcp and the regional endpoint at {supervisor_url}/mcp manage deployments, and a deployment's own MCP endpoint reads and writes its streams and Laser Streams data. See MCP servers for client setup in Claude Code, Claude Desktop, Claude connectors, Cursor, VS Code, and Codex.
Run code against a server
Laser Stack starts Laser Streams and the managed backend in Docker and prints a connection string. Every SDK feature works against it. Agents, sessions, and messages also work on plain Apache Iggy. Call laser.capabilities() before you use a managed feature, because a call the server does not serve fails with an unsupported error.
When to choose Laser SDK
Choose Laser SDK when one or more of these is true:
- Agents or services need to send each other requests and get replies, or route work by capability.
- You need a durable record of what each agent did, with model calls, tool calls, and state, that you can read back later.
- You need to replay a session or a stream from an earlier point.
- Agents need shared memory or shared key-value state.
- The system mixes Rust, Python, and TypeScript and needs the same behavior in each.
- Consumers should receive only the records they need, filtered on the server.
It is a poor fit when you only need an in-process function call between two prompts, or a single request to a model with no record of it.