AkurAI Build
Menu

Public repository / 89952ed42401bf7abda4948e556ef64b3fc5783e

AkurAI-Notes / site/backend/collections.toml

Latest change 409fb930689e231969f33d5f0947e030c930a722 - E01: Bootstrap AkurAI-Notes v0.0.1 — pure-Rust workspace via AkurAI-Framework 'akurai new' by Claude Code

# Declarative data model — the single source of truth.
# The auto-API, validation, and semantic-search embeddings all derive from this
# file. Add a collection and its REST routes appear immediately at
# /api/collections/<name>/records with no handwritten endpoint code.
#
# Field types: text | int | float | bool
#   required = true   → must be present on create
#   embed = true      → (text only) auto-embedded for semantic ?search
#
# Routes mounted for each collection:
#   GET    /api/collections                     → manifest of all collections
#   GET    /api/collections/<name>/records      → list (newest first)
#   GET    /api/collections/<name>/records?search=<q>[&limit=N]
#   POST   /api/collections/<name>/records      → create (JSON body)
#   GET    /api/collections/<name>/records/<id> → fetch one
#   PATCH  /api/collections/<name>/records/<id> → partial update
#   DELETE /api/collections/<name>/records/<id> → delete
#
# Semantic search turns on when AKURAI_EMBED_URL points at an OpenAI-compatible
# embeddings endpoint (plain HTTP — no TLS); otherwise ?search is substring.

[[collection]]
name = "posts"

  [[collection.field]]
  name = "title"
  type = "text"
  required = true

  [[collection.field]]
  name = "body"
  type = "text"
  embed = true          # auto-embedded for semantic search (?search=...)