AgentDBDocs

Get started

In about five minutes you will have your own AgentDB workspace. You will store contacts and companies, link them and query them. You do not write SQL.

This guide uses the agentdb command-line tool. Your AI agent can do the same steps over MCP. See Connect your AI.

AgentDB is in beta. Store only test data or data that is not sensitive.

#1. Sign up

  1. Open https://app.agentdb.link.
  2. Enter your email address. A project name is optional.
  3. Accept the terms and choose Create workspace.

AgentDB creates your account, your first workspace and an API key at once. There is no waiting list.

#2. Save your API key

The next page shows your API key. It starts with adbk..

The page shows the key only once. Choose Copy API key or Download .env and keep it in a password manager. Never paste it into a chat or commit it to git.

Lost your key? Request a recovery link at https://app.agentdb.link/recover. See Accounts and security.

#3. Install the CLI and log in

Install the CLI on macOS or Linux. It needs no Node.js.

Shell
curl -fsSL https://app.agentdb.link/downloads/cli/install.sh | sh

Log in. The CLI opens your browser. You approve the login there with your API key.

Shell
agentdb login --api-url https://app.agentdb.link

The CLI keeps the key in your operating system's credential store. It never writes the key into a project file.

Scripts and CI can use two environment variables instead. AGENTDB_TOKEN holds the key. AGENTDB_WORKSPACE holds the workspace id.

#4. Define a company and a contact

An object is a type of record, like a table. A field is a typed value on that object. Read more in Concepts.

Create the company object with a unique name and a country:

CLIChecked
agentdb schema object-create company
CLIChecked
agentdb schema field-add company name --type text --unique
CLIChecked
agentdb schema field-add company country --type text

Create the contact object with an email address, a name and a score:

CLIChecked
agentdb schema object-create contact
CLIChecked
agentdb schema field-add contact email --type email --unique
CLIChecked
agentdb schema field-add contact name --type text
CLIChecked
agentdb schema field-add contact score --type integer

Define how they relate. A contact works_at one company:

CLIChecked
agentdb schema relationship-add contact works_at company --cardinality one

#5. Write records

Create a company and a contact. Each command prints the new record with its id.

CLIChecked
agentdb records create company --data '{"name":"Example Ltd","country":"NL"}'
CLIChecked
agentdb records create contact --data '{"email":"ada@example.com","name":"Ada Example","score":82}'

AgentDB checks every value against its field type. A wrong value is refused with a clear error, and nothing is written.

Link the contact to the company:

CLIChecked
agentdb records link $CONTACT works_at $COMPANY

Now ask who works at the company. --incoming follows links that point at the company.

CLIChecked
agentdb records related $COMPANY works_at --incoming

#7. Query your records

Find contacts with a score of 70 or more at a company in NL:

CLIChecked
agentdb query --json '{"object":"contact","where":{"all":[{"field":"score","op":"gte","value":70},{"relationship":"works_at","where":{"all":[{"field":"country","op":"eq","value":"NL"}]}}]},"sort":[{"field":"score","order":"desc"}],"limit":10}'

The same query works over REST. Your agent sends the same JSON to the records_query tool.

RESTChecked
curl -X POST https://app.agentdb.link/v1/workspaces/$AGENTDB_WORKSPACE/query \
  -H "Authorization: Bearer $AGENTDB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"object":"contact","where":{"all":[{"field":"score","op":"gte","value":70}]}}'

Learn every filter and option in Query your data.

#8. Let your agent do it

Connect your AI client. See Connect your AI. Then ask in plain language, for example:

Using AgentDB, create a company object (name unique, country) and a contact object (email unique, name, score integer). A contact works_at one company. Add three fictional companies and eight fictional contacts and link them.

Using AgentDB, find contacts with score 70 or more at companies in NL, sorted by score.

Your agent works out the tool calls itself.

#Next steps