Quickstart
beginnerStore and retrieve your first memory in under 5 minutes. Get your API key, install the SDK, and start building.
Prerequisites
- An Engramma account (sign up free)
- Python 3.8+ or Node.js 18+
- Your API key (from the dashboard)
Step 1: Get your API key
- Sign in to app.engramma-memory.com
- Navigate to Settings → API Keys
- Click Create New Key
- Copy your key (starts with
nx_live_for production ornx_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-cloudSet 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:
- Stored a piece of knowledge into Engramma's cognitive memory
- Retrieved it using a natural-language query (not an exact-match lookup)
- 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?
- How It Works — Understand the 10-phase cognitive cycle
- Building a Chatbot — Add persistent memory to a chatbot
- Memory Types — Learn about Exact, Energy, and Attention pathways
- API Reference — Full endpoint documentation
Tip
Try the Playground to experiment with the API interactively — no code required.