documents.upload
Uploads text documents to a text namespace. Moorcheh will process and embed these asynchronously.Parameters
The name of the target text namespace.
A list of dictionaries. Each dict requires an id and text key.
Dict[str, Any] - A dictionary confirming the documents were queued.
Raises: NamespaceNotFound, InvalidInputError.
Example
Upload Documents Example
Document Structure
Each document in thedocuments array is a flat object with these properties:
- id (required): Unique identifier for the document (string or number)
- text (required): The main text content of the document
- Additional fields: Any other fields are treated as metadata
Well-Structured Documents
Complete Example
Complete Data Management Workflow
Important Notes
Asynchronous Processing: Text documents are processed asynchronously. Allow a few seconds after upload before searching.
Best Practices
- Keep documents focused on a single topic
- Include meaningful titles and metadata
- Use consistent metadata schemas across documents
- Break large documents into logical chunks
- Upload in batches of 25-50 documents for optimal performance
- Use meaningful document IDs for easier management
Document Limits
- Text Length: Min 10 characters, Max 50,000 characters per document
- Batch Size: Max 100 documents per request, Recommended 25-50
- Metadata Size: Max 2KB per document, Up to 50 metadata keys
Related Operations
- Get Documents - Retrieve uploaded documents
- Delete Data - Remove specific documents
- Search - Search uploaded documents