AI Agents
An AI Agent is a managed deployment that runs next to your data and connects to an ekoDB database. It can answer questions about your collections, build backends from a template or from scratch, run multi-step workflows, and keep your database tuned, all without you wiring up a separate service.
The agent is part of ekoDB: you deploy it from the same dashboard, and it uses your database's built-in RAG and vector search — there is no second vector database, no separate RAG pipeline, and no glue code to maintain. An agent always connects to a database; a database runs perfectly well on its own.
How it runs
ekoDB runs in the cloud, and so does the agent. From the dashboard you deploy a database and, separately, an AI Agent — each is its own managed deployment. The agent connects to a database you've deployed (you pick which one), and both run as managed services. You never host or operate them yourself.
Once an agent is deployed, you can work with it three ways:
- The dashboard, in your browser, with a full chat and management UI.
- The desktop app, a native client for macOS, Linux, and Windows.
- The terminal client, an interactive agent in your shell.
The desktop app and the terminal client are thin clients. They authenticate, discover your deployments, and connect to your cloud agent. They never run the backend or hold your API keys. See Get Started for the client install commands.
What an agent can do
- Chat with your data. Ask questions in plain English. The agent answers from your own collections using ekoDB's native RAG and vector search.
- Build your backend. The agent assembles collections, server-side functions, and scheduled jobs. It can start from ready-made templates for common backends (APIs, data models, auth, automation), or build the whole thing from scratch when no template fits what you need.
- Run real workflows. Give an agent a system prompt, scoped tool permissions, goals, and scheduled tasks that run on their own.
- Use built-in tools. File operations, web search, HTTP fetch, persistent memory, and reusable templates all come built in.
- Tune and debug itself. The agent can explain a slow query, spot a missing index and create it, surface which data is hot, and read server logs to find problems.
Your functions are its tools
An agent calls your stored functions as tools. It runs them with call_function. An agent whose key is an admin key can also find them with list_functions and read one with get_function; a key that is not an admin cannot use those two tools. A function you write once is both an endpoint for your app and a tool for your agents, with the same permission checks on both. The tool runs the function for the key behind the chat session, so that key needs a call grant that covers it (an admin key needs none), and the function runs as the identity its run_as declares. See Functions for a walkthrough that defines a function, calls it from an app, and has an agent call the same function.
Chat Tool Validation and Limits
On server 0.84.0 or later, chat batch_insert and batch_update refuse a
field value that cannot be converted, including excessive nesting, before
writing any item. Errors identify the record and field; see
Batch error handling. Record writes process
ttl and insert-time kv_link as record directives.
query_explain uses the explain route's planner and reports collection,
scan_type, indexes_used, estimated_cost, estimated_rows,
filter_selectivity and recommendations. An index entry has field,
index_type, unique and sparse. Both surfaces can still list an indexed
sort field while scanning; use scan_type to assess the plan. See
Indexes.
Agent limits are stored as a JSON string. Absent, null or empty-string limits
mean the defaults (enabled, without caps). A present malformed value or a
non-string is refused instead of silently enabling those defaults. A chat
turn, get_agent_usage and set_agent_limits report a fixed server-error
message and leave invalid stored limits unchanged.
POST and PUT /api/chat/agents reject malformed limits with 400:
'limits' do not parse: ... or 'limits' are not a JSON string. Repair an
agent with invalid stored limits using PUT /api/chat/agents and a well-formed
limits string. The set_agent_limits chat tool cannot perform that repair.
get_deployment_stats counts these agents in agents.invalid_limits and
marks them limits_invalid: true in the per-agent roll-up.
The call_function chat tool can still drop a parameter nested beyond the
recursion limit and report success. Keep parameters within the supported
nesting depth; the batch-tool validation above does not fix that behavior.
Agents for you, or for your users
An agent can serve two audiences:
- Internal. Run it for yourself and your team, from the dashboard or a client.
- Customer-facing. Expose an agent through a public customer endpoint so your own users can chat with it. You control CORS allowlists, anonymous access, rate limits, and token lifetime. A customer token can never escalate past the agent's permission ceiling, so it is safe to put in front of the public.
For customer-facing agents, prefer stored functions over raw read/write tools so behavior stays auditable and versioned.
Models
Bring your own model key. The agent supports the tool-calling providers: OpenAI, Anthropic (Claude), and Google (Gemini). Your key stays server-side and is never exposed to clients.
Concepts
- Agent. A scoped assistant with its own system prompt, allowed collections, tool permissions, and model. You can run many agents on one deployment.
- Goal. A higher-level objective the agent works toward across multiple steps.
- Task. A unit of work, including scheduled tasks that run on a cron-like cadence without you in the loop.
- Tools. The capabilities an agent can invoke: querying data, calling stored functions, file and web operations, and more. Permissions are per-agent, so you can mark write-capable tools as confirm-only or deny. Irreversible operations — deleting, moving, or copying files and running shell commands — always ask for a per-call confirmation in the interactive client, even when the tool is otherwise allowed, so a single broad "allow always" can never be reused to silently delete or overwrite something later.
- Memory. Persistent context the agent carries across sessions.
- Templates. Complete backend recipes (collections plus functions plus schedules) the agent applies in one step.
Next steps
- Build your first AI agent in 10 minutes walks you from signup to a working agent against your own data.
- Chat & RAG covers the underlying chat and retrieval primitives the agent builds on.
- Functions covers the server-side functions an agent composes into backends and calls as tools.
- Scheduled Functions covers running those functions on a cron schedule.
- ekoDB Agents gives the product overview.