WOLBΛRG

Example — Conversation memory

Chat transcript → rememberFromMessages → recall without hand-rolled extraction.

What is it?

Side-by-side style demo vs “chat → facts → retrieve” libraries: pass messages into Wolbarg, then recall.

Uses experimental rememberFromMessages(). Default mode: "raw" needs no LLM.

Example usage

import { wolbarg, sqlite, openaiEmbedding } from "wolbarg";

const ctx = wolbarg({
  organization: "demo",
  storage: sqlite("./memory.db"),
  embedding: openaiEmbedding({
    apiKey: process.env.OPENAI_API_KEY!,
    model: "text-embedding-3-small",
  }),
});

const messages = [
  { role: "user", content: "I prefer dark mode in the IDE." },
  { role: "assistant", content: "I'll remember that." },
  { role: "user", content: "Also, only deploy on Fridays." },
];

// Store the last user turn (default)
await ctx.rememberFromMessages(messages, {
  agent: "assistant",
  mode: "raw",
});

// Or store every user turn:
await ctx.rememberFromMessages(messages, {
  agent: "assistant",
  mode: "raw",
  rawStrategy: "all_user",
});

const hits = await ctx.recall({
  query: "When can we deploy?",
  topK: 3,
  filter: { agent: "assistant" },
});

console.log(hits.map((h) => h.content.text));

await ctx.close();

Optional extract mode

Pass llm at construction and mode: "extract" to pull atomic facts with your model. Extraction quality is not a Wolbarg product promise — you own the LLM.