Skip to main content

Overview

The Ziet Database provides persistent storage for your applications. Unlike Memory (which is scoped to a single agent run), Database stores data permanently across all runs.
Database stores data forever - perfect for user accounts, orders, products, and application state.

Database vs Memory

When to use Database:
  • User accounts and profiles
  • Products, orders, transactions
  • Application state
  • Data that needs to persist forever
When to use Memory:
  • Intermediate action results
  • Agent workflow context
  • Temporary data during execution

Basic Operations

Insert

Add new records:
Returns: The ID of the inserted record

Query

Fetch records:

Update

Modify existing records:

Delete

Remove records:

Querying Data

Where Clauses

Filter records:

Multiple Conditions

Chain where clauses:

Sorting

Order results:

Limiting and Pagination

Counting

Using in Actions

Using in Agents

Using in Endpoints

Complete Example: E-commerce

Usage:

Schema Management

Tables are Auto-Created

No need to define schemas - tables are created automatically on first insert:

Built-in Fields

Every table automatically gets:
  • id - Unique identifier (auto-generated)
  • created_at - Timestamp of creation
  • updated_at - Timestamp of last update

Field Types

Ziet automatically infers field types:

Relationships

One-to-Many

Many-to-Many

Use a join table:

Best Practices

Query by common fields:

Limitations

Current limitations:
  • No JOIN queries (fetch related data separately)
  • No transactions yet (coming soon)
  • No migrations (tables auto-created)
  • Max 10,000 records per query
For complex queries: Consider using dedicated databases (PostgreSQL, MongoDB) via integrations.

Next Steps

Endpoints

Build REST APIs with endpoints

Memory

Use memory for temporary data

Actions

Access database from actions

Agents

Use database in agent workflows