From f21bf0ba61ec06510a61c788b6841100b1f8a076 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 00:31:45 +0000 Subject: [PATCH] Delete apps/docs/search/response-schema.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- apps/docs/search/response-schema.mdx | 358 --------------------------- 1 file changed, 358 deletions(-) delete mode 100644 apps/docs/search/response-schema.mdx diff --git a/apps/docs/search/response-schema.mdx b/apps/docs/search/response-schema.mdx deleted file mode 100644 index 436db0d1..00000000 --- a/apps/docs/search/response-schema.mdx +++ /dev/null @@ -1,358 +0,0 @@ ---- -title: Response schema -description: Understanding the search API response structure ---- - -The search API returns different response structures depending on the search mode and result type. - -## Response structure - -```json -{ - "results": [...], - "timing": 245, - "total": 10 -} -``` - -### Top-level fields - - - Array of search results. Can contain memory results, chunk results, or both (in hybrid mode). - - - - Search execution time in milliseconds. - - - - Total number of results returned. - - -## Result types - -In hybrid search mode, results can be either memory results or chunk results. Each type has a different structure. - -### Memory result - -Memory results contain the `memory` field and represent structured memory entries. - -```json -{ - "id": "mem_abc123", - "memory": "John prefers machine learning over traditional programming", - "metadata": { - "category": "preferences", - "confidence": 0.95 - }, - "updatedAt": "2024-01-15T10:30:00Z", - "version": 2, - "rootMemoryId": "mem_root456", - "similarity": 0.92, - "context": { - "parents": [...], - "children": [...] - }, - "documents": [...], - "chunks": [...] -} -``` - - - Unique identifier for the memory entry. - - - - The memory content. **Only present in memory results.** - - - - Custom metadata associated with the memory. - - - - ISO 8601 timestamp of when the memory was last updated. - - - - Version number of the memory (increments with updates). - - - - ID of the root memory if this memory is part of a memory chain. - - - - Similarity score between 0 and 1 (higher is more similar). - - - - Related memories (parents and children) if `include.relatedMemories` is true. - - ```json - { - "parents": [ - { - "id": "mem_parent123", - "memory": "Parent memory content", - "relation": "updates" - } - ], - "children": [ - { - "id": "mem_child456", - "memory": "Child memory content", - "relation": "extends" - } - ] - } - ``` - - - - Associated documents if `include.documents` is true. See [Document schema](#document-schema). - - - - Top 5 relevant document chunks if `include.chunks` is true. See [Chunk schema](#chunk-schema). - - -### Chunk result - -Chunk results contain the `chunk` field and represent raw document content. **Only returned in hybrid search mode.** - -```json -{ - "id": "chunk_xyz789", - "chunk": "This is a chunk of content from a document about machine learning preferences...", - "metadata": { - "source": "document_123.pdf", - "page": 5 - }, - "updatedAt": "2024-01-15T10:30:00Z", - "similarity": 0.88, - "version": 1, - "context": { - "parents": [], - "children": [] - }, - "documents": [ - { - "id": "doc_123", - "title": "Machine Learning Guide", - "type": "pdf", - "createdAt": "2024-01-10T08:00:00Z", - "updatedAt": "2024-01-15T10:30:00Z" - } - ], - "chunks": [] -} -``` - - - Unique identifier for the chunk. - - - - The chunk content. **Only present in chunk results.** - - - - Metadata from the parent document. - - - - ISO 8601 timestamp of when the document was last updated. - - - - Similarity score between 0 and 1 (higher is more similar). - - - - Always 1 for chunk results. - - - - Always empty for chunk results (chunks don't have parent/child relationships). - - - - Array containing the parent document. Always includes exactly one document. - - - - Always empty for chunk results. - - -## Nested schemas - -### Document schema - -```json -{ - "id": "doc_123", - "title": "Machine Learning Guide", - "type": "pdf", - "metadata": { - "author": "John Doe", - "tags": ["ml", "ai"] - }, - "summary": "A comprehensive guide to machine learning...", - "createdAt": "2024-01-10T08:00:00Z", - "updatedAt": "2024-01-15T10:30:00Z" -} -``` - - - Document identifier (custom ID if provided, otherwise internal ID). - - - - Document title (if `include.documents` is true). - - - - Document type (e.g., "pdf", "txt", "html"). - - - - Document metadata (if `include.documents` is true). - - - - Document summary (if `include.summaries` is true). - - - - ISO 8601 timestamp of document creation. - - - - ISO 8601 timestamp of last document update. - - -### Chunk schema - -```json -{ - "content": "This is a chunk of content from the document...", - "score": 0.89, - "position": 3, - "documentId": "doc_123" -} -``` - - - The chunk content. - - - - Similarity score for this chunk (0-1). - - - - Position of the chunk within the document (0-indexed). - - - - ID of the parent document. - - -## Distinguishing result types - -To determine if a result is a memory or chunk: - -```javascript -if (result.memory) { - // This is a memory result - console.log("Memory:", result.memory); -} else if (result.chunk) { - // This is a chunk result - console.log("Chunk:", result.chunk); -} -``` - -## Example responses - -### Memories mode response - -```json -{ - "results": [ - { - "id": "mem_abc123", - "memory": "John prefers machine learning over traditional programming", - "metadata": { - "category": "preferences" - }, - "updatedAt": "2024-01-15T10:30:00Z", - "version": 2, - "rootMemoryId": null, - "similarity": 0.92 - } - ], - "timing": 145, - "total": 1 -} -``` - -### Hybrid mode response - -```json -{ - "results": [ - { - "id": "mem_abc123", - "memory": "John prefers machine learning over traditional programming", - "metadata": { - "category": "preferences" - }, - "updatedAt": "2024-01-15T10:30:00Z", - "version": 2, - "rootMemoryId": null, - "similarity": 0.92, - "context": { - "parents": [], - "children": [] - }, - "documents": [], - "chunks": [] - }, - { - "id": "chunk_xyz789", - "chunk": "Machine learning is a subset of artificial intelligence...", - "metadata": { - "source": "ml_guide.pdf" - }, - "updatedAt": "2024-01-14T09:00:00Z", - "similarity": 0.88, - "version": 1, - "context": { - "parents": [], - "children": [] - }, - "documents": [ - { - "id": "doc_123", - "title": "Machine Learning Guide", - "type": "pdf", - "createdAt": "2024-01-10T08:00:00Z", - "updatedAt": "2024-01-14T09:00:00Z" - } - ], - "chunks": [] - } - ], - "timing": 245, - "total": 2 -} -``` - -## Notes - -- In hybrid mode, results are sorted by similarity score regardless of type -- Chunk results that are already associated with memory results are automatically deduplicated -- The `context` field is always empty for chunk results -- The `documents` array for chunk results always contains exactly one document (the parent) -- Memory results can have multiple associated documents if the memory references multiple sources