Skip to content

Quickstart

Get started with Engram in under 5 minutes

Quickstart

Store and recall your first memory in under 5 minutes.

Base URL: https://api.engrammemory.ai/v1 Auth: Authorization: Bearer pr_live_xxxxx


Step 1: Get an API Key

Request a key by sending your email and a project name:

curl -X POST https://api.engrammemory.ai/v1/keys \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "name": "my-project"
  }'

Response:

{
  "api_key": "pr_live_abc123...",
  "project": "my-project"
}

Save this key. You will need it for every request.

Step 2: Install an SDK

Python

pip install engrammemory-ai

JavaScript

npm install engrammemory-ai

Step 3: Store a Memory

Python

from engrammemory import Engram

client = Engram(api_key="pr_live_xxxxx")

result = client.store(
    text="The user prefers dark mode and uses vim keybindings.",
    collection="user-123"
)

print(result.id)          # Memory ID
print(result.category)    # "preference" (auto-classified)

JavaScript

import { Engram } from 'engrammemory-ai';

const client = new Engram({ apiKey: 'pr_live_xxxxx' });

const result = await client.store(
  'The user prefers dark mode and uses vim keybindings.',
  { collection: 'user-123' }
);

console.log(result.id);        // Memory ID
console.log(result.category);  // "preference" (auto-classified)

cURL

curl -X POST https://api.engrammemory.ai/v1/store \
  -H "Authorization: Bearer pr_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The user prefers dark mode and uses vim keybindings.",
    "collection": "user-123"
  }'

Step 4: Search Memories

Python

results = client.search(
    query="What are the user's editor preferences?",
    collection="user-123",
    limit=5
)

for memory in results.memories:
    print(f"[{memory.score:.3f}] {memory.content}")

JavaScript

const results = await client.search("What are the user's editor preferences?", {
  collection: 'user-123',
  limit: 5
});

for (const memory of results.memories) {
  console.log(`[${memory.score.toFixed(3)}] ${memory.content}`);
}

cURL

curl -X POST https://api.engrammemory.ai/v1/search \
  -H "Authorization: Bearer pr_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are the user'\''s editor preferences?",
    "collection": "user-123",
    "limit": 5
  }'

Step 5: Use the Intelligence Endpoint

The /v1/intelligence endpoint runs the full pipeline in one call: embed, classify, deduplicate, and compress.

Python

intel = client.intelligence(
    text="The user decided to switch from VS Code to Neovim on 2026-03-15.",
    check_dedup=True,
    compress=True
)

print(intel.category)       # "decision"
print(intel.is_duplicate)   # False
print(intel.compressed)     # True (compression applied)
print(intel.memory_id)      # Stored memory ID

JavaScript

const intel = await client.intelligence(
  'The user decided to switch from VS Code to Neovim on 2026-03-15.',
  { checkDedup: true, compress: true }
);

console.log(intel.category);      // "decision"
console.log(intel.isDuplicate);   // false
console.log(intel.compressed);    // true (compression applied)
console.log(intel.memoryId);      // Stored memory ID

cURL

curl -X POST https://api.engrammemory.ai/v1/intelligence \
  -H "Authorization: Bearer pr_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The user decided to switch from VS Code to Neovim on 2026-03-15.",
    "check_dedup": true,
    "compress": true
  }'

Response:

{
  "memory_id": "mem_8f3a...",
  "category": "decision",
  "is_duplicate": false,
  "compressed": true,
  "compression_ratio": 6.2,
  "cosine_preserved": 0.9947
}

Next Steps