Download OpenAPI specification:Download
HTTP API for Hindsight
Retrieve graph data for visualization, optionally filtered by type (world/experience/opinion). Limited to 1000 most recent items.
| bank_id required | string (Bank Id) |
Type (string) or Type (null) (Type) |
required | Array of objects (Nodes) |
required | Array of objects (Edges) |
required | Array of objects (Table Rows) |
| total_units required | integer (Total Units) |
{- "edges": [
- {
- "from": "1",
- "to": "2",
- "type": "semantic",
- "weight": 0.8
}
], - "nodes": [
- {
- "id": "1",
- "label": "Alice works at Google",
- "type": "world"
}, - {
- "id": "2",
- "label": "Bob went hiking",
- "type": "world"
}
], - "table_rows": [
- {
- "context": "Work info",
- "date": "2024-01-15 10:30",
- "entities": "Alice (PERSON), Google (ORGANIZATION)",
- "id": "abc12345...",
- "text": "Alice works at Google"
}
], - "total_units": 2
}List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).
| bank_id required | string (Bank Id) |
Type (string) or Type (null) (Type) | |
Q (string) or Q (null) (Q) | |
| limit | integer (Limit) Default: 100 |
| offset | integer (Offset) Default: 0 |
required | Array of objects (Items) |
| total required | integer (Total) |
| limit required | integer (Limit) |
| offset required | integer (Offset) |
{- "items": [
- {
- "context": "Work conversation",
- "date": "2024-01-15T10:30:00Z",
- "entities": "Alice (PERSON), Google (ORGANIZATION)",
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "text": "Alice works at Google on the AI team",
- "type": "world"
}
], - "limit": 100,
- "offset": 0,
- "total": 150
}Recall memory using semantic similarity and spreading activation.
The type parameter is optional and must be one of:
world: General knowledge about people, places, events, and things that happenexperience: Memories about experience, conversations, actions taken, and tasks performedopinion: The bank's formed beliefs, perspectives, and viewpointsSet include_entities=true to get entity observations alongside recall results.
| bank_id required | string (Bank Id) |
| query required | string (Query) |
Array of Types (strings) or Types (null) (Types) List of fact types to recall (defaults to all if not specified) | |
| budget | string (Budget) Default: "mid" Enum: "low" "mid" "high" Budget levels for recall/reflect operations. |
| max_tokens | integer (Max Tokens) Default: 4096 |
| trace | boolean (Trace) Default: false |
Query Timestamp (string) or Query Timestamp (null) (Query Timestamp) ISO format date string (e.g., '2023-05-30T23:40:00') | |
object (IncludeOptions) Options for including additional data (entities are included by default) |
required | Array of objects (Results) |
Trace (object) or Trace (null) (Trace) | |
Entities (object) or Entities (null) (Entities) Entity states for entities mentioned in results | |
Chunks (object) or Chunks (null) (Chunks) Chunks for facts, keyed by chunk_id |
{- "budget": "mid",
- "include": {
- "entities": {
- "max_tokens": 500
}
}, - "max_tokens": 4096,
- "query": "What did Alice say about machine learning?",
- "query_timestamp": "2023-05-30T23:40:00",
- "trace": true,
- "types": [
- "world",
- "experience"
]
}{- "chunks": {
- "456e7890-e12b-34d5-a678-901234567890": {
- "chunk_index": 0,
- "id": "456e7890-e12b-34d5-a678-901234567890",
- "text": "Alice works at Google on the AI team. She's been there for 3 years..."
}
}, - "entities": {
- "Alice": {
- "canonical_name": "Alice",
- "entity_id": "123e4567-e89b-12d3-a456-426614174001",
- "observations": [
- {
- "mentioned_at": "2024-01-15T10:30:00Z",
- "text": "Alice works at Google on the AI team"
}
]
}
}, - "results": [
- {
- "chunk_id": "456e7890-e12b-34d5-a678-901234567890",
- "context": "work info",
- "entities": [
- "Alice",
- "Google"
], - "id": "123e4567-e89b-12d3-a456-426614174000",
- "occurred_end": "2024-01-15T10:30:00Z",
- "occurred_start": "2024-01-15T10:30:00Z",
- "text": "Alice works at Google on the AI team",
- "type": "world"
}
], - "trace": {
- "num_results": 1,
- "query": "What did Alice say about machine learning?",
- "time_seconds": 0.123
}
}Reflect and formulate an answer using bank identity, world facts, and opinions.
This endpoint:
| bank_id required | string (Bank Id) |
| query required | string (Query) |
| budget | string (Budget) Default: "low" Enum: "low" "mid" "high" Budget levels for recall/reflect operations. |
Context (string) or Context (null) (Context) | |
object (ReflectIncludeOptions) Options for including additional data (disabled by default) |
| text required | string (Text) |
Array of objects (Based On) Default: [] |
{- "budget": "low",
- "context": "This is for a research paper on AI ethics",
- "include": {
- "facts": { }
}, - "query": "What do you think about artificial intelligence?"
}{- "based_on": [
- {
- "id": "123",
- "text": "AI is used in healthcare",
- "type": "world"
}, - {
- "id": "456",
- "text": "I discussed AI applications last week",
- "type": "experience"
}
], - "text": "Based on my understanding, AI is a transformative technology..."
}Retain memory items with automatic fact extraction.
This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the async parameter.
Features:
The system automatically:
When async=true: Returns immediately after queuing. Use the operations endpoint to monitor progress.
When async=false (default): Waits for processing to complete.
Note: If a memory item has a document_id that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).
| bank_id required | string (Bank Id) |
required | Array of objects (Items) |
| async | boolean (Async) Default: false If true, process asynchronously in background. If false, wait for completion (default: false) |
| success required | boolean (Success) |
| bank_id required | string (Bank Id) |
| items_count required | integer (Items Count) |
| async required | boolean (Async) Whether the operation was processed asynchronously |
{- "async": false,
- "items": [
- {
- "content": "Alice works at Google",
- "context": "work",
- "document_id": "conversation_123"
}, - {
- "content": "Bob went hiking yesterday",
- "document_id": "conversation_123",
- "timestamp": "2024-01-15T10:00:00Z"
}
]
}{- "async": false,
- "bank_id": "user123",
- "items_count": 2,
- "success": true
}Delete memory units for a memory bank. Optionally filter by type (world, experience, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (disposition and background) will be preserved.
| bank_id required | string (Bank Id) |
Type (string) or Type (null) (Type) Optional fact type filter (world, experience, opinion) |
| success required | boolean (Success) |
{- "success": true
}Get a list of all agents with their profiles
required | Array of objects (Banks) | ||||||||||||
Array
| |||||||||||||
{- "banks": [
- {
- "background": "I am a software engineer",
- "bank_id": "user123",
- "created_at": "2024-01-15T10:30:00Z",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}, - "name": "Alice",
- "updated_at": "2024-01-16T14:20:00Z"
}
]
}Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists.
| bank_id required | string (Bank Id) |
| bank_id required | string (Bank Id) |
| name required | string (Name) |
required | object (DispositionTraits) Disposition traits that influence how memories are formed and interpreted. |
| background required | string (Background) |
{- "background": "I am a software engineer with 10 years of experience in startups",
- "bank_id": "user123",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}, - "name": "Alice"
}Update bank's disposition traits (skepticism, literalism, empathy)
| bank_id required | string (Bank Id) |
required | object (DispositionTraits) Disposition traits that influence how memories are formed and interpreted. | ||||||
| |||||||
| bank_id required | string (Bank Id) |
| name required | string (Name) |
required | object (DispositionTraits) Disposition traits that influence how memories are formed and interpreted. |
| background required | string (Background) |
{- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}
}{- "background": "I am a software engineer with 10 years of experience in startups",
- "bank_id": "user123",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}, - "name": "Alice"
}Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits.
| bank_id required | string (Bank Id) |
| content required | string (Content) New background information to add or merge |
| update_disposition | boolean (Update Disposition) Default: true If true, infer disposition traits from the merged background (default: true) |
| background required | string (Background) |
DispositionTraits (object) or null |
{- "content": "I was born in Texas",
- "update_disposition": true
}{- "background": "I was born in Texas. I am a software engineer with 10 years of experience.",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}
}Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults.
| bank_id required | string (Bank Id) |
Name (string) or Name (null) (Name) | |
DispositionTraits (object) or null | |
Background (string) or Background (null) (Background) |
| bank_id required | string (Bank Id) |
| name required | string (Name) |
required | object (DispositionTraits) Disposition traits that influence how memories are formed and interpreted. |
| background required | string (Background) |
{- "background": "I am a creative software engineer with 10 years of experience",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}, - "name": "Alice"
}{- "background": "I am a software engineer with 10 years of experience in startups",
- "bank_id": "user123",
- "disposition": {
- "empathy": 3,
- "literalism": 3,
- "skepticism": 3
}, - "name": "Alice"
}List all entities (people, organizations, etc.) known by the bank, ordered by mention count.
| bank_id required | string (Bank Id) |
| limit | integer (Limit) Default: 100 Maximum number of entities to return |
required | Array of objects (Items) | ||||||||||||
Array
| |||||||||||||
{- "items": [
- {
- "canonical_name": "John",
- "first_seen": "2024-01-15T10:30:00Z",
- "id": "123e4567-e89b-12d3-a456-426614174000",
- "last_seen": "2024-02-01T14:00:00Z",
- "mention_count": 15
}
]
}Get detailed information about an entity including observations (mental model).
| bank_id required | string (Bank Id) |
| entity_id required | string (Entity Id) |
| id required | string (Id) |
| canonical_name required | string (Canonical Name) |
| mention_count required | integer (Mention Count) |
First Seen (string) or First Seen (null) (First Seen) | |
Last Seen (string) or Last Seen (null) (Last Seen) | |
Metadata (object) or Metadata (null) (Metadata) | |
required | Array of objects (Observations) |
{- "canonical_name": "John",
- "first_seen": "2024-01-15T10:30:00Z",
- "id": "123e4567-e89b-12d3-a456-426614174000",
- "last_seen": "2024-02-01T14:00:00Z",
- "mention_count": 15,
- "observations": [
- {
- "mentioned_at": "2024-01-15T10:30:00Z",
- "text": "John works at Google"
}
]
}Regenerate observations for an entity based on all facts mentioning it.
| bank_id required | string (Bank Id) |
| entity_id required | string (Entity Id) |
| id required | string (Id) |
| canonical_name required | string (Canonical Name) |
| mention_count required | integer (Mention Count) |
First Seen (string) or First Seen (null) (First Seen) | |
Last Seen (string) or Last Seen (null) (Last Seen) | |
Metadata (object) or Metadata (null) (Metadata) | |
required | Array of objects (Observations) |
{- "canonical_name": "John",
- "first_seen": "2024-01-15T10:30:00Z",
- "id": "123e4567-e89b-12d3-a456-426614174000",
- "last_seen": "2024-02-01T14:00:00Z",
- "mention_count": 15,
- "observations": [
- {
- "mentioned_at": "2024-01-15T10:30:00Z",
- "text": "John works at Google"
}
]
}List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
| bank_id required | string (Bank Id) |
Q (string) or Q (null) (Q) | |
| limit | integer (Limit) Default: 100 |
| offset | integer (Offset) Default: 0 |
required | Array of objects (Items) |
| total required | integer (Total) |
| limit required | integer (Limit) |
| offset required | integer (Offset) |
{- "items": [
- {
- "bank_id": "user123",
- "content_hash": "abc123",
- "created_at": "2024-01-15T10:30:00Z",
- "id": "session_1",
- "memory_unit_count": 15,
- "text_length": 5420,
- "updated_at": "2024-01-15T10:30:00Z"
}
], - "limit": 100,
- "offset": 0,
- "total": 50
}Get a specific document including its original text
| bank_id required | string (Bank Id) |
| document_id required | string (Document Id) |
| id required | string (Id) |
| bank_id required | string (Bank Id) |
| original_text required | string (Original Text) |
required | Content Hash (string) or Content Hash (null) (Content Hash) |
| created_at required | string (Created At) |
| updated_at required | string (Updated At) |
| memory_unit_count required | integer (Memory Unit Count) |
{- "bank_id": "user123",
- "content_hash": "abc123",
- "created_at": "2024-01-15T10:30:00Z",
- "id": "session_1",
- "memory_unit_count": 15,
- "original_text": "Full document text here...",
- "updated_at": "2024-01-15T10:30:00Z"
}Delete a document and all its associated memory units and links.
This will cascade delete:
This operation cannot be undone.
| bank_id required | string (Bank Id) |
| document_id required | string (Document Id) |
nullGet a specific chunk by its ID
| chunk_id required | string (Chunk Id) |
| chunk_id required | string (Chunk Id) |
| document_id required | string (Document Id) |
| bank_id required | string (Bank Id) |
| chunk_index required | integer (Chunk Index) |
| chunk_text required | string (Chunk Text) |
| created_at required | string (Created At) |
{- "bank_id": "user123",
- "chunk_id": "user123_session_1_0",
- "chunk_index": 0,
- "chunk_text": "This is the first chunk of the document...",
- "created_at": "2024-01-15T10:30:00Z",
- "document_id": "session_1"
}