namespaces.create
Creates a new namespace for storing data.Parameters
A unique name for the namespace.
The type of namespace: “text” or “vector”.
The dimension of vectors. Required only if type is “vector”.
Dict[str, Any] - A dictionary confirming the creation details.
Raises: ConflictError, InvalidInputError.
Examples
Create Text Namespace
Create Vector Namespace
Error Handling
Error Handling Example
Namespace Types
| Feature | Text Namespaces | Vector Namespaces |
|---|---|---|
| Primary Use | Storing and searching text documents | Storing pre-computed vector embeddings |
| Embeddings | Automatically generated by Moorcheh | Provided by you (custom embeddings) |
| Requirements | None | Must specify vector dimension |
| Search Capabilities | Full-text search | Vector similarity search |
| Ideal For | FAQs, documentation, articles | Image embeddings, custom ML models |
Best Practices
- Use descriptive namespace names that indicate their purpose
- Separate different types of content into different namespaces
- Consider your data organization strategy before creating namespaces
- Text namespaces are easier to work with for most use cases
- Only use vector namespaces if you need to provide your own embeddings
Related Operations
- List Namespaces - View all your namespaces
- Delete Namespace - Remove a namespace