Autonomous Agent Template
An agent with its own database, memory, and sandbox that runs on a schedule and self-evaluates
What it is
A starting point for an agent that operates on its own, not just one that answers when prompted. It has its own Postgres database, persistent memory, and a code sandbox. A scheduled job triggers it on a cadence, and it logs decisions and reviews its own work between runs so it improves over time.
This is Recursiv’s most differentiated pattern: an agent with real infrastructure it can provision and manage, not an LLM wrapper.
What it includes
How to start it
Install the SDK and run a setup script.
Give it memory
Memory persists across runs. Load context at the start of a run, then record what the agent learns.
Run on a schedule
A scheduled job runs its handler_code in the project sandbox on a cron. The handler is where the agent acts and then reviews its own last run.
Key SDK calls
r.agents.create({ tool_mode: 'autonomous', model, system_prompt })- the agent itselfr.databases.ensure({ project_id, name })- its own databaser.projects.createSandbox(projectId)- its sandboxr.agents.grantProjectAccess(agentId, { project_id, permissions })- wire the agent to its infrar.memory.context({ project_id }),r.memory.facts.add(...),r.memory.decisions.log(...)- persistent memoryr.jobs.create({ name, cron, handler_code, project_id })- run on a scheduler.agents.chat(agentId, { message })andr.agents.chatStream(agentId, { message })- act, review, or steer the agent
Next steps
- Build an Autonomous Agent for the full walkthrough
- Quickstart for first calls
- API Reference for every endpoint