Skip to main content

Memory to Note Conversion

Promote memories into structured notes organized by tag.

Overview

Memory-to-note conversion takes a set of memories — specified by IDs or a search query — and produces a structured note. Memories are grouped by tag into sections, making it easy to turn scattered knowledge into organized documentation.

This is useful for turning weeks of accumulated memories about a project into a single reference document.

Input Modes

You can specify which memories to convert in two ways:

  • By IDs — provide an explicit list of memory IDs to include
  • By search query — provide a query and the endpoint searches for matching memories automatically

API Endpoint

Request
POST /v1/knowledge/to-note

// By memory IDs
{
  "memory_ids": ["mem_abc123", "mem_def456", "mem_ghi789"],
  "title": "Project Setup Guide"
}

// By search query
{
  "query": "project setup steps",
  "limit": 15,
  "title": "Project Setup Guide"
}

SDK Examples

import { Trix } from '@trixdb/client';

const trix = new Trix({ apiKey: process.env.TRIX_API_KEY });

// Convert memories matching a query into a note
const note = await trix.knowledge.toNote({
  query: 'project setup steps',
  limit: 15,
  title: 'Project Setup Guide',
});

console.log(`Created note: ${note.id}`);
console.log(`Sections: ${note.blocks.length}`);
for (const block of note.blocks) {
  console.log(`  - ${block.heading} (${block.memoryCount} memories)`);
}

Tag-Based Grouping

Memories are grouped into note sections by their tags. Each section gets a heading based on the tag name, and the content is synthesized from the grouped memories. Memories without tags are placed in a "General" section.