EngramEngramdocs
v0.1.0
Search docs…⌘K
GitHub
Integrations

REST Clients

Any HTTP client can talk to Engram. Below are examples for the most common languages and frameworks.

For full endpoint documentation, see the REST API Reference.

Engram CLI

The fastest way to interact with Engram from the terminal. No server required — talks directly to the database.

# Install globally
npm i -g @engram-ai-memory/cli

# Store a memory
engram store "User prefers TypeScript" --type semantic --importance 0.8

# Search
engram search "TypeScript" --top 5

# Recall context (ready for LLM injection)
engram recall "what languages does the user prefer?" --raw

# Stats
engram stats

# Export/import
engram export > backup.json
engram import < backup.json

# Forget a memory
engram forget a1b2c3d4-...

# Set custom DB path
ENGRAM_DB_PATH=/data/engram.db engram stats

cURL

# Store a memory
curl -s -X POST http://localhost:4901/api/memory \
  -H "Content-Type: application/json" \
  -d '{"content":"cURL works great","type":"episodic","importance":0.5}'

# Recall
curl -s -X POST http://localhost:4901/api/recall \
  -H "Content-Type: application/json" \
  -d '{"query":"how do I use cURL?","maxTokens":2000}' | jq .

TypeScript / Node.js

const BASE = 'http://localhost:4901'

// Store
await fetch(`${BASE}/api/memory`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    content: 'TypeScript client connected',
    type: 'semantic',
    importance: 0.7,
  }),
})

// Recall
const res = await fetch(`${BASE}/api/recall`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'TypeScript setup', maxTokens: 2000 }),
})
const { context, memories } = await res.json()

Python

import httpx

BASE = "http://localhost:4901"
client = httpx.Client(base_url=BASE)

# Store
client.post("/api/memory", json={
    "content": "Python client connected",
    "type": "semantic",
    "importance": 0.75,
})

# Recall
result = client.post("/api/recall", json={
    "query": "Python integration",
    "maxTokens": 2000,
})
for m in result.json()["memories"]:
    print(m["content"])

Go

resp, err := http.Post(
    "http://localhost:4901/api/recall",
    "application/json",
    strings.NewReader(`{"query":"Go client","maxTokens":2000}`),
)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
REST Clients — Engram Docs