@klarlabs-studio/mnemos
v0.1.0
Published
Optional TypeScript client for Mnemos — the self-hosted AI memory layer
Maintainers
Readme
@klarlabs-studio/mnemos
Optional TypeScript wrapper around the Mnemos HTTP API.
npm install @klarlabs-studio/mnemosimport { Mnemos } from "@klarlabs-studio/mnemos";
const m = new Mnemos({ baseUrl: "http://localhost:7777" });
const run = m.startRun("chat-session-1");
await run.remember("user prefers vegetarian options", { role: "preference" });
await run.remember("user is allergic to peanuts", { role: "preference" });
for (const memory of await run.recall()) {
console.log(memory.timestamp, memory.content);
}
// Hybrid retrieval
const hits = await m.search("dietary restrictions", { topK: 5, minTrust: 0.5 });
// Context Block — drop into your agent's system prompt
const block = await m.context(run.runId);Three classes (Mnemos, Run, Memory), ~250 LOC, zero opinion.
When to use this
When you want native TS ergonomics. The wrapper shaves boilerplate
off fetch(...) and adds typed return values. Bring-your-own fetch
via the fetch constructor option (defaults to global fetch).
When NOT to use this
When you want full control over the wire format, or you're calling
Mnemos from a non-Node runtime that doesn't ship fetch. The HTTP
API is the source of truth; @klarlabs-studio/mnemos is a convenience.
Where to look next
- Mnemos itself (the server): https://github.com/klarlabs-studio/mnemos
- Python wrapper: https://github.com/klarlabs-studio/mnemos-py
- Quickstart chatbot: https://github.com/klarlabs-studio/mnemos/tree/main/examples/quickstart_chatbot
- Refund-triage agent: https://github.com/klarlabs-studio/mnemos/tree/main/examples/refund_triage_langgraph
Scope
This package wraps the simple-case API:
appendEvent(runId, content, metadata)→ POST/v1/eventslistEvents(runId)→ GET/v1/events?run_id=...search(query, opts)→ GET/v1/searchcontext(runId, opts)→ GET/v1/contexthealth()→ GET/health
For claim writes, contradiction detection, relationship queries, point-in-time replay, and the rest of Mnemos's surface, call the HTTP API directly. The wrapper grows when there's demand.
License
MIT.
