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 UUIDCore 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 - Configuration —
smrt.config.ts,defineConfig, and runtime config lookups - Multi-tenancy — Tenant isolation via
@TenantScoped,withTenant(), and Postgres RLS - Context Memory —
remember/recallwith confidence and hierarchical scopes - Semantic Search — Embeddings,
semanticSearch(), andfindSimilar()
Guides
- Multi-tenant request lifecycle — One
hooks.server.ts: session, permissions, tenant context, RLS - Expose your app via MCP — Serve your objects to
Claude Desktop with
smrt-app-mcp - Add semantic search to a model — From keyword-only to meaning-based search
Migration Guides
- 0.19 → 0.20 — Component reorganization, browser-ai consolidation, API changes