Build with AgentDB
Build a website, CRM, dashboard or custom application using AgentDB as your persistent data layer. Use your preferred programming language and framework.
You can build, for example:
- a customer portal where clients see their own orders and files;
- a small CRM with contacts, companies, deals and notes;
- an internal dashboard that updates when the data changes;
- a booking or intake form that writes records your AI agents then process;
- a mobile or desktop app with its own backend.
Your app and your AI agents share the same data. An agent can fill and clean the records over MCP, while your app shows them to people.
Read Security for apps before you write code. The most important rule: an AgentDB API key never goes into a browser, a mobile app or a public file.
#What AgentDB gives you
| AgentDB provides | Your app builds |
|---|---|
| Typed records, fields and relationships, with validation | The screens, forms and navigation people use |
| Exact queries with filters, sorting and cursor pages | Which data each of your users may see |
| Files: upload, download and signed links | Sign-in for your own users |
| Version checks and idempotency keys for safe writes | Business rules and workflows |
| A change feed, webhooks and live dashboard links | Pushing updates to many browsers |
| API keys, agent keys with roles, permission rules | Hosting your app |
AgentDB is the database behind your app. It does not provide a CRM, a portal or an admin screen for your customers. You build that interface. You can use the AgentDB app yourself to look at the data while you build.
#How an app talks to AgentDB
Every app follows the same shape:
- People use your app in a browser or on a phone.
- Your app sends their requests to your own backend (server, serverless function or framework route).
- Your backend checks who the person is and what they may do.
- Your backend calls the AgentDB REST API with a key it keeps secret.
- Your backend returns only the data that person needs.
For read-only screens without a backend, use a dashboard data link or a custom dashboard. They need no key in the page.
#Choose your path
Start with security. Security for apps shows the three safe patterns, with wrong and secure code side by side.
Pick your language. Each guide shows connecting, reading, writing, queries, relationships, files, errors, rate limits and retries. Every code block on those pages runs in our tests.
- Languages overview and test setup
- JavaScript (Node.js) and TypeScript
- PHP, Python and Ruby
- Go, Java, Kotlin, C#, Rust and Swift
Make it live. Live data explains polling, the change feed, dashboard long-polling and webhooks. It ends with a complete page that updates when a record changes.
Use a framework or deploy. Framework starters and deployment guides are in the Frameworks and Deploy groups of this section.
#Working with an AI coding tool
These pages are written for people and for AI coding tools. Give your tool this instruction:
Use AgentDB as the database. Read https://docs.agentdb.link/latest/build/security.md first.
Call the AgentDB REST API only from server-side code, with the key in the AGENTDB_API_KEY
environment variable. Never put the key in browser code, HTML or a client bundle.AI tools can also read llms.txt and examples.json. The second file lists every tested example by language, with its files and topics.
#Before you start
You need:
- an AgentDB account and a workspace (see Getting started);
- a key for your backend: an agent key with the smallest role that works;
- the workspace id (
ws_...), shown in the app under Settings.
Put both values in environment variables on your server: AGENTDB_API_KEY and AGENTDB_WORKSPACE. The examples also read AGENTDB_URL, which defaults to https://app.agentdb.link.
AgentDB is in beta. Store only synthetic or non-sensitive data.