Documentation

Quick Start

typescript
npm install @happyvertical/smrt-core

import { SmrtObject, smrt } from '@happyvertical/smrt-core';

@smrt()
class Task extends SmrtObject {
  title: string = '';
  completed: boolean = false;
}

const tasks = await TaskCollection.create({ db: 'tasks.db' });
const task = await tasks.create({ title: 'Learn SMRT' });
console.log(task.id); // auto-generated UUID

Core Concepts

  • How It Works — The codegen pipeline: one class becomes a REST API, CLI, MCP tools, and SQL schema
  • Security — Generated-surface defaults: fail-closed auth, sensitive and read-only fields
  • Objects — Persistent entities with AI-powered methods
  • Collections — Query, filter, and manage sets of objects
  • Agents — Autonomous actors with persistent state
  • Dispatch — Inter-agent async messaging

Concepts

  • Testing — Vitest setup with smrtVitestPlugin() and isolated test databases
  • Configurationsmrt.config.ts, defineConfig, and runtime config lookups
  • Multi-tenancy — Tenant isolation via @TenantScoped, withTenant(), and Postgres RLS
  • Context Memoryremember/recall with confidence and hierarchical scopes
  • Semantic Search — Embeddings, semanticSearch(), and findSimilar()

Guides

Migration Guides

  • 0.19 → 0.20 — Component reorganization, browser-ai consolidation, API changes