Skip to main content

documents.upload

Uploads text documents to a text namespace. Moorcheh will process and embed these asynchronously.

Parameters

namespace_name
str
required
The name of the target text namespace.
documents
List[Dict]
required
A list of dictionaries. Each dict requires an id and text key.
Returns: Dict[str, Any] - A dictionary confirming the documents were queued. Raises: NamespaceNotFound, InvalidInputError.
Upload Documents Example

vectors.upload

Uploads pre-computed vectors to a vector namespace. This is a synchronous operation.

Parameters

namespace_name
str
required
The name of the target vector namespace.
vectors
List[Dict]
required
A list of dictionaries. Each dict requires an id and a vector key.
Returns: Dict[str, Any] - A dictionary confirming the upload status. Raises: NamespaceNotFound, InvalidInputError.
Upload Vectors Example

documents.delete

Deletes specific documents from a text namespace by their IDs.

Parameters

namespace_name
str
required
The name of the target text namespace.
ids
List[Union[str, int]]
required
A list of document IDs to delete.
Returns: Dict[str, Any] - A dictionary confirming the deletion status.
Delete Documents Example

vectors.delete

Deletes specific vectors from a vector namespace by their IDs.

Parameters

namespace_name
str
required
The name of the target vector namespace.
ids
List[Union[str, int]]
required
A list of vector IDs to delete.
Returns: Dict[str, Any] - A dictionary confirming the deletion status.
Delete Vectors Example

Complete Data Management Example

Complete Data Management Workflow

Document Structure Best Practices

Required Fields

  • id: Unique identifier for the document (string or number)
  • text: The main content to be searched (string)

Optional Metadata

You can include any additional fields as metadata:
Well-Structured Documents

Vector Data Structure

For vector uploads, ensure your vectors match the namespace dimension:
Vector Structure

Important Notes

Asynchronous Processing: Text documents are processed asynchronously. Allow a few seconds after upload before searching.
ID Uniqueness: Document and vector IDs must be unique within their namespace. Uploading with an existing ID will overwrite the previous entry.
Batch Processing: For large datasets, upload documents in batches of 100-1000 items for optimal performance.