Getting_Started
Installation & Setup
Get up and running with Memori-JS in under a minute. No Docker required.
1. Install Package
Use your preferred package manager to install the core library.
$
npm install memori-js2. Set up Environment
Configure your API keys in your .env file.
bash
1# .env2OPENAI_API_KEY=sk-...3GOOGLE_API_KEY=AIza...4# Optional: Postgres URL if using cloud storage5DATABASE_URL=postgresql://...3. Create your Agent
Initialize Memori and run your first memory-augmented completion.
typescript
1import { Memori } from "memori-js";2import OpenAI from "openai";34async function main() {5 // Initialize Memori (defaults to local SQLite)6 const memori = new Memori();78 // Initialize your LLM client9 const client = new OpenAI();1011 // Register the client to enable memory injection12 memori.llm.register(client);1314 // Calls are now automatically enhanced with context!15 const response = await client.chat.completions.create({16 model: "gpt-4",17 messages: [18 { role: "system", content: "You are a helpful assistant." },19 { role: "user", content: "Remember that I like coding in TypeScript." }20 ]21 });2223 console.log(response.choices[0].message.content);24}2526main();