-
Notifications
You must be signed in to change notification settings - Fork 2
Python Integration
Sven Andreas edited this page Apr 9, 2026
·
1 revision
Engram integrates with Python through plain HTTP. No SDK required.
For the full guide with 17 sections and working code examples, see docs/python-examples.md.
import requests
ENGRAM = "http://127.0.0.1:3030"
# Setup auth (first run)
requests.post(f"{ENGRAM}/auth/setup", json={
"username": "admin", "password": "your-password"
})
# Login
token = requests.post(f"{ENGRAM}/auth/login", json={
"username": "admin", "password": "your-password"
}).json()["token"]
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
# Store
requests.post(f"{ENGRAM}/store", headers=headers, json={
"entity": "Berlin", "type": "city"
})
# Relate
requests.post(f"{ENGRAM}/relate", headers=headers, json={
"from": "Berlin", "relationship": "capital_of", "to": "Germany"
})
# Query
result = requests.post(f"{ENGRAM}/query", headers=headers, json={
"start": "Berlin", "depth": 2
}).json()- Server startup and health checks
- EngramClient wrapper class
- Storing nodes with types, properties, confidence
- Relationships between entities
- Graph traversal queries
- BM25 search with boolean filters
- Natural language /ask and /tell
- Learning -- reinforce, correct, decay, derive
- Bulk import from CSV and JSON
- LangChain tool integration
- CLI wrapper via subprocess
- Error handling and retries
- Authentication and API keys
- Debate sessions -- launch and synthesize
- Assessments -- Bayesian evidence
- Document ingestion -- PDF, text, fact review
- Chat tools -- compare, what-if, network analysis