Skip to content

Quickstart

beginner

Store and retrieve your first memory in under 5 minutes. Get your API key, install the SDK, and start building.

Prerequisites

Step 1: Get your API key

  1. Sign in to app.engramma-memory.com
  2. Navigate to Settings → API Keys
  3. Click Create New Key
  4. Copy your key (starts with nx_live_ for production or nx_test_ for sandbox)
Warning

Never expose your API key in client-side code or commit it to version control. Use environment variables.

Step 2: Install the SDK

pip install engramma-cloud

Set your API key as an environment variable:

export ENGRAMMA_API_KEY="nx_live_your_key_here"

Step 3: Store your first memory

from engramma_cloud import EngrammaClient
import os

client = EngrammaClient(api_key=os.environ["ENGRAMMA_API_KEY"])

# Store a memory
result = client.store("Paris is the capital of France")
print(f"Stored: {result.id}")
print(f"Importance: {result.importance}")

Expected response:

{
  "success": true,
  "pattern_id": "pat_a7f2c1e9",
  "embedding_dim": 256,
  "patterns_used": 1,
  "patterns_limit": 5000
}

Step 4: Retrieve memories

# Retrieve relevant memories
results = client.retrieve("What is the capital of France?")

for memory in results:
    print(f"Text: {memory.text}")
    print(f"Confidence: {memory.confidence}")
    print(f"Pathway: {memory.pathway}")
    print("---")

Expected response:

{
  "results": [
    {
      "text": "Paris is the capital of France",
      "similarity": 0.94,
      "pattern_id": "pat_a7f2c1e9",
      "metadata": null
    }
  ],
  "latency_ms": 2.3
}

Step 5: Explain a result

One of Engramma's unique features is explainability — understanding why a memory was returned.

# Get an explanation
explanation = client.explain(
    query="What is the capital of France?",
    level="detailed"  # simple | detailed | technical
)

print(explanation.summary)
print(explanation.pathway_scores)
print(explanation.reasoning_chain)

Expected explanation response:

{
  "summary": "High-confidence match via exact pathway (0.94). The stored fact directly answers the query.",
  "pathway_scores": {
    "exact": 0.94,
    "energy": 0.61,
    "attention": 0.73
  },
  "reasoning_chain": [
    "Query encoded to 256-dim embedding",
    "Exact pathway: cosine similarity 0.94 (above threshold 0.7)",
    "Energy pathway: free-energy score 0.61 (below exact, not selected)",
    "Result: routed via exact pathway with high confidence"
  ]
}

What you just did

In under 5 minutes, you:

  1. Stored a piece of knowledge into Engramma's cognitive memory
  2. Retrieved it using a natural-language query (not an exact-match lookup)
  3. Explained why the engine chose that result and which pathway it used

This is the foundation of everything you'll build with Engramma — from chatbots with persistent memory to knowledge bases that reason about their contents.

What's next?

Tip

Try the Playground to experiment with the API interactively — no code required.