MemoryGraph Cloud API for programmatic access.
Authentication
All API requests require an API key in the header:
Authorization: Bearer mg_your_api_key_here Base URL
https://api.memorygraph.dev/v1 Endpoints
Store Memory
POST /memories
{
"type": "solution",
"title": "Redis timeout fix",
"content": "Increased connection pool...",
"tags": ["redis", "timeout"],
"importance": 0.8
}
Response:
{
"id": "mem_abc123",
"created_at": "2024-12-04T10:00:00Z",
"type": "solution",
"title": "Redis timeout fix"
} Search Memories
GET /memories/search?query=timeout+solutions&limit=10
Response:
{
"memories": [
{
"id": "mem_abc123",
"type": "solution",
"title": "Redis timeout fix",
"relevance": 0.92
}
],
"total": 1
} Get Memory
GET /memories/:id
Response:
{
"id": "mem_abc123",
"type": "solution",
"title": "Redis timeout fix",
"content": "Increased connection pool...",
"tags": ["redis", "timeout"],
"importance": 0.8,
"created_at": "2024-12-04T10:00:00Z",
"relationships": []
} Create Relationship
POST /relationships
{
"from_memory_id": "mem_abc123",
"to_memory_id": "mem_def456",
"relationship_type": "SOLVES"
}
Response:
{
"id": "rel_xyz789",
"from": "mem_abc123",
"to": "mem_def456",
"type": "SOLVES"
} Get Related Memories
GET /memories/:id/related?types=SOLVES,CAUSES
Response:
{
"memories": [
{
"id": "mem_def456",
"relationship": "SOLVES",
"title": "Connection pool error"
}
]
} Error Responses
{
"error": {
"code": "not_found",
"message": "Memory not found"
}
} | Status | Code | Description |
|---|---|---|
| 400 | bad_request | Invalid request body |
| 401 | unauthorized | Invalid or missing API key |
| 404 | not_found | Resource not found |
| 429 | rate_limited | Too many requests |
| 500 | internal_error | Server error |
Rate Limits
| Plan | Requests/minute |
|---|---|
| Free | 60 |
| Pro | 300 |
| Team | 1000 |
SDKs
Official SDKs coming soon:
- Python:
pip install memorygraph - Node.js:
npm install @memorygraph/sdk