API Reference
This section is meant to answer a practical question quickly: which public surface do you touch for the integration you are building?
Read this section by task
| If you need to... | Start here |
|---|---|
| choose between the base loop and the smart runtime | Agent Construction |
| define tools or understand built-in context tools | Tools & Context Tools |
| expose a large capability catalog without binding every tool up front | Skills |
| connect LangChain models, MCP tools, or a custom model adapter | Adapters & Models |
| understand planning instructions and system prompt shaping | Prompting & Planning |
| wire state, events, plans, or snapshots into your app | State & Public Types |
| understand internal runtime phases for debugging | Runtime Internals |
The public surface in one view
| Export group | Why it exists |
|---|---|
createAgent(...) | Minimal deterministic loop with tools, limits, approvals, and optional structured output. |
createSmartAgent(...) | Smart runtime for autonomous agents: profiles, planning, context compaction, and memory. |
createTool(...) | Typed tool construction with optional approval and execution controls. |
Skill, SkillPolicy, DEFAULT_SKILL_POLICY, SMALL_TIER_SKILL_POLICY | Progressive capability disclosure for tool-heavy smart agents. |
fromLangchainModel(...), fromLangchainTools(...), withTools(...) | Adapters for model and tool ecosystems. |
buildSystemPrompt(...) | Reuse the runtime prompt shape directly when needed. |
| tracing sinks | Send runtime traces to file, HTTP, Cognipeer, OTLP, or custom sinks. |
What this API reference is not
This section is not a full reproduction of every line in src/types.ts. It is organized around integration decisions rather than raw declaration dumps.
Recommended reading order
Read Prompting & Planning and Runtime Internals when you need to understand smart runtime behavior or debug execution.

