Mirra APIDocuments
Document Examples
Documents enable you to upload, process, and semantically search files within your knowledge graph. These examples demonstrate common document management patterns.
Upload and Share a Document
This example uploads a PDF report and shares it with a team group for collaborative review.
TypeScript
Search Across Team Documents
This example performs a semantic search to find relevant information across all documents shared in a team graph.
TypeScript
Track Document Sharing
This example demonstrates how to track where a document has been shared and manage access.
TypeScript
Batch Document Processing
This example shows how to upload multiple documents and track their processing status.
TypeScript
Best Practices
Document Organization
- Use descriptive filenames - Include dates, versions, and context in filenames
- Add metadata - Always provide
title,author, andproductTagsfor better organization - Tag consistently - Develop a tagging taxonomy for your team and use it consistently
- Version control - Include version numbers in titles or tags when uploading new versions
Search Optimization
- Query length - Use 5-15 word queries for best results
- Natural language - Phrase queries as questions or statements, not keyword lists
- Adjust threshold - Start with 0.7 and adjust based on precision/recall needs
- Limit appropriately - Use smaller limits (5-10) for high-precision needs
Access Control
- Default to personal - Upload to your personal graph first, then share selectively
- Document sharing reasons - Always provide a
shareReasonto track why documents were shared - Regular audits - Periodically review
listGraphs()to ensure documents aren't over-shared - Unshare when done - Remove document access from graphs when collaboration is complete
See Also
- Overview - Document concepts and processing pipeline
- Endpoints - Complete API reference
- Technical Notes - Supported formats and troubleshooting
- Scripts - Build serverless functions that search documents