Documentation // V1.2.0
Introduction
Memori-JS is an active memory layer for your AI agents. It bridges the gap between transient context windows and persistent storage.
Philosophy
Memory should be invisible. You shouldn't manage vector stores manually. Memori abstracts the complexity of RAG into a simple middleware.
Quick Start
Install the package via your preferred package manager.
$
npm install memori-jsBasic Usage
Initialize Memori and register your LLM client. It works by intercepting calls to inject relevant context.
typescript
1import { Memori } from "memori-js";2import OpenAI from "openai";34// 1. Initialize Memori5const memori = new Memori({6 googleApiKey: process.env.GOOGLE_API_KEY, // Used for embeddings7});89// 2. Register your client10const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });11memori.llm.register(client);1213// 3. Chat as normal - memory is handled automatically14const response = await client.chat.completions.create({15 model: "gpt-4",16 messages: [{ role: "user", content: "My name is Alice." }],17});