Skip to content

Your First Memory

beginner

Store, retrieve, and explain your first memory in under 5 minutes. A complete Hello World for Engramma.

What you'll build

A working script that stores a fact, retrieves it with confidence scoring, and explains why it was returned — in 12 lines of code.

Prerequisites

RequirementDetails
AccountFree tier or above (sign up)
API keyGenerate one in your dashboard
SDKPython (pip install engramma-cloud) or JavaScript (npm install @engramma/sdk)
Time~5 minutes

Steps

1

Install the SDK

Choose your language and install the client library.
2

Set your API key

Export your key as an environment variable so the SDK can find it.
3

Store a memory

Save a fact to your memory space. The engine encodes, routes, and indexes it automatically.
4

Retrieve it

Ask a natural-language question. The engine finds the best match across all three pathways.
5

Explain the result

Ask why that result was returned. Get a human-readable explanation with confidence breakdown.

Complete code

import os
from engramma_cloud import EngrammaClient

# Initialize with your API key
client = EngrammaClient(api_key=os.environ["ENGRAMMA_API_KEY"])

# Step 1: Store a memory
result = client.store("The deployment window is Tuesday 2-4pm UTC")
print(f"Stored! Pattern ID: {result.pattern_id}")

# Step 2: Retrieve it with a natural question
results = client.retrieve("When can we deploy?")
print(f"Answer: {results[0].text}")
print(f"Confidence: {results[0].confidence}")
print(f"Pathway: {results[0].pathway}")

# Step 3: Explain why this result was returned
explanation = client.explain(query="When can we deploy?", level="detailed")
print(f"Reasoning: {explanation.summary}")
print(f"Pathway scores: {explanation.pathway_scores}")

Expected output

Stored! Pattern ID: pat_7f3a2b
Answer: The deployment window is Tuesday 2-4pm UTC
Confidence: 0.93
Pathway: exact
Reasoning: High-confidence exact match. The query 'deploy' directly maps to a stored fact about deployment windows.
Pathway scores: {'exact': 0.93, 'energy': 0.61, 'attention': 0.48}

What just happened

  1. Store — The engine ran the 10-phase cognitive cycle: it encoded your text, assessed importance, and indexed it across all three retrieval pathways.

  2. Retrieve — Your question was encoded and routed through the Confidence Router. The Exact pathway won because the query closely matched the stored text.

  3. Explain — The engine showed you exactly which pathway scored highest and why that result was selected.

Tip

Try storing 3-4 related facts and then asking a question that requires connecting them. You'll see the Attention pathway activate for multi-hop reasoning.

Next steps