Docs/AI SDK

Memory

Store & Search

Last updated March 3, 2026

Core memory operations for storing and retrieving content.

Store and search are the core operations for working with AI Memory.

Store

Store content with automatic embedding generation:

Codetext
await cencori.memory.store({
  namespace: 'docs',
  content: 'Refund policy allows returns within 30 days',
  metadata: { category: 'policy' }
});

Parameters

ParameterTypeRequiredDescription
namespacestringYesStorage namespace
contentstringYesText content
metadataobjectNoCustom metadata
idstringNoCustom ID (auto-generated if omitted)

Batch Store

Codetext
await cencori.memory.storeBatch({
  namespace: 'docs',
  items: [
    { content: 'Policy 1...', metadata: { type: 'policy' } },
    { content: 'Policy 2...', metadata: { type: 'policy' } },
    { content: 'FAQ 1...', metadata: { type: 'faq' } }
  ]
});

Find relevant content using natural language:

Codetext
const results = await cencori.memory.search({
  namespace: 'docs',
  query: 'what is the refund policy?',
  limit: 5
});
 
// Returns:
// [
//   { id: '...', content: 'Refund policy...', score: 0.95, metadata: {...} },
//   { id: '...', content: 'Returns are...', score: 0.82, metadata: {...} }
// ]

Parameters

ParameterTypeRequiredDescription
namespacestringYesSearch namespace
querystringYesSearch query
limitnumberNoMax results (default: 10)
filterobjectNoMetadata filter
thresholdnumberNoMinimum score (0-1)

Metadata Filtering

Codetext
const results = await cencori.memory.search({
  namespace: 'docs',
  query: 'refund policy',
  filter: {
    category: 'policy',
    version: '2024'
  }
});

Update

Codetext
await cencori.memory.update({
  namespace: 'docs',
  id: 'memory-id',
  content: 'Updated content...',
  metadata: { updated: true }
});

Delete

Codetext
// Delete by ID
await cencori.memory.delete({
  namespace: 'docs',
  id: 'memory-id'
});
 
// Delete by filter
await cencori.memory.deleteByFilter({
  namespace: 'docs',
  filter: { category: 'deprecated' }
});