v37

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-1170194628.0 KB
v1
Memory

Search V1

Search through memories with authentication required.

**Authentication Required**:
One of the following authentication methods must be used:
- Bearer token in `Authorization` header
- API Key in `X-API-Key` header
- Session token in `X-Session-Token` header

**Response Format Options**:
Choose between standard JSON or TOON (Token-Oriented Object Notation) format:
- **JSON (default)**: Standard JSON response format
- **TOON**: Optimized format achieving 30-60% token reduction for LLM contexts
  - Use `response_format=toon` query parameter
  - Returns `text/plain` with TOON-formatted content
  - Ideal for LLM integrations to reduce API costs and latency
  - Maintains semantic clarity while minimizing token usage
  - Example: `/v1/memory/search?response_format=toon`

**Custom Schema Support**:
This endpoint supports both system-defined and custom user-defined node types:
- **System nodes**: Memory, Person, Company, Project, Task, Insight, Meeting, Opportunity, Code
- **Custom nodes**: Defined by developers via UserGraphSchema (e.g., Developer, Product, Customer, Function)

When custom schema nodes are returned:
- Each custom node includes a `schema_id` field referencing the UserGraphSchema
- The response includes a `schemas_used` array listing all schema IDs used
- Use `GET /v1/schemas/{schema_id}` to retrieve full schema definitions including:
  - Node type definitions and properties
  - Relationship type definitions and constraints
  - Validation rules and requirements

**Recommended Headers**:
```
Accept-Encoding: gzip
```

The API supports response compression for improved performance. Responses larger than 1KB will be automatically compressed when this header is present.

**HIGHLY RECOMMENDED SETTINGS FOR BEST RESULTS:**
- Set `enable_agentic_graph: true` for intelligent, context-aware search that can understand ambiguous references
- Use `max_memories: 15-20` for comprehensive memory coverage
- Use `max_nodes: 10-15` for comprehensive graph entity relationships
- Use `response_format: toon` when integrating with LLMs to reduce token costs by 30-60%

**Agentic Graph Benefits:**
When enabled, the system can understand vague references by first identifying specific entities from your memory graph, then performing targeted searches. For example:
- "customer feedback" → identifies your customers first, then finds their specific feedback
- "project issues" → identifies your projects first, then finds related issues
- "team meeting notes" → identifies your team members first, then finds meeting notes
- "code functions" → identifies your functions first, then finds related code

**Role-Based Memory Filtering:**
Filter memories by role and category using metadata fields:
- `metadata.role`: Filter by "user" or "assistant" 
- `metadata.category`: Filter by category (user: preference, task, goal, facts, context | assistant: skills, learning)

**User Resolution Precedence:**
- If both user_id and external_user_id are provided, user_id takes precedence.
- If only external_user_id is provided, it will be resolved to the internal user.
- If neither is provided, the authenticated user is used.
post/v1/memory/search

Query parameters

max_memoriesinteger

HIGHLY RECOMMENDED: Maximum number of memories to return. Use at least 15-20 for comprehensive results. Lower values (5-10) may miss relevant information. Default is 20 for optimal coverage.

HIGHLY RECOMMENDED: Maximum number of memories to return. Use at least 15-20 for comprehensive results. Lower values (5-10) may miss relevant information. Default is 20 for optimal coverage.

max_nodesinteger

HIGHLY RECOMMENDED: Maximum number of neo nodes to return. Use at least 10-15 for comprehensive graph results. Lower values may miss important entity relationships. Default is 15 for optimal coverage.

HIGHLY RECOMMENDED: Maximum number of neo nodes to return. Use at least 10-15 for comprehensive graph results. Lower values may miss important entity relationships. Default is 15 for optimal coverage.

response_format'json' | 'toon'

Response format options for API endpoints.

  • json: Standard JSON format (default)
  • toon: Token-Oriented Object Notation format for 30-60% token reduction in LLM contexts

Response format: 'json' (default) or 'toon' (Token-Oriented Object Notation for 30-60% token reduction in LLM contexts)

Headers

Accept-Encodingstring

Recommended to use 'gzip' for response compression

Request body

querystring required

Detailed search query describing what you're looking for. For best results, write 2-3 sentences that include specific details, context, and time frame. Examples: 'Find recurring customer complaints about API performance from the last month. Focus on issues where customers specifically mentioned timeout errors or slow response times in their conversations.' 'What are the main issues and blockers in my current projects? Focus on technical challenges and timeline impacts.' 'Find insights about team collaboration and communication patterns from recent meetings and discussions.'

rank_resultsboolean

DEPRECATED: Use 'reranking_config' instead. Whether to enable additional ranking of search results. Default is false because results are already ranked when using an LLM for search (recommended approach). Only enable this if you're not using an LLM in your search pipeline and need additional result ranking. Migration: Replace 'rank_results: true' with 'reranking_config: {reranking_enabled: true, reranking_provider: "cohere", reranking_model: "rerank-v3.5"}'

enable_agentic_graphboolean

HIGHLY RECOMMENDED: Enable agentic graph search for intelligent, context-aware results. When enabled, the system can understand ambiguous references by first identifying specific entities from your memory graph, then performing targeted searches. Examples: 'customer feedback' → identifies your customers first, then finds their specific feedback; 'project issues' → identifies your projects first, then finds related issues; 'team meeting notes' → identifies team members first, then finds meeting notes. This provides much more relevant and comprehensive results. Set to false only if you need faster, simpler keyword-based search.

external_user_idstring nullable

Your application's user identifier to filter search results. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email).

user_idstring nullable

DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.

organization_idstring nullable

Optional organization ID for multi-tenant search scoping. When provided, search is scoped to memories within this organization.

namespace_idstring nullable

Optional namespace ID for multi-tenant search scoping. When provided, search is scoped to memories within this namespace.

schema_idstring nullable

Optional user-defined schema ID to use for this search. If provided, this schema (plus system schema) will be used for query generation. If not provided, system will automatically select relevant schema based on query content.

Example request

{
  "enable_agentic_graph": false,
  "external_user_id": "external_user_123",
  "query": "Find recurring customer complaints about API performance from the last month. Focus on issues that multiple customers have mentioned and any specific feature requests or workflow improvements they've suggested.",
  "rank_results": true
}

Response

Successfully retrieved memories

codeinteger

HTTP status code

statusstring

'success' or 'error'

errorstring nullable

Error message if failed

{"stackTrail":"components:schemas:SearchResponse:properties:details:anyOf","oasType":"schema","type":"unknown","title":"Details","description":"Additional error details or context","nullable":true}
search_idstring nullable

Unique identifier for this search query, maps to QueryLog objectId in Parse Server

Example response

{
  "code": 200,
  "data": {
    "memories": [],
    "nodes": []
  },
  "search_id": "abc123def456",
  "status": "success"
}