← All posts
ZeroDB Cloud Functions: Your Database Just Learned to Think
June 12, 2026· 8 min read

ZeroDB Cloud Functions: Your Database Just Learned to Think

By Karsten Wade
## What If Your Database Could React? Every AI application follows the same pattern: write data, then run some processing on it. Store a document, then embed it. Save a memory, then extract entities for the knowledge graph. Upload a file, then summarize it. You write the glue code. You manage the queues. You handle the failures. You deploy the workers. **ZeroDB Cloud Functions eliminates all of it.** Write data to ZeroDB. The processing happens automatically. --- ## How It Works
Step What Happens
1. Your app writes dataPOST /vectors, /remember, /files, /tables — any ZeroDB write
2. Event firesZeroDB emits a typed event (fire-and-forget, non-blocking)
3. Hook matchesHook executor finds registered hooks for that event type
4. Handler runsYour function executes — embed, summarize, graph, or custom logic
Your write completes instantly. The hook runs in the background. If it fails, your write is still safe — hooks never block the data path. --- ## Seven Event Types Every ZeroDB write path emits a typed event. You choose which ones to hook into:
Event Fires When Use Case
zerodb.vector.storedVector upsertedAuto-embed if no embedding provided
zerodb.vector.batch_storedBatch upsert completesIndex optimization, cache warming
zerodb.memory.storedMemory record storedAuto-embed, entity extraction
zerodb.file.uploadedFile uploaded to storageAuto-summarize, content indexing
zerodb.table.row_insertedNoSQL row insertedValidation, enrichment, notifications
zerodb.event.publishedEvent published to streamCross-agent coordination, audit logging
zeromemory.rememberedMemory stored via ZeroMemoryAuto-graph, entity extraction
--- ## Three Built-In Hooks (Zero Config) You don't need to write any code to use these. Register a hook, and it runs. ### auto_embed — Never Worry About Embeddings Again Store text. Get vectors. Automatically. When you upsert a vector or store a memory without an embedding, `auto_embed` generates one using DigitalOcean GenAI inference with the `bge-m3` model (1024 dimensions). Your search just works — without an embedding pipeline. ```bash # Register the hook curl -X POST https://api.ainative.studio/api/v1/hooks \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "event_type": "zerodb.vector.stored", "hook_name": "auto_embed", "hook_config": {"model": "bge-m3", "dimensions": 1024} }' # Now just store text — embedding happens automatically curl -X POST https://api.ainative.studio/api/v1/public/zerodb/vectors \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"content": "AI agents need persistent memory", "metadata": {"source": "docs"}}' # Search immediately works — the embedding was auto-generated curl -X POST https://api.ainative.studio/api/v1/public/zerodb/vectors/search \ -H "Authorization: Bearer $TOKEN" \ -d '{"query": "agent memory"}' ``` ### auto_summarize — Every Upload Gets a Summary Upload a PDF, a log file, a data dump. `auto_summarize` generates a searchable summary automatically — without you building a summarization pipeline. ```bash curl -X POST https://api.ainative.studio/api/v1/hooks \ -H "Authorization: Bearer $TOKEN" \ -d '{ "event_type": "zerodb.file.uploaded", "hook_name": "auto_summarize", "hook_config": {"max_length": 500} }' ``` ### auto_graph — Memories Become Knowledge The most powerful hook. When an agent stores a memory, `auto_graph` extracts entities and relationships and inserts them into ZeroDB's Context Graph. Unstructured conversation turns into a queryable knowledge graph — automatically. ```bash curl -X POST https://api.ainative.studio/api/v1/hooks \ -H "Authorization: Bearer $TOKEN" \ -d '{ "event_type": "zeromemory.remembered", "hook_name": "auto_graph", "hook_config": {"extract_entities": true, "max_relations": 10} }' ``` Now when your agent stores "Toby is the CEO of AINative Studio and they raised a seed round," the graph automatically gets: - Entity: **Toby** (person, role: CEO) - Entity: **AINative Studio** (company) - Edge: **Toby → CEO_OF → AINative Studio** - Edge: **AINative Studio → RAISED → seed round** No entity extraction code. No graph insertion logic. Just store the memory. --- ## The Hook Management API Full CRUD for managing your hooks:
Method Endpoint Description
POST/api/v1/hooksCreate a hook
GET/api/v1/hooksList hooks (filter by event_type, project_id)
GET/api/v1/hooks/{id}Get a specific hook
PUT/api/v1/hooks/{id}Update hook config or disable
DELETE/api/v1/hooks/{id}Remove a hook
Hooks can be scoped per project or applied globally. Disable a hook without deleting it by setting `is_active: false`. --- ## Python SDK Example End-to-end: register hooks, store data, let the automation run. ```python import requests API = "https://api.ainative.studio/api/v1" HEADERS = {"Authorization": f"Bearer {TOKEN}"} # Step 1: Register auto_embed for all vectors requests.post(f"{API}/hooks", headers=HEADERS, json={ "event_type": "zerodb.vector.stored", "hook_name": "auto_embed", "hook_config": {"model": "bge-m3"} }) # Step 2: Register auto_graph for all memories requests.post(f"{API}/hooks", headers=HEADERS, json={ "event_type": "zeromemory.remembered", "hook_name": "auto_graph", "hook_config": {"extract_entities": True} }) # Step 3: Store data — hooks fire automatically requests.post(f"{API}/public/zerodb/vectors", headers=HEADERS, json={ "content": "ZeroDB Functions launch on June 12, 2026" }) # → auto_embed generates the 1024d bge-m3 embedding requests.post(f"{API}/public/memory/v2/remember", headers=HEADERS, json={ "content": "Toby demoed ZeroDB Functions at StartUp Camp" }) # → auto_graph extracts: Toby, ZeroDB Functions, StartUp Camp ``` No embedding code. No graph extraction. No queue workers. Just data in, intelligence out. --- ## Why This Matters The AI infrastructure landscape is full of databases that store data passively. You write. You read. Everything in between is your problem.
Capability Without Functions With ZeroDB Functions
Embedding generationBuild pipeline, manage model, handle failuresRegister auto_embed. Done.
Document summarizationDeploy summarizer, queue uploads, store resultsRegister auto_summarize. Done.
Knowledge graphNER pipeline, graph DB, relationship extractionRegister auto_graph. Done.
Custom automationCelery/SQS workers, error handling, monitoringRegister a hook. Done.
--- ## Architecture: Why It's Fast ZeroDB Functions are built on three design principles: **1. Fire-and-forget events.** The event emitter publishes to an in-memory bus immediately after the database write. Your API response is never delayed. **2. Non-blocking execution.** The hook executor runs as a background asyncio task, polling the event bus and dispatching to handlers. A crashed hook never affects other hooks or the write path. **3. In-process handlers (Phase 1).** The three built-in hooks run as trusted Python functions inside the API process — no serialization overhead, no network hops, no cold starts. Execution overhead: **under 18ms P50**. Phase 2 will add custom user-defined functions via sandboxed execution (already deployed on Railway with 112 RPS capacity and 0% error rate). --- ## What's Next **Phase 2: Custom Functions (Q3 2026)** - Deploy your own Python/JavaScript functions - Sandboxed execution in isolated containers - Trigger on any event type - Full MCP tool access from inside functions **Phase 3: Workflows (Q4 2026)** - Chain multiple functions into DAGs - Conditional branching, retries, timeouts - Visual workflow editor in the console --- ## Get Started ZeroDB Functions are live today. Register your first hook in under a minute: ```bash # 1. Get a database (30 seconds, no signup) curl -X POST https://api.ainative.studio/api/v1/public/instant-db # 2. Register auto_embed curl -X POST https://api.ainative.studio/api/v1/hooks \ -H "Authorization: Bearer $YOUR_KEY" \ -d '{"event_type": "zerodb.vector.stored", "hook_name": "auto_embed"}' # 3. Store text — embedding happens automatically curl -X POST https://api.ainative.studio/api/v1/public/zerodb/vectors \ -H "Authorization: Bearer $YOUR_KEY" \ -d '{"content": "Hello, reactive database"}' ``` - **Documentation**: [docs.ainative.studio/docs/zerodb/functions](https://docs.ainative.studio/docs/zerodb/functions) - **API Reference**: [docs.ainative.studio/docs/api/overview](https://docs.ainative.studio/docs/api/overview) - **MCP Server**: `pip install zerodb-mcp` - **Tool Discovery**: `GET /api/v1/public/tools/catalog` --- *Published June 12, 2026 by the AINative Engineering Team*

Check your site's AX Score

Free scan, 6 categories, under 60 seconds. See how your site ranks on the agentic web.

Run a free audit →