Database
Every environment includes a managed, schemaless database. Data is stored in named collections, queried with expressive filters, and browsed in the dashboard, without migrations, schema setup, or external hosting.
On this page
db_insert or db_upsert first writes to them through database tools.Data model
Each document is free-form with custom fields and no fixed schema. Every document gets three system-managed fields:
_id: auto-generated UUID, unique within the collection_created_at: ISO 8601 timestamp set on insert_updated_at: ISO 8601 timestamp set on every write
# Every document has these system fields alongside custom data:
{
"order_id": "ORD-001",
"status": "pending",
"amount": 99.50,
"_id": "550e8400-e29b-41d4-a716-446655440000", # auto-generated UUID
"_created_at": "2026-01-15T10:30:00Z",
"_updated_at": "2026-01-15T10:30:00Z",
}Auto-creation
Collections do not require explicit creation. The first call to db_insert or db_upsert creates the collection.
# No setup needed - the collection "orders" is created automatically
# the first time db_insert or db_upsert writes to it
result = await db_insert("orders", {
"order_id": "ORD-001",
"customer": "alice@example.com",
"amount": 99.50,
"status": "pending",
})Collections can also be created manually from the Storage → Database tab in the dashboard.
Import documents
Seed a collection once with existing data, such as the records of an app moving to connic. An import fills a new or empty collection and creates it if needed. After that, agents read and write the data through database tools.
- Formats: a JSON array of objects, or JSONL with one object per line. Blank lines are skipped.
- Size: up to 25 MB per file through the REST API and the dashboard, and up to 512 KiB through the MCP tool
import_database_documents. - All or nothing: one invalid document fails the whole import, and nothing is written.
- Empty collections only: an import into a collection that already has documents fails with
409 Conflict. To replace the data, delete the collection and import again. - Rate limit: 50 import requests per environment in any 24-hour window, failed ones included. Further requests return
429 Too Many Requestswith aRetry-Afterheader in seconds. - Every imported document gets its own
_id,_created_at, and_updated_at. Keep IDs from the old system in a regular field, such aslegacy_id.
curl -X POST "https://api.connic.co/v1/projects/{project_id}/database/{environment_id}/collections/orders/import" \
-H "Authorization: Bearer cnc_your_api_key" \
-F "file=@orders.jsonl"
# 201 Created
{"name": "orders", "imported_count": 1250}Searchable fields
A $regex filter checks the field in every document, so text search slows down as a collection grows. Making a text field searchable gives it a search index that $regex filters on the field use. Agents and db_find calls stay the same.
- Turn fields on in the Schema of a collection under Storage → Database, or through the REST API or connic MCP.
- The index builds in the background and shows Building until it is Ready. If it shows Failed, add the field again to rebuild it.
- A collection can have up to 5 searchable fields, and their indexes build one at a time.
- The index takes extra storage, billed as database storage.
Dashboard
The Storage → Database tab in the project dashboard supports:
- View all collections with document counts and storage sizes
- Browse documents with filter and sort controls
- Generate filters and sort order from plain-language requests
- Insert documents manually
- Import a JSON or JSONL file into an empty collection
- View the inferred schema: field names, types, and fill rates
- Create and delete collections

