Overview
Knowledge summary searches your memories for a topic, groups them by tags or clusters, and returns a structured summary with each group's label, count, and full memory objects.
Use knowledge summaries to understand what you know about a subject before making decisions or generating content.
How It Works
- Searches memories matching your topic using semantic search
- Groups results by tags or cluster membership
- Returns each group with its label, count, and matching memories
API Endpoint
Request
POST /v1/knowledge/summary
{
"topic": "kubernetes deployment",
"limit": 20,
"group_by": "tags"
}SDK Examples
import { Trix } from '@trixdb/client';
const trix = new Trix({ apiKey: process.env.TRIX_API_KEY });
const summary = await client.knowledge.summary('kubernetes deployment', {
limit: 20,
groupBy: 'tags',
});
console.log(`${summary.total_memories} memories about "${summary.topic}"`);
console.log('Groups:', summary.groups.length);
for (const group of summary.groups) {
console.log(`\n## ${group.label} (${group.count} memories)`);
console.log(group.memories.map((m: any) => m.content).join('\n'));
}Response Shape
Response
{
"topic": "kubernetes deployment",
"total_memories": 12,
"group_by": "tags",
"groups": [
{ "label": "helm-charts", "count": 5, "memories": [ ... ] },
{ "label": "monitoring", "count": 3, "memories": [ ... ] },
{ "label": "untagged", "count": 4, "memories": [ ... ] }
]
}Each group includes the full memory objects so you can inspect content, tags, and metadata without a second request.