@yarlisai/memory
v0.1.0
Published
AI memory layer with pluggable backends — in-memory, Firestore, SQLite. Part of the Yarlis AI ecosystem.
Readme
@yarlisai/memory
AI memory layer with pluggable backends for the Yarlis AI ecosystem. Store, query, and inject contextual memories into AI conversations.
Install
npm install @yarlisai/memory @yarlisai/contractsQuick Start
import { YarlisMemory, InMemoryStore } from "@yarlisai/memory";
import { createYPID } from "@yarlisai/contracts";
const memory = new YarlisMemory(new InMemoryStore());
const userId = createYPID("rtm", "user");
// Store a memory
await memory.remember(userId, "User prefers dark mode", {
scope: "user",
type: "semantic",
domain: "rtm",
});
// Recall memories
const memories = await memory.recall(userId, { scope: "user" });
// Inject memories into a conversation
const messages = [{ role: "user" as const, content: "What are my preferences?" }];
const enriched = await memory.injectContext(userId, messages);Adapters
- InMemoryStore — In-memory store for development and testing
- FirestoreMemoryStore — Google Firestore backend for production Firebase projects
- SQLiteMemoryStore — Local persistent SQLite backend
License
MIT
