Quick Start Guide
Two ways to stand up a backend on ekoDB: describe it to an agent (three steps, no API code) or build it by hand (the dozen steps below). New here? Start with the Introduction.
Build your backend with an agent (recommended)
You do not have to hand-write the API below. Deploy an AI Agent next to your database, describe the backend you want, and it builds the collections and server-side functions for you. Your app calls those functions with one line. Then you go build your frontend.
| 🤖 With an agent | 🛠️ By hand | |
|---|---|---|
| Setup | deploy a database and an agent | deploy a database |
| Build the backend | describe it in chat | write insert / get / query / update / batch yourself |
| Add a feature later | ask for it | write another endpoint |
| Your job | the frontend | the frontend and the whole API |
Three steps
-
Deploy a database and an AI Agent. Two deployments at app.ekodb.io, then connect the agent to the database. (Build Your First AI Agent has the click-by-click.)
-
Describe your backend in the agent's chat:
Build a user-management backend: a
userscollection with name, email, age, and role, plus a functionlist_developersthat returns everyone whose role is developer.The agent creates the collection and the stored function directly in your database.
-
Call it from your app with the SDK and your database's API key:
import { EkoDBClient } from "@ekodb/ekodb-client";const client = new EkoDBClient({ baseURL: "https://my-first-db.development.google.ekodb.net", apiKey: "YOUR_API_KEY" });await client.init();const developers = await client.callFunction("list_developers");That is the backend done. Go build your UI; ekoDB runs the rest.
It does not stop at building
Once your backend is live, keep talking to the agent to run it:
- Read the logs and surface errors
- Diagnose a bug by tracing it through the server logs to the cause
- Test a function by calling it and checking the result
- Add or fix an index when a query is slow
- Scale it: spin up new deployments, convert a database to a multi-node cluster, tune node configs, and take backups
- Schedule jobs, evolve schemas, and add features, all by asking
From the first build through production scale, the agent runs the backend so you can stay on the frontend.
The rest of this guide is the by-hand path: deploy a database, authenticate, and write each operation (insert, query, update) yourself.
Step 1: Deploy Your Database (2 minutes)
- Sign up at app.ekodb.io
- Click "Create Deployment" at the top of the dashboard page: app.ekodb.io/dashboard
- Choose the Database module (the default). The other option, AI Agent, is covered in Build Your First AI Agent.
- Select your region (choose the region closest to your users)
- Choose a machine tier (start with the free tier for testing)
- Set your subdomain and environment:
- Environment Type:
development - Subdomain:
my-first-db(or any unique name)
- Environment Type:
- Click Create Deployment
Your database will be ready in a few minutes. You'll receive an email once it's live.
Step 2: Your Database URL
Once properly up and running, your deployment's status will show as "Running". Your database URL will be:
https://my-first-db.development.{provider}.ekodb.net
Replace {provider} with your selected cloud provider (ex. "google").
View all of your deployments at app.ekodb.io/deployments.
Click on your deployment to navigate to that deployment's information page.
That deployment's database URL can be found at the top under the subdomain (shown with "/api").
Here you can also find this deployment's API keys. You will need the Admin API key for the next step.
To copy the Admin API key: Select your deployment → "Keys" tab → Click "Load Keys" → Copy the Admin API key
Step 3: Authenticate (30 seconds)
You authenticate with your API key. A client library takes the key and manages tokens for you, so you can skip ahead. For raw HTTP, the API key is not sent directly; you first exchange it for a short-lived access token:
- Client Libraries (Recommended)
- Direct API
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
use ekodb_client::Client;
let client = Client::builder()
.base_url("https://my-first-db.development.google.ekodb.net")
.api_key("YOUR_API_KEY")
.build()?;
// Token is automatically managed by the client
from ekodb_client import Client
client = Client.new(
'https://my-first-db.development.google.ekodb.net',
'YOUR_API_KEY'
)
# Token is automatically managed by the client
import { EkoDBClient } from "@ekodb/ekodb-client";
const client = new EkoDBClient({
baseURL: "https://my-first-db.development.google.ekodb.net",
apiKey: "YOUR_API_KEY",
});
await client.init();
// Token is automatically managed by the client
const { EkoDBClient } = require("@ekodb/ekodb-client");
const client = new EkoDBClient({
baseURL: "https://my-first-db.development.google.ekodb.net",
apiKey: "YOUR_API_KEY",
});
await client.init();
// Token is automatically managed by the client
import io.ekodb.client.EkoDBClient
val client = EkoDBClient.builder()
.baseUrl("https://my-first-db.development.google.ekodb.net")
.apiKey("YOUR_API_KEY")
.build()
// Token is automatically managed by the client
import ekodb "github.com/ekoDB/ekodb-client-go"
client := ekodb.NewClient(
"https://my-first-db.development.google.ekodb.net",
"YOUR_API_KEY",
)
// Token is automatically managed by the client
curl -X POST https://my-first-db.development.{provider}.ekodb.net/api/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "YOUR_API_KEY"}'
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Save this token for subsequent requests. Tokens are valid for a limited time (default: 1 hour). Client libraries handle token refresh automatically.
Step 4: Insert Your First Record (1 minute)
Let's create a user record:
- Client Libraries (Recommended)
- Direct API
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
use ekodb_client::Record;
let mut record = Record::new();
record.insert("name", "Alice");
record.insert("email", "alice@example.com");
record.insert("age", 30);
record.insert("role", "developer");
let result = client.insert("users", record, None).await?;
println!("Record ID: {}", result.get_string("id").unwrap_or_default());
result = await client.insert('users', {
'name': 'Alice',
'email': 'alice@example.com',
'age': 30,
'role': 'developer'
})
print('Record ID:', result['id'])
const result = await client.insert("users", {
name: "Alice",
email: "alice@example.com",
age: 30,
role: "developer",
});
console.log("Record ID:", result.id);
const result = await client.insert("users", {
name: "Alice",
email: "alice@example.com",
age: 30,
role: "developer",
});
console.log("Record ID:", result.id);
val result = client.insert("users", mapOf(
"name" to "Alice",
"email" to "alice@example.com",
"age" to 30,
"role" to "developer"
))
println("Record ID: ${result.id}")
result, err := client.Insert("users", map[string]interface{}{
"name": "Alice",
"email": "alice@example.com",
"age": 30,
"role": "developer",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Record ID:", result.ID)
curl -X POST https://my-first-db.development.{provider}.ekodb.net/api/insert/users \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "Alice",
"email": "alice@example.com",
"age": 30,
"role": "developer"
}'
Response:
{
"id": "encrypted_record_id_here"
}
The id returned is an encrypted record ID. Save this ID - you'll need it to fetch, update, or delete this specific record.
Step 5: Get a Record (30 seconds)
Retrieve the record you just created:
- Client Libraries (Recommended)
- Direct API
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
let record = client.get("users", &record_id).await?;
println!("{:?}", record);
record = client.get('users', record_id)
print(record)
const record = await client.get("users", recordId);
console.log(record);
const record = await client.get("users", recordId);
console.log(record);
val record = client.get("users", recordId)
println(record)
record, err := client.Get("users", recordID)
if err != nil {
log.Fatal(err)
}
fmt.Println(record)
curl -X GET https://my-first-db.development.{provider}.ekodb.net/api/find/users/{record_id} \
-H "Authorization: Bearer YOUR_API_TOKEN"
Replace {record_id} with the id from the insert response.
Response (Default - Typed):
{
"id": {
"type": "String",
"value": "encrypted_record_id_here"
},
"name": {
"type": "String",
"value": "Alice"
},
"email": {
"type": "String",
"value": "alice@example.com"
},
"age": {
"type": "Integer",
"value": 30
},
"role": {
"type": "String",
"value": "developer"
}
}
By default, ekoDB returns typed responses with type metadata. This provides type safety and explicit type information.
Want simpler JSON? You can switch to non-typed responses:
- Via App: app.ekodb.io/deployments → Select your deployment → Configurations → Edit → Toggle "Use Typed Values"
- Via API:
PUT /api/configwith{"use_typed_values": false}
Non-typed response example:
{
"id": "encrypted_record_id_here",
"name": "Alice",
"email": "alice@example.com",
"age": 30,
"role": "developer"
}
Step 6: Query with Filter (30 seconds)
You can also query records using filters instead of IDs:
- Client Libraries (Recommended)
- Direct API
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
use ekodb_client::QueryBuilder;
let query = QueryBuilder::new().eq("name", "Alice").build();
let results = client.find("users", query, None).await?;
println!("{:?}", results);
from ekodb_client import QueryBuilder
query = QueryBuilder().eq("name", "Alice").build()
results = await client.find("users", query)
print(results)
import { QueryBuilder } from "@ekodb/ekodb-client";
const query = new QueryBuilder().eq("name", "Alice").build();
const results = await client.find("users", query);
console.log(results);
const { QueryBuilder } = require("@ekodb/ekodb-client");
const query = new QueryBuilder().eq("name", "Alice").build();
const results = await client.find("users", query);
console.log(results);
val query = QueryBuilder().eq("name", "Alice").build()
val results = client.find("users", query)
println(results)
query := ekodb.NewQueryBuilder().Eq("name", "Alice").Build()
results, err := client.Find("users", query)
if err != nil {
log.Fatal(err)
}
fmt.Println(results)
curl -X POST https://my-first-db.development.{provider}.ekodb.net/api/find/users \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"filter": {
"type": "Condition",
"content": {
"field": "name",
"operator": "Eq",
"value": "Alice"
}
}
}'
Response (Typed):
[
{
"id": {
"type": "String",
"value": "encrypted_record_id_here"
},
"name": {
"type": "String",
"value": "Alice"
},
"email": {
"type": "String",
"value": "alice@example.com"
},
"age": {
"type": "Integer",
"value": 30
},
"role": {
"type": "String",
"value": "developer"
}
}
]
Step 7: Update a Record (30 seconds)
Update Alice's role using the encrypted ID:
- Client Libraries (Recommended)
- Direct API
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
client.update("users", &record_id, serde_json::json!({
"role": "senior developer"
})).await?;
await client.update('users', record_id, {
'role': 'senior developer'
})
await client.update("users", recordId, {
role: "senior developer",
});
await client.update("users", recordId, {
role: "senior developer",
});
client.update("users", recordId, mapOf(
"role" to "senior developer"
))
_, err := client.Update("users", recordID, map[string]interface{}{
"role": "senior developer",
})
if err != nil {
log.Fatal(err)
}
curl -X PUT https://my-first-db.development.{provider}.ekodb.net/api/update/users/{record_id} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"role": "senior developer"
}'
Replace {record_id} with the actual id from your insert response. This is the encrypted record ID that ekoDB uses to identify specific records.
Step 8: Use a Client Library (Recommended)
While direct API calls work great, we recommend using our official client libraries for a better developer experience:
Client libraries automatically handle token generation and refresh for you. Simply provide your API key once, and the client manages authentication behind the scenes!
- 🦀 Rust
- 🐍 Python
- 📘 TypeScript
- 📦 JavaScript
- 🟣 Kotlin
- 🔷 Go
cargo add ekodb_client
# Optional: Add tokio if using #[tokio::main] in your code
# cargo add tokio --features macros
use ekodb_client::{Client, QueryBuilder, Record};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::builder()
.base_url("https://my-first-db.development.{provider}.ekodb.net")
.api_key("YOUR_API_KEY")
.build()?;
// Insert
let mut record = Record::new();
record.insert("name", "Bob");
record.insert("email", "bob@example.com");
record.insert("age", 25);
record.insert("role", "designer");
let user = client.insert("users", record, None).await?;
println!("Inserted: {}", user.get_string("id").unwrap_or_default());
// Query
let query = QueryBuilder::new().eq("role", "designer").build();
let users = client.find("users", query, None).await?;
println!("{:?}", users);
Ok(())
}
pip install ekodb-client
from ekodb_client import Client
client = Client.new(
"https://my-first-db.development.{provider}.ekodb.net",
"YOUR_API_KEY"
)
# Insert
user = await client.insert("users", {
"name": "Bob",
"email": "bob@example.com",
"age": 25,
"role": "designer"
})
# Query
users = await client.find("users", {
"filter": {
"type": "Condition",
"content": {
"field": "role",
"operator": "Eq",
"value": "designer"
}
}
})
print(users)
npm install @ekodb/ekodb-client
import { EkoDBClient, QueryBuilder } from "@ekodb/ekodb-client";
const client = new EkoDBClient({
baseURL: "https://my-first-db.development.{provider}.ekodb.net",
apiKey: "YOUR_API_KEY",
});
await client.init();
// Insert
const user = await client.insert("users", {
name: "Bob",
email: "bob@example.com",
age: 25,
role: "designer",
});
// Query
const query = new QueryBuilder().eq("role", "designer").build();
const users = await client.find("users", query);
console.log(users);
npm install @ekodb/ekodb-client
const { EkoDBClient, QueryBuilder } = require("@ekodb/ekodb-client");
const client = new EkoDBClient({
baseURL: "https://my-first-db.development.{provider}.ekodb.net",
apiKey: "YOUR_API_KEY",
});
await client.init();
// Insert
const user = await client.insert("users", {
name: "Bob",
email: "bob@example.com",
age: 25,
role: "designer",
});
// Query
const query = new QueryBuilder().eq("role", "designer").build();
const users = await client.find("users", query);
console.log(users);
// Add to build.gradle.kts
dependencies {
implementation("io.ekodb:ekodb-client-kt:0.23.0")
}
import io.ekodb.client.EkoDBClient
suspend fun main() {
val client = EkoDBClient.builder()
.baseUrl("https://my-first-db.development.{provider}.ekodb.net")
.apiKey("YOUR_API_KEY")
.build()
// Insert
val user = client.insert("users", mapOf(
"name" to "Bob",
"email" to "bob@example.com",
"age" to 25,
"role" to "designer"
))
// Query
val users = client.find("users", mapOf(
"filter" to mapOf(
"type" to "Condition",
"content" to mapOf(
"field" to "role",
"operator" to "Eq",
"value" to "designer"
)
)
))
println(users)
}
go get github.com/ekoDB/ekodb-client-go
package main
import (
"fmt"
ekodb "github.com/ekoDB/ekodb-client-go"
)
func main() {
client := ekodb.NewClient(
"https://my-first-db.development.{provider}.ekodb.net",
"YOUR_API_KEY",
)
// Insert
user, err := client.Insert("users", map[string]interface{}{
"name": "Bob",
"email": "bob@example.com",
"age": 25,
"role": "designer",
})
if err != nil {
panic(err)
}
// Query
query := ekodb.NewQueryBuilder().Eq("role", "designer").Build()
users, err := client.Find("users", query)
if err != nil {
panic(err)
}
fmt.Println(users)
}
What You Just Learned
✅ How to deploy an ekoDB database
✅ How to insert records
✅ How to query data
✅ How to update records
✅ How to use client libraries
Next Steps
Now that you have ekoDB running, here's what to explore next:
📚 Learn by Example
GitHub Examples Repository - 129 in all languages:
- Rust, Python, TypeScript, JavaScript, Go, Kotlin
- Client library examples (using official SDKs) and direct HTTP examples (raw REST API calls)
- CRUD operations, search, batch operations, functions, and more
- Complete working code you can copy and run
Choose Your Path
Building a Web/Mobile App? → Client Libraries Guide - Type-safe SDKs for your language
Using REST API Directly? → Basic Operations - Complete API reference
Need Advanced Features?
→ Batch Operations - High-performance bulk operations
→ Transactions - Atomic, durable multi-document transactions
→ Functions - Stored procedures
Building an AI Application?
→ Chat & RAG - Chat with your data using the database's built-in RAG
→ Vector Search & Embeddings - Semantic similarity search
→ Search - Full-text search capabilities
Want autonomous AI?
→ Build Your First AI Agent - Deploy an AI Agent that connects to this database and runs tools, goals, and scheduled tasks
→ AI Agents - What agents are and how they work
Want to Understand the Architecture? → White Paper - Deep dive into ekoDB's design
Common Next Tasks
- Set up proper authentication: Authentication Guide
- Define schemas: Add validation and constraints to your collections
- Add indexes: Optimize query performance
- Enable WebSockets: Real-time data updates
- Set up Ripple: Multi-region replication
Need Help?
- 💬 Support: app.ekodb.io/support
- 📧 Email: support@ekodb.io
Ready to build something amazing? Let's go! 🚀