The TypeScript SDK for agents with self‑improving memory.
The TypeScript SDK for agents with self‑improving memory.
A temporal knowledge graph that learns across sessions — plus durable runs, enforced cost ceilings, and evals in CI. The production fundamentals, built in, not bolted on.
$npm install eidentic
55.2% vs 41.0%memory wins LongMemEval
up to 39×fewer tokens / query
Node · Bun · Deno · Edgeruntimes
eidentic@eidentic/nextjs@eidentic/react@eidentic/libsql@eidentic/server
agent.tsQuickstart
import { Agent, AIModel, SqliteStore } from "eidentic";
import { anthropic } from "@ai-sdk/anthropic";const agent = new Agent({
id: "support",
instructions: "You are a support agent. Remember the user.",
model: new AIModel(anthropic("claude-sonnet-4-5")),
store: new SqliteStore("./eidentic.sqlite"),
});
// Recalls past sessions inside query(), with citations.
for await (const ev of agent.query("What did we decide last week?", {
sessionId: "u-42",
})) {
if (ev.type === "stream.delta") process.stdout.write(ev.delta.text);
}
import { withEidentic } from "@eidentic/nextjs";
import { agent } from "@/lib/agent";// Streams agent.query() over HTTP. Sessions, memory recall,
// and per-turn cost tracking are handled for you.
export const POST = withEidentic(agent);
"use client";
import { useEidenticStream } from "@eidentic/react";export function Chat() {
const { messages, send, status } =
useEidenticStream("/api/chat");
return (
<Thread
messages={messages}
busy={status === "streaming"}
onSend={send}
/>
);
}
import { Agent, AIModel } from "eidentic";
import { LibsqlStore } from "@eidentic/libsql";
import { openai } from "@ai-sdk/openai";// Pure-JS store, no native addon — ideal for serverless and the edge.
const agent = new Agent({
id: "support",
model: new AIModel(openai("gpt-4o-mini")),
store: new LibsqlStore({
url: process.env.LIBSQL_URL!,
authToken: process.env.LIBSQL_TOKEN,
}),
});
import { createServer, serveNode } from "@eidentic/server";
import { agent } from "./agent.js";const server = createServer({
agents: { support: agent },
});
// POST /v1/agents/support/query → streams the agent
await serveNode(server, { port: 3000 });
real packages, real APIs — pick a tab
Bring your own model, store, and vector backend
- OpenAI·
- Anthropic·
- Google·
- Mistral·
- SQLite·
- libSQL·
- Turso·
- Postgres·
- pgvector·
- Qdrant·
- LanceDB·
- Pinecone·
- MCP·
- A2A·
- Next.js·
- React·
- Node·
- Bun·
- Deno·
- OpenAI·
- Anthropic·
- Google·
- Mistral·
- SQLite·
- libSQL·
- Turso·
- Postgres·
- pgvector·
- Qdrant·
- LanceDB·
- Pinecone·
- MCP·
- A2A·
- Next.js·
- React·
- Node·
- Bun·
- Deno·
- `plan: team`corroborated ×2session u-91 · 2d ago
- `plan: starter`supersededsession u-12 · Mar 4
- `timezone: Europe/Berlin`stableprofile
- ✓memory-recall.eval96%
- ✓tool-routing.eval94%
- ✓cost-ceiling.eval100%
- SS · user
- SS · assistant
- SS · preference
- Multi-session
- Temporal
- Knowledge update
- Overall
// the signature
Memory that improves itself.
Not just vector recall bolted onto a prompt. A four-tier engine where facts have a lifetime, contradictions resolve, and the agent gets sharper the longer you run it.
Temporal knowledge graphFacts carry validity over time. New information invalidates the old instead of overwriting it, so the agent reasons about what was true when.
Self-editing & extractionMemory blocks the agent rewrites itself, plus passive extraction from every turn. You don't write ingestion code.
Sleep-time consolidationBetween sessions it consolidates what it learned, so it knows more next time without growing the prompt.
memory · recall
session u-91
MV
Bump us to the team plan, and schedule it for my usual timezone.
recalled 3 facts
Switching you to team — you were on starter until last week — and scheduling in Europe/Berlin.
facts carry validity — superseded ones are kept, not overwritten
55.2%LongMemEval overall
vs 41.0% full-context
39×fewer tokens / query
retrieval, not stuffing
32packages, one install
umbrella + adapters
1,510tests green in CI
Node · Bun · Deno
Most frameworks lead one lane.
We ship the whole thing in one composable package, native to TypeScript, fully open.
01One open package, not three products
Memory, orchestration, and DX usually ship as separate tools with the production pieces behind an enterprise tier. Eidentic is all of it, Apache-2.0, with no paid tier.
02Native to TypeScript
No Python sidecar, no FFI. First-class types end to end, React hooks, a Next.js handler, and a CLI — the stack you already deploy.
03Composable by construction
Ports and adapters everywhere: swap the store, vector backend, embedder, or model without touching agent code. MCP with OAuth and A2A for interop.
Everything else in the box.
The production machinery usually sold as an enterprise add-on, here in the same open package as the memory engine.
no enterprise tier
All of it. In one open package.
The umbrella install is the common case; optional adapters are separate, so you only ship what you import.
Durable execution
Checkpoint and resume with exactly-once tool dispatch. Suspend for a human, resume hours later on another machine.
Run checkpointing, suspending, and resumingsuspendresume
Cost ceilings, enforced
Set a dollar limit and the loop actually stops there. Per-turn token and cost visibility as it streams.
Spend filling to an enforced capcap$0.74 / $1.00
Security & isolation
Deny-by-default permissions, sandboxed code execution, secrets the model never sees, one-call GDPR erasure.
Multi-agent & interop
spawn\_agent delegation with a shared budget. MCP host and server with OAuth, plus A2A.
Signed skills
SKILL.md prompt skills and test-gated executable skills, ed25519-signed before they ever run.
Evaluated, not vibes
A built-in eval harness with a CI pass-rate gate, one-call promotion of a production trace into a regression test, and the Studio dashboard for sessions, memory, and traces.
eval suite · CI✓all gates cleared
gate 90% · promote any prod trace → regression test
Benchmarks, including the ones we lose.
Two public long-term-memory benchmarks, first official runs in June 2026, at opposite ends of the history-size spectrum. The larger the history, the more memory wins; on small ones, full context stays competitive. We show both, full runs, no sampling.
+14.2 pts
overall on LongMemEval. Across \~115k-token histories, memory beats full context on every one of the six question types.
up to 39×
fewer tokens per query: 2,550 vs 99,435 on LongMemEval, 893 vs 19,030 on LoCoMo. Retrieval is the cost story.
\-7.8 pts
behind full context on LoCoMo's small haystack, where brute-force recall still wins. We publish the gap, not just the wins.
LongMemEvalLoCoMo
500 questions, \~50 sessions, \~115k-token haystacks
Eidentic memoryFull-context baseline
84.3
67.1
92.9
73.2
26.7
3.3
42.1
27.8
34.6
20.3
70.5
66.7
55.2
41.0
| LongMemEval answer accuracy by question category, Eidentic memory versus full-context baseline| Mode | SS·user | SS·asst | SS·pref | Multi-session | Temporal | Knowledge | Overall | Tokens / query | | ----------------------------------------------------------------------------------------------------- | ------- | ------- | ------- | ------------- | -------- | --------- | ------- | -------------- | | Full-context baseline | 67.1% | 73.2% | 3.3% | 27.8% | 20.3% | 66.7% | 41.0% | 99,435 | | Eidentic memory | 84.3% | 92.9% | 26.7% | 42.1% | 34.6% | 70.5% | 55.2% | 2,550 |
Memory wins all six question types, +14.2 points overall (55.2% vs 41.0%), at 2,550 vs 99,435 tokens per query. When \~115k tokens of history are stuffed into the window, the evidence drowns among \~50 sessions of distractors; targeted retrieval surfaces it.
gpt-4o-mini answer + judge, text-embedding-3-small, topK 10, seed 42, full 500-question longmemeval\_s split, dataset xiaowu0162/longmemeval @ 2ec2a557.
Swap any adapter. The agent never notices.
Prototype on SQLite, deploy on Postgres or Turso: the only line that changes is the store.
StoresSQLitelibSQL / TursoPostgres
VectorpgvectorQdrantLanceDBPinecone
RuntimesNodeBunDenoEdge
InteropMCP (OAuth)A2AReactNext.js
You only bundle the adapters you import. A Postgres deployment never ships SQLite; an edge function never ships native addons.
SQLitelibSQL / TursoPostgres
import { Agent, SqliteStore } from "eidentic";const agent = new Agent({
id: "support",
model,
store: new SqliteStore("./eidentic.sqlite"),
});
Give your agent a memory.
Apache-2.0, pre-1.0 and stabilizing toward v1. We would rather over-disclose gaps than oversell.
$npm install eidentic
