MIT License · 100% open source

The engine. You ship the assistant.

Build an AI assistant that remembers you for years.

Graphorin is the open-source TypeScript framework for long-living personal AI assistants: a trainer, tutor, advisor, or co-pilot that remembers, endures, and stays yours. Runs local-first, on your own machine.

  • Zero telemetry
  • Vendor-neutral
  • Type-safe
  • MIT licensed
assistant.ts
// give your assistant a memory, then just talk to it
import { createAgent } from '@graphorin/agent';

const coach = createAgent({
  name: 'coach',
  instructions: 'You are a personal trainer.',
  provider,
  memory,  // SQLite on your disk
  tools: memory.tools,  // lets the model save + recall facts
});

for await (const e of coach.stream(process.argv[2]))
  if (e.type === 'text.delta') process.stdout.write(e.delta);
example output · two runs · one memory
npx tsx assistant.ts "Did squats today: 5x5 at 100 kg"Logged. 100 kg for 5 is a new personal best. Nice work.// two days later · a new process, the same memorynpx tsx assistant.ts "What's the plan for today?"Last time you hit 100 kg for 5, and sleep ran short this week. Warm up, then 3x5 at 102.5 kg and stop there.

Example transcript. Here the model decides when to save or recall; the quickstart wires the deterministic pattern.

npm install @graphorin/agent @graphorin/memory @graphorin/provider @graphorin/store-sqlite @graphorin/embedder-transformersjs
Built on principles, not promises
Local-first by default Six-tier memory Durable workflow Exactly-once tools Human-in-the-loop OpenTelemetry-native MCP first-class Encrypted at rest Signed skills MIT License
The framework gap

Today's agent frameworks force a choice between two halves of the same problem.

Local-first vs. SaaS-first

Most assume a managed dashboard, hosted inference, and phone-home telemetry by default. We wanted the opposite: an audit-friendly, air-gap-compatible foundation that an enterprise compliance team can sign off in an afternoon.

Memory & retrieval vs. Agent loop & tools

Most frameworks specialise in one frontier: agent memory, the agent loop, or durable execution. Few own all three together. Build a real personal assistant on any of them and you end up stitching four libraries together.

Graphorin is one composable surface across all of it: the agent loop, six-tier memory, durable workflow, secrets, observability, sandbox, sessions, and an optional standalone server when you need to expose your assistant over a network.

Tier 6

DeliveryA daemon with REST, WebSocket, and SSE. A CLI. A typed client.

@graphorin/server@graphorin/cli@graphorin/client
Tier 5

RuntimeThe agent loop and the durable step-graph workflow engine.

@graphorin/agent@graphorin/workflow
Tier 4

MemorySix tiers, bitemporal facts, background consolidation, sessions.

@graphorin/memory@graphorin/sessions
Tier 3

SurfaceDefer-loaded tools, signed skills, an in-core MCP client.

@graphorin/tools@graphorin/skills@graphorin/mcp
Tier 2

PersistenceSQLite or SQLCipher storage, local embeddings, any LLM behind one interface.

@graphorin/store-sqlite@graphorin/provider@graphorin/embedder-transformersjs
Tier 1

Cross-cuttingSecrets, traces, and cost caps woven through every layer.

@graphorin/security@graphorin/observability@graphorin/pricing
Tier 0

FoundationThe contracts everything else implements.

@graphorin/core
6 memory tiers, one engine
0 implicit network calls
100% type-safe public APIs
2 ways to ship: library or daemon
Quickstart

From nothing to a remembering assistant in one small file.

No account. No API key. No cloud dashboard. Install the packages, point the provider at a local model through Ollama, and the file on the right runs exactly as written, top to bottom.

  1. 1
    Install the core packages. Node.js 22+ and a package manager; the native SQLite stack ships prebuilt (pnpm 10 users approve its build script - one line).
  2. 2
    Point it at a local model. Ollama or any OpenAI-compatible endpoint works; no key required.
  3. 3
    Teach it a fact. An explicit write lands in SQLite; auto-recall carries it into every prompt.
  4. 4
    Stream a reply. Every response is a typed stream of events.
hello-assistant.ts
import { createAgent } from '@graphorin/agent';
import { createMemory, defineAutoRecallStrategy } from '@graphorin/memory';
import { createProvider, ollamaAdapter } from '@graphorin/provider';
import { createSqliteStore } from '@graphorin/store-sqlite';
import { createTransformersJsEmbedder } from '@graphorin/embedder-transformersjs';

// 1 · everything lives in one local file
const sqlite = await createSqliteStore({ path: './assistant.db' });
await sqlite.init();

// 2 · six-tier memory, embeddings run on your machine
const memory = createMemory({
  store: sqlite.memory,
  embeddings: sqlite.embeddings,
  embedder: createTransformersJsEmbedder(),
  contextEngine: {
    // a loopback provider may see internal facts
    privacy: { providerTrust: 'loopback' },
    // recall stored facts into every prompt, not only when the model asks
    factsAutoRecall: {
      topK: 5,
      strategy: defineAutoRecallStrategy({
        id: 'every-turn',
        evaluate: ({ lastUserMessage }) => ({
          factsTriggered: lastUserMessage.trim().length > 0,
          reason: 'every-turn',
        }),
      }),
    },
  },
});

// 3 · a local model through Ollama: no API key, no cloud
const provider = createProvider(
  ollamaAdapter({ baseUrl: 'http://127.0.0.1:11434', model: 'qwen2.5:7b-instruct-q4_K_M' }),
  { acceptsSensitivity: ['public', 'internal'] },
);

const agent = createAgent({
  name: 'hello',
  instructions: 'Be brief and helpful.',
  provider,
  memory,
  userId: 'u1',
  sessionId: 's1',
  tools: memory.tools,  // the model can also search + save facts mid-chat
  autoAssembleContext: true,  // recalled facts ride in automatically
});

// 4 · teach it a durable fact: an explicit write, straight to SQLite
await memory.semantic.remember(
  { userId: 'u1' },
  { text: 'Front squat working set: 5x5 at 100 kg.' },
);

// 5 · stream the answer, token by token: the fact is already in context
for await (const event of agent.stream('What should I lift today?'))
  if (event.type === 'text.delta') process.stdout.write(event.delta);
npm install @graphorin/agent @graphorin/memory @graphorin/provider @graphorin/store-sqlite @graphorin/embedder-transformersjs
Why Graphorin

Seven differences you'll feel on the first day, the first week, and the first year.

Your data never leaves your machine

Zero version pings. Zero analytics. Zero crash uploads. Zero npm postinstall network calls. A continuous-integration check fails the build the moment anyone slips. This isn't “mostly local”. It's a hard rule.

It remembers: last week, last year

Six distinct layers, each with its own lifecycle. Old facts are superseded, never silently overwritten, and bitemporal history lets you ask what was true as of last March. A background consolidator distils long conversations into long-term knowledge.

Pause today, resume next week

Workflows pause for an overnight approval, resume on a different machine, and continue exactly where they left off. Tools execute exactly once, even if the process dies mid-call. Human-in-the-loop is a primitive, not an afterthought.

Never locked to one AI vendor

Switch models with a one-line change. Use a frontier API today, an OpenAI-compatible server tomorrow, Ollama or an in-process GGUF model the day after, without rewriting your assistant. Local LLMs are first-class, not a fallback.

Secrets that simply can't leak

A secret-value type that cannot be accidentally logged, serialised, or displayed. OS keychain integration and OAuth 2.1 with PKCE. Cryptographically signed skills. A tamper-evident audit log for every privileged operation.

See exactly what your assistant did

OpenTelemetry-native traces with the GenAI semantic conventions for every LLM call, tool, memory write, and workflow step. A mandatory redaction layer keeps secrets and PII out of your traces, even if you forget.

Type-safe from end to end

Zero any in public APIs. Schemas flow through tools, memory blocks, and structured outputs. Streaming-first by design: every operation is a typed AsyncIterable of events your UI can render as they happen.

Six-tier memory

A real memory model, not a vector database with a retrieval helper.

Most frameworks treat memory as one undifferentiated bag. Graphorin treats it as six layers, each with its own lifecycle, conflict-resolution strategy, and privacy posture. Together they give your assistant a memory it can actually live with, for years.

01

Working

Short, structured blocks holding what the assistant is doing right now: persona, current task, immediate context.

milliseconds to minutes
02

Session

The rolling message log of the current conversation. The thread you're inside, with all of its turn-by-turn context.

minutes to hours
03

Episodic

Things that happened: decisions, events, milestones, captured with proper bitemporal validity. The assistant's autobiography.

days to years
04

Semantic

Facts about you, the world, the task. Conflicts resolved through a multi-stage pipeline. Old facts superseded, never destroyed.

weeks to permanent
05

Procedural

How to do things: workflows, recipes, learned patterns. The assistant gets better at the tasks it does most often.

grows over time
06

Shared

Common knowledge across multiple agents in the same household, team, or organisation, with private layers for each individual.

cross-agent, lasting

Multi-stage conflict resolution

Exact dedup, embedding three-zone, heuristic, then subject/predicate. No coin flips. Every decision is auditable.

Hybrid search by default

Dense vectors plus full-text, fused with Reciprocal Rank Fusion. Late-chunking retrieval, an entity graph with one-hop expansion, pluggable rerankers.

Background consolidator with a budget

Light, standard, and deep phases distil sessions into long-term memory. A built-in cost cap means it can never run away with your bill.

Injection defense built in

Untrusted content is quarantined with provenance attached, and promotes to trusted memory only after validation. Privacy tags flow through traces and exports, with redaction on by default.

What you can build

Pick a domain. The shape is the same.

Personal trainer

Remembers your injury history, your last six months of workouts, your nutrition preferences, and your favourite phrasing.

Personal tutor

Knows what your child mastered last week, what they struggled with, and adjusts every lesson accordingly.

Financial advisor

Has watched a year of your spending, understands your goals, and waits for your approval before doing anything irreversible.

Business co-pilot

Lives alongside your team, knows your customers and contracts, and quietly drafts follow-ups overnight.

Research companion

Builds up a multi-month understanding of a topic, never forgets a citation, and surfaces the right paper at the right time.

Household assistant

Several family members talk to it, each with their own private memory, plus a shared layer for the things that concern everyone.

Two ways to ship

Embed it. Or run it as a daemon. Same code. Different lifetime.

Mode 1

As a library

Embed Graphorin directly in any Node.js process. Your application owns the lifecycle, which is perfect for desktop apps, CLIs, scripts, and short-lived services.

  • Lives in your process
  • You own the event loop
  • Zero infrastructure overhead
  • Ideal for embedded use
Mode 2

As a standalone server

Promote your assistant to a long-lived daemon with a network API the moment it has to outlive a terminal. Same code, different process model.

  • REST + WebSocket + SSE fallback
  • Durable human-in-the-loop across restarts
  • Built-in triggers and consolidator daemons
  • Lifecycle hooks, replay, and audit

The promise

Local-first. Vendor-neutral. Durable. Observable. Type-safe. Honest.

Eighteen design principles, encoded in the repository. If a feature contradicts a principle, the feature loses. No drift. No scope creep. No surprises.

We believe the next decade of personal AI will not be won by the cleverest chat window.

It will be won by whoever earns the user's trust over time: by remembering what matters, forgetting what doesn't, never leaking what's private, and being there next year when the user comes back. That is a framework problem before it is a product problem, and the frameworks that exist today were not designed for it. So we designed one that is.

FAQ

Fair questions, straight answers.

Is Graphorin production-ready?

Graphorin is pre-1.0 software under active development. The architecture and the eighteen design principles are stable; public APIs can still shift between minor releases, and every breaking change ships with notes in the changelog. It is a solid fit today for personal assistants, internal tools, and pilots, and 1.0 is the contract for long-term API stability.

Which models can I use?

Any. A frontier API, any OpenAI-compatible endpoint, Ollama, or an in-process GGUF model through llama.cpp, all behind one provider interface. Switching providers is a one-line change, and local models are first-class, not a fallback.

Does my data ever leave my machine?

The framework itself makes zero implicit network calls: no version pings, no analytics, no crash uploads, and a CI check enforces that rule on every commit. The only traffic is the traffic you configure. Point the provider at a cloud model and your prompts go there; run a local model and nothing leaves at all.

What do I need to get started?

Node.js 22 or newer. No account, no API key, no cloud dashboard: storage is a local SQLite file, embeddings run on your machine, and a local model through Ollama completes a fully offline setup.

How is six-tier memory different from a vector database?

A vector database gives you similarity search. A memory model also decides what to keep, which fact wins in a conflict, and what to forget. Graphorin layers six tiers (working, session, episodic, semantic, procedural, shared), each with its own lifecycle and conflict-resolution strategy, plus hybrid retrieval and a background consolidator on top.

Will it work with my existing tools?

Yes. MCP support is first-class, so any MCP server plugs in directly. Typed tool definitions, cryptographically signed skills, and an optional standalone server with REST, WebSocket, and SSE cover the rest.

Build the assistant you've been wanting to build.

Open source. MIT licensed. Local-first. No account, no API key to start. The engine is ready when you are.

MIT License · © 2026 Oleksiy Stepurenko