Skip to main content
Glama

aiana_memory_export

Export stored memory records as JSONL data from the semantic memory layer. Filter by project to organize exported memories.

Instructions

Export all stored memories as an array of memory records (JSONL-compatible). Optionally filter by project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoExport only memories for this project.

Implementation Reference

  • Actual implementation of exportMemories in the adapter. Uses Qdrant scroll API with pagination to fetch all memories, optionally filtered by project. Converts Qdrant points to MemoryRecord format and returns the complete array.
    async exportMemories(project?: string): Promise<MemoryRecord[]> {
      await ready;
    
      const filter = project
        ? { must: [{ key: "project", match: { value: project } }] }
        : undefined;
    
      const records: MemoryRecord[] = [];
      let offset: string | undefined = undefined;
    
      // Paginate through all points using Qdrant scroll API
      while (true) {
        const body: Record<string, unknown> = {
          limit: 250,
          with_payload: true,
          with_vector: false,
        };
        if (filter) body.filter = filter;
        if (offset) body.offset = offset;
    
        const result = await qdrantRequest<{
          result: {
            points: Array<{ id: string; payload: QdrantPoint["payload"] }>;
            next_page_offset?: string;
          };
        }>(qdrantUrl, qdrantApiKey, "POST", `/collections/${COLLECTION}/points/scroll`, body);
    
        const points = result.result?.points ?? [];
        for (const p of points) {
          records.push({
            id: p.id,
            content: p.payload.content,
            project: p.payload.project,
            memoryType: p.payload.memoryType as MemoryRecord["memoryType"],
            sessionId: p.payload.sessionId,
            timestamp: p.payload.timestamp,
            metadata: p.payload.metadata,
          });
        }
    
        const next = result.result?.next_page_offset;
        if (!next || points.length === 0) break;
        offset = next;
      }
    
      return records;
    },
  • Layer wrapper function exportMemories that delegates to the adapter. Accepts an optional project filter parameter and passes it through to adapter.exportMemories.
    /**
     * Export all memories, optionally filtered to a project.
     */
    export async function exportMemories(
      adapter: AianaAdapter,
      project?: string,
    ): Promise<MemoryRecord[]> {
      return adapter.exportMemories(project);
    }
  • src/app.ts:114-126 (registration)
    Tool registration for aiana_memory_export. Defines the tool name, description, input schema (optional project filter), and the execute handler that calls layers.memories.exportMemories.
    {
      name: "aiana_memory_export",
      description:
        "Export all stored memories as an array of memory records (JSONL-compatible). Optionally filter by project.",
      inputSchema: {
        type: "object",
        properties: {
          project: { type: "string", description: "Export only memories for this project." },
        },
      },
      execute: async (args) =>
        layers.memories.exportMemories(adapter, args.project as string | undefined),
    },
  • MemoryRecord interface defining the structure of exported memory records including id, content, project, memoryType, sessionId, timestamp, score, and metadata fields.
    export interface MemoryRecord {
      id: string;
      content: string;
      project?: string;
      memoryType: "note" | "preference" | "pattern" | "insight" | "conversation";
      sessionId?: string;
      timestamp: string; // ISO 8601
      score?: number;    // populated during semantic search
      metadata?: Record<string, unknown>;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the output format (JSONL-compatible array) and optional filtering behavior, which is useful. However, it lacks details on permissions, rate limits, whether this is a read-only operation, or potential side effects (e.g., if export triggers data processing). No contradiction with annotations exists since none are provided.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Export all stored memories...') and adds a secondary detail ('Optionally filter by project.') without redundancy. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (export operation with one optional parameter) and no annotations or output schema, the description is minimally adequate. It covers the basic action and filtering option but lacks details on output structure (beyond 'JSONL-compatible'), error handling, or integration with sibling tools. For a tool with no structured output documentation, more context would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'project' fully documented in the schema. The description adds marginal value by mentioning 'Optionally filter by project,' reinforcing the optional nature implied by the schema (0 required parameters). It doesn't provide additional syntax or format details beyond what the schema already covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Export all stored memories as an array of memory records (JSONL-compatible).' It specifies the verb (export), resource (memories), and output format. However, it doesn't explicitly differentiate from sibling tools like 'aiana_memory_import' or 'aiana_memory_search' beyond mentioning optional project filtering.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the phrase 'Optionally filter by project,' suggesting this tool is for bulk export with optional filtering. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'aiana_memory_search' (which might offer more granular filtering) or 'aiana_memory_recall' (which might retrieve specific memories). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/git-fabric/aiana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server