TapirusDB
CURRENT API RECIPES · v1.0.1

Build the local path first.

Runnable TapirusDB patterns for the APIs in the project today. Every recipe stays close to its real contract—no invented latency figures or unsupported SQL promises.

START HERE

Choose the contract before the convenience.

Scope matters

Before shipping

Do not treat TapirusDB as a full SQLite replacement or infer recovery behaviour from an example.

Use the source

Check the documented SQL subset, SDK contract, and target-platform tests for the exact feature you intend to ship.

These recipes show open, write, retrieve and close flows. Use parameterised SDK methods for user values, then test close, reopen and recovery with representative data.

RUST · SQL

Open, write, query, and close a local database.

Core API

The maintained Rust quickstart uses the documented SQL subset and closes the connection explicitly.

Rust
use tapirus::{Connection, Result};

fn main() -> Result<()> {
    let db = Connection::open("notes.tapir")?;
    db.execute("CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY, body TEXT NOT NULL)")?;
    db.execute("INSERT INTO notes (id, body) VALUES (1, 'Review the supported API')")?;
    let rows = db.query("SELECT id, body FROM notes")?;
    println!("{rows:?}");
    db.close()?;
    Ok(())
}
NODE.JS · AI MEMORY

Store sources and retrieve them with citations.

Native SDK

Applications supply embeddings when they need vector similarity. Namespace and session fields filter records; they are not application authentication.

JavaScript
const { open } = require('tapirus');
const db = open('assistant.tapir');

db.execute('BEGIN;');
db.storeMemory({ content: 'Maintenance is due every 500 hours.',
  embedding: [1, 0], namespace: 'manuals', sessionId: 'workshop' });
db.execute('COMMIT;');

const sources = db.searchMemories({ query: 'maintenance interval',
  embedding: [1, 0], namespace: 'manuals', limit: 5 });
console.log(sources.map(result => result.entry.content));
db.close();
PYTHON · TEXT MEMORY

Start with simple local agent context.

Python 3.10+

The text-memory helper performs text matching and may fall back to recent rows; it is not an embedding-based semantic search API.

Python
import tapirus

with tapirus.connect("agent_memory.tapir") as db:
    db.remember("Alex prefers concise technical answers.")
    matches = db.recall("What style of answer does Alex prefer?", limit=3)
    for item in matches:
        print(item.get("content", ""))
    db.checkpoint()
NEXT STEPS

Validate the path that carries your data.

Release discipline

Build confidence

Test write, close, reopen, interrupted writes and memory use on the OS, storage and dataset your product will use.

Do not assume

Examples do not certify general ACID behaviour, crash safety, retrieval quality, safety certification or a fixed resource ceiling.

Read the documentation · Open the maintained Markdown cookbook · Get a build