NOIR
Core concepts

Memory

Add scoped long-term recall without confusing memory, conversation history, and application state.

Conversation history and memory solve different problems. The runtime store keeps recent messages for continuity. A MemoryAdapter retrieves durable facts relevant to the current turn.

Adapter contract

type MemoryAdapter = {
  recall(query, scope, options?): Promise<readonly MemoryFact[]>
  remember?(facts, scope): Promise<void>
  forget?(id, scope): Promise<void>
  health?(): Promise<{ ok: boolean; detail?: string }>
}

The scope contains agentId, installationId, actorId, and conversationId. The adapter decides which dimensions to use.

Automatic behavior

When memory is configured on noir(), Noir recalls relevant facts before each model turn. It also adds memory.recall, memory.remember, and memory.forget when supported. Forgetting requires requester approval because deletion is destructive.

memory: supermemory({
  apiKey: process.env.SUPERMEMORY_API_KEY!,
  scope: 'actor',
  namespace: 'support-agent',
})

Choosing scope

  • Use actor scope for preferences and personal working context.
  • Use conversation scope for a project room whose members share context.
  • Use installation scope for a workspace glossary or company convention.

Do not put secrets, access tokens, or raw private documents in model memory. Store references to authorized application records when the fact should be fetched under current permissions.

Fact quality

A MemoryFact can include source, confidence, creation time, and expiration. Prefer concise facts that remain interpretable out of their original conversation. Derive expiration from the upstream fact when it already has one.

Bad memory: “They said yes.”

Useful memory: “Actor U123 prefers weekly product briefs in percentages and absolute counts; source: Slack message 1712.44.”

Custom adapters

Your adapter owns indexing, embeddings, retention, deletion, tenancy, and encryption. Noir does not require a vendor. Test scope isolation directly: facts stored for one actor or installation must not be recalled for another.

On this page