REST API endpoints for the Agentic Memory Platform (Memory + Knowledge Base)
/health) require an API key in the Authorization header:Authorization: Bearer <api_key>
/api/v1/knowledge/* and can be combined with memory search via the /api/v1/search/unified endpoint.
See the Knowledge Base section below for details.
write scope.entity_id and optionally scope.
Valid scopes: private (default), group, tenant, public.
See Confidentiality Scopes for details.
{
"messages": [
{"role": "user", "content": "User prefers dark mode UI"}
],
"user_id": "user_123",
"entity_id": "customer_456", // Required
"scope": "private", // Optional, defaults to "private"
"context_id": "ctx_123", // Optional, auto-generated if omitted
"episode_id": "ep_456", // Optional, auto-generated if omitted
"agent_id": "agent_789", // Optional
"dimensions": { // Optional
"topics": ["ui", "preferences"],
"tags": ["user-pref"],
"entities": ["user"]
},
"metadata": { // Optional
"source": "web"
}
}
role and contentprivate, group, tenant, public. Defaults to private{
"success": true,
"data": {
"memories": [
{
"id": "interaction-uuid",
"memory": "User prefers dark mode UI",
"user_id": "user_123",
"context_id": "ctx_123",
"episode_id": "ep_456",
"created_at": "2024-01-15T10:30:00Z",
"summary": "User prefers dark mode UI"
}
],
"summary_status": "ready"
},
"purple_hub": {
"context_id": "ctx_123",
"episode_id": "ep_456",
"interaction_ids": ["interaction-uuid"],
"structure_level": "structured",
"auto_upgraded": false
}
}
admin scope.{
"id": "ctx_123",
"name": "Customer Support Context",
"description": "Context for customer support interactions",
"entity_id": "customer_456", // Required
"scope": "private", // Optional, defaults to "private"
"metadata": { // Optional
"department": "support"
}
}
privateread scope.(tenant_id, entity_id, scope) match.
Only memories matching all three criteria are returned.
{
"query": "user preferences",
"entity_id": "customer_456", // Required
"scope": "private", // Optional, defaults to "private"
"topics": ["ui", "preferences"], // Optional: additional semantic search terms
"top_k": 10, // Optional, default: 10, max: 100
"include_recent": 50, // Optional, default: 50, max: 200
"limit": 10 // Optional, default: 10, max: 100
}
private, group, tenant, public. Defaults to private{
"success": true,
"data": {
"results": [
{
"interaction_id": "interaction-uuid",
"score": 0.85,
"distance": 12,
"content": "User prefers dark mode UI",
"role": "user",
"context_id": "ctx_123",
"episode_id": "ep_456",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
}
read scope.{
"query": "user preferences", // Optional if filters provided
"entity_id": "customer_456", // Required
"scope": "private", // Optional, defaults to "private"
"filters": [ // Optional: dimension filters
{
"dimension": "agent_id",
"operator": "eq",
"values": ["agent_789"]
},
{
"dimension": "topic",
"operator": "in",
"values": ["ui", "preferences"]
}
],
"top_k": 10, // Optional, default: 10, max: 100
"limit": 10 // Optional, default: 10, max: 100
}
privateagent_id, topic, tag, entity, role, memory_type{
"success": true,
"data": {
"results": [
{
"interaction_id": "interaction-uuid",
"score": 0.85,
"distance": 12,
"content": "User prefers dark mode UI",
"role": "user",
"context_id": "ctx_123",
"episode_id": "ep_456",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
}
read scope.{
"query": "artificial intelligence",
"entity_id": "customer_456", // Required
"scope": "private", // Optional, defaults to "private"
"search_memory": true, // Optional, default: true
"search_knowledge": true, // Optional, default: false
"memory_top_k": 20, // Optional, default: 20, max: 100
"knowledge_top_k": 10, // Optional, default: 10, max: 100
"include_recent": 100, // Optional, default: 100, max: 200
"source_filter": "podcast-123" // Optional: filter knowledge by source ID
}
privatetruefalse{
"success": true,
"data": {
"memory_results": [
{
"interaction_id": "interaction-uuid",
"score": 0.85,
"distance": 12,
"content": "We discussed AI capabilities",
"role": "user",
"context_id": "ctx_123",
"episode_id": "ep_456",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"knowledge_results": [
{
"chunk_id": "chunk-uuid",
"knowledge_id": "knowledge-uuid",
"score": 0.92,
"content": "Artificial intelligence is...",
"metadata": {
"source_id": "podcast-123",
"type": "transcript",
"title": "AI Podcast Episode 1"
}
}
],
"total": 2
}
}
The Knowledge Base provides RAG (Retrieval Augmented Generation) capabilities for static documents, separate from conversational memory. Documents are chunked semantically with overlap, embedded, and stored in an optimized RocksDB database. Knowledge can be searched independently or combined with memory search using the unified endpoint.
read scope. Knowledge component must be configured (set PURPLE_HUB_KNOWLEDGE_DATA_DIR).{
"query": "artificial intelligence",
"tenant_id": "system", // Optional, defaults to "system"
"top_k": 10, // Optional, default: 10, max: 100
"source_filter": "podcast-123" // Optional: filter by source ID
}
"system". Searches tenant-specific knowledge if provided, falls back to system knowledge.{
"success": true,
"data": {
"results": [
{
"chunk_id": "chunk-uuid",
"knowledge_id": "knowledge-uuid",
"score": 0.92,
"content": "Artificial intelligence is the simulation of human intelligence...",
"metadata": {
"source_id": "podcast-123",
"type": "transcript",
"title": "AI Podcast Episode 1"
}
}
],
"total": 1
}
}
write scope. Knowledge component must be configured.{
"documents": [
{
"source_id": "doc-1",
"content": "Full text content here...",
"metadata": {
"type": "article",
"title": "Article Title",
"author": "Author Name"
}
}
],
"tenant_id": "system" // Optional, defaults to "system"
}
"system"{
"success": true,
"data": {
"ingested": 1,
"chunks_created": 5
}
}