SDK · npm package · v0.5

Install.
Import. Ship.

The AIDRAN data model as a package: Zod contracts and Drizzle schemas for every record, story, signal, and entity, plus a CLI for standing up a schema-compatible Postgres. For querying the hosted corpus, the REST API is the surface today — a typed client wrapping it is forthcoming.

$ npm i aidran

Node ≥ 22 · ESM · TypeScript types included

Quickstart · types & CLI

Full SDK reference →
import { contracts, db } from "aidran";
import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
 
// Validate at the boundary — anything that survives parse() is typed.
const event = contracts.RecordIngestedSchema.parse(payload);
 
// Drizzle schemas for the corpus tables, typed end to end.
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const orm = drizzle(pool, { schema: db });
 
const rows = await orm.select().from(db.records).limit(50);

What the package exposes

01

Contracts

Zod event and DTO schemas for the full data model — records, stories, signals, entities, beats. Parse at the boundary; everything downstream is typed.

import { … } from 'aidran/contracts'
02

DB schemas

Drizzle ORM schemas for the corpus tables. Point them at your own Postgres and query with full type inference.

import { records } from 'aidran/db'
03

CLI

The aidran binary: an interactive setup wizard plus init, migrate, and verify subcommands for standing up a schema-compatible database.

npx aidran migrate
04

Migrations

The bundled migration folder is exported as a subpath, so drizzle-orm’s migrator can run the schema programmatically in your own deploy step.

'aidran/db/migrations-path'
Typed API clientForthcoming

A client wrapping the hosted REST API — auth, cursor pagination, and the SSE signal stream — is on the bench, not in the package. Until it ships, call the REST API directly (any HTTP client works; responses match the contracts types) or try requests in the playground.

Self-host · DockerForthcoming

Container images for the AIDRAN client — coming soon.

We are packaging the AIDRAN client and its read-side companions for Docker so teams can pin the corpus surface inside their own infra. The image is not yet published — this is what is on the bench, not what is shipped.

  • ARoadmap

    aidran/aidran (image)

    Run the corpus client locally

    A small image bundling the AIDRAN client and a thin CLI for ad-hoc corpus queries from CI, cron, or a workstation. Same Bearer auth as the REST API.

  • BRoadmap

    Your VPC

    AWS / GCP, in your account

    A reference compose / Helm chart for running the read surface against AIDRAN Cloud from inside your own network. Scoped per engagement today; productized as the Docker rollout progresses.

  • CRoadmap

    Air-gapped

    On-prem, offline updates

    For regulated environments. Longer timeline, scoped per contract. We will not pretend this ships today; we will scope it honestly with you.

Want it sooner?

VPC and air-gapped scopes are sized per contract. If your team needs the AIDRAN read surface inside your network, get in touch — connector and image priority is set by who's asking. Talk to the founder →

SDK reference

The full SDK reference catalogs every CLI command, namespace export, and subpath. Grounded in the public scaffold at github.com/AIDRAN/aidran. Looking for the REST API instead? API reference →

SDK reference →