Skip to main content

namespaces.create

Creates a new namespace for storing data.

Parameters

namespace_name
str
required
A unique name for the namespace.
type
str
required
The type of namespace: “text” or “vector”.
vector_dimension
Optional[int]
The dimension of vectors. Required only if type is “vector”.
Returns: 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

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