Store

The Store operation persists information to the Ensue Memory Network. Memories can be optionally embedded for semantic retrieval using vector embeddings.

Creating Memories

Store new information with the create_memory command:

ensue create_memory --items '[{
  "key_name": "project/status",
  "description": "Current project status and phase",
  "value": "Phase 1 complete: API design finalized",
  "embed": true,
  "embed_source": "description"
}]'

The --items option takes a JSON array of memory objects (1-100 items per batch).

Memory object fields:

Field Required Description
key_name Yes Unique identifier for the memory
description Yes Human-readable description (used for search)
value Yes The data to store (plain text by default)
embed No Enable vector embeddings for semantic search (default: false)
embed_source No Field to embed: "description" or "value" (default: "description")
base64 No Set to true if value is base64 encoded (default: false)

Namespaces

Keys use forward slashes to create namespaces—a hierarchical structure for organizing memories:

# User namespace
user/coding_style
user/preferences

# Project namespace
project/myapp/current_sprint
project/myapp/architecture

# Team namespace
team/guidelines/code_review
team/decisions/database

# Temporal namespace
sessions/2024-01-15/task
lessons/bug_fixes/auth_issue

See Core Concepts: Namespaces for filtering and access control.

To enable semantic search on a memory, set embed: true in the item:

ensue create_memory --items '[{
  "key_name": "project/semantic",
  "description": "Project status with semantic search enabled",
  "value": "Phase 2 in progress: Backend implementation started",
  "embed": true
}]'

Choose embed_source based on your use case:

  • description (default) - Faster, good for most cases when description captures the essence
  • value - Use when the value itself contains the searchable content

Updating Memories

Modify an existing memory's value:

ensue update_memory --key-name "project/status" --value "Updated project status: Phase 2 complete"

You can also regenerate embeddings when updating:

ensue update_memory --key-name "project/status" --value "New value" --embed true

Note: Updating a memory preserves permissions and subscriptions. The description cannot be changed via update.

Deleting Memories

Remove memories permanently (supports batching 1-100 keys):

ensue delete_memory --key-names '["project/old-status"]'

Delete multiple at once:

ensue delete_memory --key-names '["temp/task1", "temp/task2", "temp/task3"]'

Warning: This operation is irreversible.

Listing Memories

Browse all available memories with metadata:

ensue list_keys --limit 100 --offset 0
ensue delete_memory --key-names '["project/status", "project/semantic"]'

Returns for each memory:

  • Key name
  • Description
  • Size (in bytes)
  • Created/updated timestamps

Next Steps