> ## Documentation Index
> Fetch the complete documentation index at: https://darwin.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build with Darwin

> Choose the Darwin interface that fits your agent and deployment.

Use an Agent Skill for workflow guidance, then connect the agent through MCP, an SDK, or the REST API.

## Choose an interface

* **MCP** is the fastest path for assistants and coding agents that support remote MCP servers.
* **SDKs** provide typed Search and Act operations in TypeScript and Python.
* **REST** works from any trusted server environment.

All three interfaces use the same capability IDs, revisions, Action states, and approval rules.

| Interface                | Choose it when                                   | Keep outside model context                          |
| ------------------------ | ------------------------------------------------ | --------------------------------------------------- |
| MCP                      | The AI client supports remote MCP and user OAuth | OAuth tokens and browser interaction data           |
| TypeScript or Python SDK | Your application owns durable server state       | API keys and private inputs not needed by the model |
| REST                     | You need a language-neutral backend contract     | API keys, provider credentials, payment data        |

## Keep authority explicit

Install instructions and tool descriptions do not grant access. The client still needs an authenticated Darwin connection or a properly scoped API credential. Keep user approval, provider authentication, and payment authorization separate.

## Model the workflow

```text theme={null}
user intent
    ↓
Search (read-only)
    ↓
present ranked options
    ↓
selected capability ID + revision
    ↓
Act (durable state)
    ↓
render availableActions until terminal
```

Store identifiers in application state rather than asking the model to recover them from prose. Give the AI the smallest operation-specific schema it needs for the current turn.

## Define a failure policy

* Retry only transient transport failures.
* Reuse the same `requestId` only for an identical mutation retry.
* Stop autonomous progress when Darwin requires a person.
* Never turn a nonterminal Action into a successful agent answer.
* Recover from a stored `actionId` after a restart or timeout.
