# Lousho > A TypeScript SDK for building AI agents that run in your own code, on your own host. ## Documentation ### Get started - [Introduction](https://lousho.com/introduction.md): Lousho is a TypeScript SDK for building AI agents that run in your own code, on your own host. Give it a model and typed tools; get a run you can pause, resume, stream and test. - [Quick Start](https://lousho.com/quickstart.md): This page takes you from a one-line agent to tools, streaming, sessions, an approval and an offline test. Every snippet after the first runs as-is with no API key, on the SDK's built-in mock provider. - [Installation](https://lousho.com/installation.md) - [Troubleshooting](https://lousho.com/troubleshooting.md) - [Comparison with other agent frameworks](https://lousho.com/comparison.md) - [Lousho with coding agents](https://lousho.com/coding-agents.md): Give Claude Code, Cursor or another coding agent the SDK's docs in a form it can read, so it writes code against the real API. - [Build a coding agent](https://lousho.com/build-a-coding-agent.md) ### Models and output - [Providers](https://lousho.com/providers.md) - [Models, tokens and cost](https://lousho.com/models-and-cost.md) - [Reasoning](https://lousho.com/reasoning.md) - [Decisions](https://lousho.com/decisions.md) - [Structured output](https://lousho.com/structured-output.md) - [Streaming](https://lousho.com/streaming.md) - [Stream events](https://lousho.com/stream-events.md) ### Prompting and context - [Prompting and context techniques](https://lousho.com/prompting-techniques.md): Agent quality comes from three layers, and it is worth knowing which layer a technique lives at, because the fix for a misbehaving agent is different at each one: - [Memory](https://lousho.com/memory.md) - [Context compaction](https://lousho.com/compaction.md) ### Tools - [Tools](https://lousho.com/tools.md) - [Workspace tools](https://lousho.com/workspace-tools.md) - [Hosted provider tools](https://lousho.com/hosted-tools.md) - [OpenAPI tools](https://lousho.com/openapi-tools.md) - [Tool search](https://lousho.com/tool-search.md) - [Code mode](https://lousho.com/code-mode.md) ### Sessions and runs - [Sessions](https://lousho.com/sessions.md) - [Runs: finish reasons, cancellation and parallel tools](https://lousho.com/runs.md): How a run ends, how to stop one, and how tool calls of one model turn run in parallel. - [Queued input and steering](https://lousho.com/queue-and-steer.md) - [Durable execution](https://lousho.com/durable-execution.md) - [Pause, restart, resume](https://lousho.com/pause-and-resume.md): A tutorial for one job: an agent that stops to ask a human before a risky tool call, survives a process restart while it waits, and carries on once someone decides. Then what happens when the process dies in the middle of a tool. ### Approvals and safety - [Approvals](https://lousho.com/approvals.md) - [Permission modes](https://lousho.com/permission-modes.md) - [Guardrails and sandboxing](https://lousho.com/guardrails.md) - [Hooks](https://lousho.com/hooks.md) ### Compose agents - [Sub-agents](https://lousho.com/sub-agents.md) - [Handoffs](https://lousho.com/handoffs.md): A handoff passes the whole conversation to another agent. A triage agent reads the user's request and hands it to a specialist; the specialist answers the user directly, and in a session it keeps the conversation in later turns. - [Skills](https://lousho.com/skills.md) - [Flows](https://lousho.com/flows.md) ### Project structure - [Agent directories](https://lousho.com/agent-directories.md) - [Claude Code projects](https://lousho.com/claude-projects.md) ### Integrations - [MCP (Model Context Protocol)](https://lousho.com/mcp-integration.md) - [Connectors](https://lousho.com/connectors.md) ### User interfaces - [React](https://lousho.com/react.md) - [Vue](https://lousho.com/vue.md) - [Svelte](https://lousho.com/svelte.md) - [AI SDK UI (useChat)](https://lousho.com/ai-sdk-ui.md) - [Next.js and other Fetch-API frameworks](https://lousho.com/nextjs.md) - [Agent Client Protocol (ACP)](https://lousho.com/acp.md) ### Access and events - [Route auth and principals](https://lousho.com/auth.md) - [OAuth](https://lousho.com/oauth.md) - [Channels](https://lousho.com/channels.md) - [Schedules](https://lousho.com/schedules.md) - [Triggers](https://lousho.com/triggers.md) ### Test and observe - [Testing agents](https://lousho.com/testing.md) - [Evals](https://lousho.com/evals.md) - [Tracing and observability](https://lousho.com/observability.md) ### Ship - [CLI](https://lousho.com/cli.md) - [Deployment](https://lousho.com/deployment.md) - [Cloudflare Workers](https://lousho.com/cloudflare-workers.md) - [Registry](https://lousho.com/registry.md) - [Agent Forge](https://lousho.com/agent-forge.md) #### Deployment guides - [Deploying to a Hostinger VPS](https://lousho.com/hostinger-vps.md) ## Examples ### Examples - [Examples](https://lousho.com/examples.md): Runnable examples from the SDK repository. Most use the built-in mock provider, so they need no API key. - [waves](https://lousho.com/examples/waves.md) - [phase-pipeline](https://lousho.com/examples/phase-pipeline.md) - [coding-agent-workflows](https://lousho.com/examples/coding-agent-workflows.md): A coding agent driven by deterministic workflows whose routing is a typed decision (the "System One" pattern). - [connectors](https://lousho.com/examples/connectors.md): Connect an agent to external services (Google Docs, Slack, GitHub, Notion, …) the way Claude's connectors do: over MCP. - [hostinger-deploy](https://lousho.com/examples/hostinger-deploy.md) ## Reference ### Reference - [API Overview](https://lousho.com/api-overview.md): The package root (@lousho/build-ai-agent) exports everything below. For the complete, generated API reference (every export, signature and doc comment), build the TypeDoc site: - [The executor API](https://lousho.com/executor-api.md) - [Migrating from the Vercel AI SDK](https://lousho.com/migrating-from-ai-sdk.md) - [Migrating to createAgent()](https://lousho.com/migrating-to-create-agent.md) - [Configuration](https://lousho.com/configuration.md) - [Errors](https://lousho.com/errors.md): Nearly every error the SDK throws on purpose is an SDKError (or a subclass such as ConfigurationError, ValidationError or MissingPeerDependencyError) with: - [Utilities](https://lousho.com/utilities.md): Supporting helpers exported from the @lousho/build-ai-agent/utils subpath: encryption and hashing, and file storage for attachments. None of them is needed to build an agent; they are here for the apps around one. ### Releases - [Upgrading to 1.0](https://lousho.com/upgrading.md) - [Changelog](https://lousho.com/changelog.md): Every notable change to @lousho/build-ai-agent, newest first. > The links below point to documentation indexes. Follow each `/_llms/` index recursively until you reach documentation pages. ## Indexes - [Arabic (73 pages)](https://lousho.com/_llms/ar.txt): Documentation for Arabic. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.