https://memflux.org/v1
All endpoints require an API key via the X-API-Key header (except auth endpoints).
/v1/auth/register
Register a new account. Returns user, session token, and first API key.
{ "email": "user@example.com", "password": "pass123", "name": "John" }
/v1/auth/login
Login with email and password. Returns session token.
{ "email": "user@example.com", "password": "pass123" }
/v1/graph/add
Add text to the knowledge graph. LLM-less extraction — returns nodes, relations, keywords, and entities found.
{
"text": "FastAPI is a modern Python web framework...",
"source": "optional-source-id",
"metadata": {}
}
{
"nodes_added": 16,
"relations_added": 48,
"keywords_extracted": ["fastapi", "python", "framework", ...],
"processing_time_ms": 50
}
/v1/graph/query
Query the graph for relevant nodes and relations.
{ "query": "What is FastAPI?", "limit": 10, "min_score": 0.5 }
/v1/graph/stats
Get graph statistics (node count, relation count, types, tags).
/v1/graph/nodes/{node_id}
Delete a node and its relations.
/v1/graph/relations/{relation_id}
Delete a relation.
/v1/context/generate
Generate compressed, relevant context from the graph. This is the core innovation — instead of sending thousands of entries to an LLM, you get only the most relevant, compressed context.
{
"query": "How does FastAPI handle authentication?",
"max_tokens": 2000,
"max_nodes": 50,
"include_relations": true,
"format": "structured"
}
{
"context": "Context for query: ...",
"nodes_used": 10,
"relations_used": 20,
"total_candidates": 16,
"compression_ratio": 0.625,
"processing_time_ms": 3,
"estimated_tokens": 450
}
Format options: structured (default), text, json
/v1/keys/create — Create new key
/v1/keys/list — List your keys
/v1/keys/{key_id} — Revoke a key
/v1/keys/{key_id}/openrouter — Set OpenRouter API key (encrypted)
All API endpoints (except /auth/*) require the X-API-Key header:
X-API-Key: gc_sk_xxxxxxxxxxxxxxxxxxxxxxxxx
| Tier | Requests/Min |
|---|---|
| Free | 60 |
| Pro | 300 |
| Ultimate | 1000 |
# Add data to your graph
curl -X POST https://memflux.org/v1/graph/add \
-H "Content-Type: application/json" \
-H "X-API-Key: gc_sk_your_key_here" \
-d '{"text": "Your knowledge text here..."}'
# Generate context
curl -X POST https://memflux.org/v1/context/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: gc_sk_your_key_here" \
-d '{"query": "What do you know about X?"}'