recallic
v0.3.4
Published
TypeScript client for Recallic, an LLM-free memory layer for AI agents
Readme
recallic (TypeScript)
Website: recallic.com
Client for Recallic: an LLM-free memory layer for AI agents. Recallic runs on your own machine, needs no LLM calls, and declines instead of guessing.
npm install recallicYou need a running Recallic server. The quickest way is
docker compose up -d in the repository; see the quickstart there.
import { Memory } from "recallic";
const mem = new Memory({ apiKey: process.env.RECALLIC_API_KEY! }); // baseUrl defaults to http://localhost:8000
await mem.store("I moved to Pune last month for a job at Infosys.");
const out = await mem.recall("Where do I live?");
console.log(out.status, out.memories.map((m) => m.content));
await mem.used(out); // one line of feedback: Recallic learns from it on its ownHow readily recall answers is one option (server 0.2.5 or newer; default "balanced"):
await mem.recall("Which came first, the Goa trip or the Pune workshop?", { mode: "helpful" }); // fewer refusals, computed_answer
await mem.recall("What dose did the doctor prescribe?", { mode: "cautious" }); // stricter: declines more
await mem.recall("What dose did the doctor prescribe?", { mode: "cautious_lite" }); // cautious, with a second try before decliningStoring a whole conversation at once (server 0.2.6 or newer; an older server gets one store per message):
await mem.storeMany(["I moved to Pune in March.", { content: "Mira got married.", timestamp: 1717200000 }]);Correcting a memory keeps when it was said; the memory gets a new id (server 0.2.7 or newer):
await mem.update(memoryId, "I moved to Mumbai in March.");With an LLM: context() gives the recalled memories as prompt text, and answer() combines your LLM with
Recallic's own checked answer (your LLM first; Recallic's answer when the LLM says it does not know):
const text = await mem.context("Where do I live?");
const res = await mem.answer("Where do I live?", (system, user) => myLlm(system, user));
console.log(res.answer, res.source); // "llm" | "recallic" | "none"On questions about facts that change over time (a held-out test of 71 questions, gpt-4o-mini), answer() got 61 right
and 2 wrong; Mem0 with the same model 51 / 0, Zep's Graphiti 50 / 3.
Changes
- 0.3.3:
context()andanswer()(above), plusformatContext()andcombine()for your own prompts. - 0.3.0: renamed from
recallixtorecallic:npm install recallic,import { Memory } from "recallic". Nothing else changed. - 0.2.7:
update(memoryId, content)corrects a memory (PUT /memory/{id}). - 0.2.6:
storeMany(items)stores many messages in one request per 100 (POST /memory/store_batch);store(content, { timestamp })keeps when a message was originally said. - 0.2.5:
recall(query, { mode: "cautious" | "balanced" | "helpful" }). (Version aligned with the Python SDK.)
Node 18+ (uses the built-in fetch). License: Apache-2.0.
