What's cencori memory? and why should i care ?

Cencori Memory gives any AI model persistent memory for your users' preferences, decisions, and project context. It's designed to survive new chats, different devices, and even switching AI providers.

You should care about it because it allows you to build truly stateful AI applications without having to manage complex vector databases or custom context management logic.

Here's why it's critical:

  1. Persistence Across Sessions: A new chat doesn't mean a memory reset. Your AI can remember user details across different conversations and devices.
  2. Flexibility: You can use it in two ways:
    • Native Integration: Simply pass a memory field in your cencori.ai.chat() requests, and the gateway handles retrieval and writeback automatically.
    • Standalone: Use cencori.memory.recall() and cencori.memory.remember() directly with any model (OpenAI, Anthropic, local LLMs) without routing inference through Cencori.
  3. Scoped Memory: Memories can be scoped to a session (ephemeral), user (default, persists across sessions), workspace (team memory), or org (company-wide knowledge).
  4. Built-in Security & Governance: It includes PII redaction before writeback, strict organization-level isolation, audit logging, and explicit "forget" functionality for compliance.
  5. Cost Efficiency: Reads are never blocked, and writes are metered, with clear upgrade paths if you hit limits.
  6. Advanced Capabilities: Features like temporal recall (asking what was true at a past instant) and an entity graph (understanding relationships between facts) enhance the AI's intelligence.

Here's a quick example of how to use it with any model:

typescript
// 1. Initialize Cencori
const cencori = new Cencori({ apiKey: process.env.CENCORI_API_KEY });

// 2. Recall what you know about this user
const context = await cencori.memory.recall(userId, userMessage);

// 3. Your existing model call (e.g., OpenAI, Anthropic, etc.)
// Inject the 'context' as a system message if it's not empty
const completion = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages: [
    ...(context ? [{ role: 'system', content: context }] : []),
    { role: 'user', content: userMessage },
  ],
});
const reply = completion.choices[0].message.content;

// 4. Remember new facts from the exchange
await cencori.memory.remember(userId, { user: userMessage, assistant: reply });

This allows you to give your AI applications a powerful, persistent, and secure memory layer without adding significant complexity to your stack.