Overview
Khoj builds a memory of facts about you from your conversations and documents. You can view, update, and delete these memories through the API. Base endpoint:/api/memories
Authentication: Required - All endpoints require a valid API token
List All Memories
Retrieve all memories associated with your account. Endpoint:GET /api/memories
Request
Response
Array of memory objects
Update Memory
Update the content of an existing memory. Endpoint:PUT /api/memories/{memory_id}
Request
The ID of the memory to update
The new memory text content
Response
The updated memory ID
The updated memory content
Original creation timestamp
Delete Memory
Remove a specific memory from your account. Endpoint:DELETE /api/memories/{memory_id}
Request
The ID of the memory to delete
Response
Returns HTTP 204 (No Content) on success.Error Responses
Error message describing what went wrong
Common Error Codes
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Memory not found or doesn’t belong to your account |
| 422 | Validation error - Invalid request body |
Use Cases
Memory Management
Review and curate what Khoj remembers about you
Privacy Control
Delete sensitive memories you don’t want stored
Personalization
Add explicit memories to guide AI responses
Memory Export
Export your memories for backup or analysis
Best Practices
Memories are automatically created from your conversations. You can also manually add them through the web interface.
Next Steps
Chat API
Use memories in conversations
User Settings
Manage other user preferences
