Agent Recipes
Copy-paste snippets for creating, running and equipping agents
Short, self-contained recipes for working with agents. Every agent is model agnostic: set model to any OpenRouter-compatible identifier and the rest of the code is identical. Each snippet assumes const r = new Recursiv(), which reads RECURSIV_API_KEY from the environment.
Create an agent
Spin up a named agent backed by any LLM with a system prompt that defines its behavior.
Chat and get a full reply
Send one message and read the whole response back. Pass conversation_id on the next call to keep context.
Stream a reply token by token
Render output as it generates instead of waiting for the full response. The stream yields typed chunks.
Give an agent tools
Flip an agent into tool-using mode. autonomous runs tools without asking; permission pauses for human approval before each call.
Connect hundreds of integrations
Recursiv ships hundreds of data integrations through one connection layer. Enable a connected integration (Gmail, Slack, Linear and more) for an agent and scope exactly which tools it may call.
Persist memory across runs
Store facts and decisions so an agent remembers context between sessions. Memory is searchable and scoped per project.
Run the same agent on a different model
Model choice is one field. Swap providers without touching any other logic.
List and inspect conversations
Pull an agent’s conversation history to audit what it has been doing.
Hand work from one agent to another
Agents can message each other directly to delegate tasks and return results.