Memory API
The Memory API manages your AI Knowledge Base — persistent memories that help the AI personalize PRD generation across conversations. Memories are scoped per user and include preferences, decisions, project context, and feedback.
See the Knowledge Base user guide for how memories work in the product.
List Memories
Retrieve your stored memories, sorted by importance and recent usage.
Query parameters:
| Parameter | Type | Default | Description |
|---|
limit | integer | 20 | Max memories to return |
category | string | — | Filter by category: technical, business, process, style, team |
type | string | — | Filter by type: preference, decision, project_context, feedback |
active | boolean | true | Set to false to include soft-deleted memories |
curl https://app.thig.ai/api/memory?limit=10&category=style \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"memories": [
{
"id": "uuid",
"userId": "user_123",
"memoryType": "preference",
"category": "style",
"content": "User prefers detailed user stories with acceptance criteria in Given/When/Then format",
"summary": "Prefers Given/When/Then acceptance criteria",
"importance": 8,
"isActive": true,
"sourceProjectId": "proj_456",
"lastUsedAt": "2026-03-05T14:30:00Z",
"createdAt": "2026-02-15T10:00:00Z"
}
]
}
Create Memory
Manually add a memory to your Knowledge Base.
Body:
| Field | Type | Required | Description |
|---|
memoryType | string | Yes | preference, decision, project_context, or feedback |
category | string | Yes | technical, business, process, style, or team |
content | string | Yes | The memory content (clear, actionable statement) |
summary | string | No | Brief 1-line summary |
sourceProjectId | string | No | Project this memory originated from |
sourceConversation | object[] | No | Conversation messages for context |
importance | integer | No | 1–10 (10 = most important for future context) |
curl -X POST https://app.thig.ai/api/memory \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"memoryType": "preference",
"category": "style",
"content": "Always include acceptance criteria in Given/When/Then format",
"summary": "Given/When/Then acceptance criteria",
"importance": 8
}'
Response:
{
"memory": {
"id": "uuid",
"userId": "user_123",
"memoryType": "preference",
"category": "style",
"content": "Always include acceptance criteria in Given/When/Then format",
"summary": "Given/When/Then acceptance criteria",
"importance": 8,
"isActive": true,
"createdAt": "2026-03-06T12:00:00Z"
}
}
Delete Memory
DELETE /api/memory?id=MEMORY_ID
Soft-deletes a memory (sets isActive to false). The memory can still be retrieved by passing active=false to the list endpoint.
Query parameters:
| Parameter | Type | Required | Description |
|---|
id | string | Yes | Memory ID to delete |
curl -X DELETE "https://app.thig.ai/api/memory?id=MEMORY_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
Uses AI to analyze a conversation and automatically extract reusable memories — preferences, decisions, context, and feedback. Extracted memories are saved to your Knowledge Base.
Body:
| Field | Type | Required | Description |
|---|
conversation | object[] | Yes | Array of message objects (max 50 messages, max 10,000 chars each) |
conversation[].role | string | Yes | user or assistant |
conversation[].content | string | Yes | Message content |
projectId | string | No | Project the conversation belongs to |
curl -X POST https://app.thig.ai/api/memory/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversation": [
{"role": "user", "content": "I prefer user stories with Given/When/Then acceptance criteria"},
{"role": "assistant", "content": "Noted! I will use Given/When/Then format for all acceptance criteria going forward."},
{"role": "user", "content": "Also, our tech stack is React + Node.js + PostgreSQL"}
],
"projectId": "proj_123"
}'
Response:
{
"extracted": 2,
"saved": 2,
"memories": [
{
"id": "uuid",
"memoryType": "preference",
"category": "style",
"content": "User prefers Given/When/Then format for acceptance criteria",
"summary": "Given/When/Then acceptance criteria",
"importance": 8
},
{
"id": "uuid",
"memoryType": "project_context",
"category": "technical",
"content": "Tech stack: React, Node.js, PostgreSQL",
"summary": "React + Node.js + PostgreSQL stack",
"importance": 7
}
]
}
Memory extraction uses your configured AI provider (respecting BYOK settings). The AI only extracts genuinely useful, reusable information — it skips trivial or project-specific details that won’t apply to future projects.
Memory Types
| Type | Description |
|---|
preference | User preferences about PRD style, detail level, terminology |
decision | Key decisions made about requirements or architecture |
project_context | Company, team, or technical stack information |
feedback | Feedback about generated content that indicates future preferences |
Categories
| Category | Description |
|---|
technical | Technical architecture, stack, infrastructure |
business | Business goals, KPIs, stakeholder preferences |
process | Development methodology, workflow preferences |
style | Writing style, format, detail level preferences |
team | Team structure, roles, communication patterns |