> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.recursiv.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.recursiv.io/_mcp/server.

# Recursiv

## What is Recursiv?

Recursiv is the platform for building, running and governing autonomous agents. One SDK and one API key give you the whole backend: projects, Postgres, storage, deploys, auth, billing, agents, memory, orchestration, hundreds of integrations, plus the identity, guardrails, observability and verification to govern every action. It is model agnostic, so you bring any model and swap it anytime.

Use it from the TypeScript SDK, REST API, CLI, or MCP server. Humans get a direct developer platform. Agents get a deterministic tool surface with clear limits, scopes and machine-readable docs.

```text
App, CLI, or agent
  -> @recursiv/sdk, REST, MCP, WebSocket
  -> projects, Postgres, storage, deploy, auth, billing
  -> agents, memory, orchestration, integrations
  -> identity, guardrails, observability, verification
```

## Use Recursiv when

* You want a product backend without stitching together auth, database, storage, deploy, social, and agent infrastructure.
* You want agents to build, inspect, and ship inside scoped infrastructure instead of loose shell scripts.
* You need social primitives such as posts, feeds, chat, communities, profiles, and follow graph.
* You need operational primitives such as webhooks, scheduled jobs, billing, observability, and self-hosting.
* You want the same platform available to app code, humans in a terminal, and MCP-compatible coding agents.

## What you get

| Area                      | Current primitives                                                                               |
| ------------------------- | ------------------------------------------------------------------------------------------------ |
| **Projects and deploy**   | Project CRUD, branch deploys, deployment status, deployment logs, sandbox lifecycle              |
| **Databases**             | Managed Postgres, idempotent provisioning, credentials API, parameterized SQL queries            |
| **Storage**               | Buckets, folders, presigned upload/download URLs, object listing, deletes                        |
| **AI agents**             | Agent CRUD, streaming chat, project permissions, inbox, conversations, discovery, scheduled work |
| **Swarms and dispatcher** | Task queues, claims, stale/stuck detection, swarms, schedules, outcomes, signals                 |
| **Memory and brain**      | Facts, decisions, search, project tasks, milestones, settings, usage                             |
| **Social and realtime**   | Posts, tags, communities, profiles, follow graph, DMs, group chat, WebSocket hooks               |
| **Platform**              | Auth, API keys, organizations, billing, notifications, webhooks, jobs, settings                  |
| **Agent tooling**         | MCP server, scoped tools, setup resources, self-evaluation, `llms.txt`                           |

## Quick start

### 1. Install the SDK

Node.js 18 or newer is required.

```bash
npm install @recursiv/sdk
```

### 2. Set your API key

```bash
export RECURSIV_API_KEY=sk_live_...
```

The SDK also accepts `apiKey` in the constructor and falls back to `SOCIAL_DEV_API_KEY` for older deployments.

### 3. Make the first call

```typescript
import { Recursiv } from '@recursiv/sdk';

const r = new Recursiv(); // reads RECURSIV_API_KEY

// Most resources hang off a project. Create one — the returned id is a UUID.
const { data: project } = await r.projects.create({ name: 'my-app' });

const { data: db } = await r.databases.ensure({
  project_id: project.id,
  name: 'main',
});

const { data: result } = await r.databases.query({
  project_id: project.id,
  sql: 'SELECT NOW() as time',
});

console.log(db.id, result.rows);
```

### 4. Try the anonymous sandbox

No signup or API key is required.

```typescript
import { Recursiv } from '@recursiv/sdk';

const r = new Recursiv({ anonymous: true });

const { data, meta } = await r.sandbox.execute({
  code: 'console.log(1 + 1)',
  language: 'typescript',
});

console.log(data.output); // "2\n"
console.log(`${meta.remaining_executions} executions remaining today`);
```

Anonymous sandbox limit: 10 executions per IP per day.

## Choose your integration

| Use this       | When you want                                                                                                               | Start here                                            |
| -------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| TypeScript SDK | Typed app code, scripts, server routes, or agent-generated code                                                             | [Installation](/sdk/setup/installation-configuration) |
| CLI            | Scaffold, authenticate, inspect, and generate deploy config from a terminal                                                 | [CLI](/guides/ai-tools/cli)                           |
| MCP            | Give Claude Desktop, ChatGPT, Gemini, Claude Code, Cursor, or Codex direct tools — connect by URL + sign-in, or run locally | [MCP](/guides/ai-tools/mcp-claude-cursor)             |
| REST API       | Use Recursiv from any language or HTTP client                                                                               | [API Reference](/api-reference)                       |
| Agent docs     | Give an agent the full docs index and page-level Markdown                                                                   | [`llms.txt`](https://docs.recursiv.io/llms.txt)       |

## What do you want to build?

| Goal                             | What Recursiv gives you                                          | Guide                                                                        |
| -------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| **AI-native app**                | Database + AI agent + storage + auth + billing                   | [Build an AI-native app](/guides/build/build-an-ai-native-app)               |
| **Autonomous agent**             | Agent with its own Postgres, memory and code execution           | [Build an autonomous agent](/guides/run/build-an-autonomous-agent)           |
| **Social platform**              | Posts, communities, chat, profiles, follow graph                 | [Build a social platform](/guides/build/build-your-first-app)                |
| **Code playground**              | Sandboxes, deploy, AI coding assistant, live preview             | [Build a code playground](/guides/run/build-a-code-playground)               |
| **White-label SaaS**             | BYOK Stripe + branded auth + branded email + your infrastructure | [Deploy a white-label platform](/guides/build/deploy-a-white-label-platform) |
| **Any app that needs a backend** | Auth + database + storage + billing + email                      | [Quickstart](/guides/start-here/quickstart)                                  |

## Agent rules of thumb

* Use `r.databases` for structured app data. Do not store app records as JSON blobs in posts.
* Use `r.posts`, `r.communities`, `r.chat`, and `r.profiles` for social product surfaces.
* Use `r.projects.createSandbox()` and `r.projects.executeCode()` for project-scoped code execution.
* Use `r.sandbox.execute()` only for anonymous, temporary code execution.
* Use `r.agents.chatStream()` for token streaming in Node.js and browsers.
* Use `r.agents.chatStreamText()` or the React Native guide when `ReadableStream` is unavailable.
* Keep API keys server-side in browser apps.

## Next steps

* [Quickstart](/guides/start-here/quickstart) - build the first project flow.
* [SDK installation](/sdk/setup/installation-configuration) - configure API keys, base URLs, retries, and runtimes.
* [MCP setup](/guides/ai-tools/mcp-claude-cursor) - connect Recursiv to an AI coding assistant.
* [Pricing and limits](/guides/start-here/pricing-limits) - understand quotas, credits, and usage.
* [OpenAPI](/api-reference) - inspect every REST endpoint.