Skip to main content

db

TypeScript AI Agent
  • Database Module - Exports for persistence layer
  • Usage (Python-like simplicity): import { db } from ‘praisonai’;
  • const agent = new Agent({ instructions: “You are helpful”, db: db(“sqlite:./data.db”), // URL-style string, persists to a file sessionId: “my-session” });
  • What is durable today:
  • db(“sqlite:./data.db”) persists to disk and survives the process
  • db(“sqlite::memory:”) real SQLite, but process-local
  • db(“memory:”) in-process Maps, lost when the process exits
  • postgres:// and redis:// still throw — see createDbAdapter below.

Import

Functions

createDbAdapter()

Function definition.

getDefaultDbAdapter()

Function definition.

setDefaultDbAdapter()

Function definition.

db()

Function definition.

JS Database

JS NL Postgres