Documentation Index
Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt
Use this file to discover all available pages before exploring further.
documents.upload_file
Uploads a file to a text namespace. The SDK automatically requests a pre-signed upload URL, uploads the file bytes, and the backend processes and embeds the content asynchronously.Parameters
The name of the target text namespace.
Path to a local file (
str or Path) or a file-like object (BinaryIO).Dict[str, Any] - A dictionary confirming the file upload request.
Common response fields include success, message, namespace, file_name, and file_size.
Raises: NamespaceNotFound, InvalidInputError, AuthenticationError, APIError, MoorchehError.
Example
Upload File Example
Input Options
You can pass either a file path or a file-like object.File Path Or File-Like Object
Complete Example
Complete File Upload Workflow
Important Notes
SDK handles pre-signed upload internally: You do not need to call the upload URL endpoint manually when using
documents.upload_file.Asynchronous Processing: Uploaded files are processed asynchronously. Allow some time after upload before searching.
Best Practices
- Use clear, stable file names so ingestion and auditing are easier
- Keep source files clean and well-structured for better extraction quality
- Use markdown or plain text when possible for predictable parsing
- Upload large datasets in multiple files rather than one huge file
- Wait briefly before running search queries after upload
- Handle upload exceptions and retry transient failures
File Limits
- File Size: Max 5GB
- Supported Types:
.pdf,.docx,.xlsx,.json,.txt,.csv,.md - Upload URL Expiry: Internally handled by SDK (short-lived pre-signed URL)
Related Operations
- Fetch Text Data - List ingested text and summary chunks
- Search - Query uploaded and processed content
- Delete Data - Remove documents or entries from a namespace