Mixedbread
Stores

Create Stores

Stores are AI-powered search indexes that organize your files for semantic search. Choose the right configuration for your use case, from temporary development environments to public knowledge bases.

Basic CreationLink to section

Create a new Store with default settings:

Create Store
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(name="my-knowledge-base")

print(store)

When you create a Store, you get a Store object with a unique ID (UUID). You can use either the ID or the name you provide as Store identifiers in all operations.

For complete details on the Store object structure, see Data Models.

Configuration OptionsLink to section

NameLink to section

Names and IDs are interchangeable identifiers for all operations.

Create Store with Name
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="product-documentation",
    description="Product documentation and FAQs for customer support",
)

print(store)

Naming Rules:

  • Can only contain lowercase letters, numbers, periods (.), and hyphens (-)
  • Must be unique within your organization
  • Can be updated at any time

Expiration PoliciesLink to section

Set automatic cleanup policies to manage Store lifecycle based on activity:

Create Store with Expiration
from mixedbread import Mixedbread
from mixedbread.types import ExpiresAfterParam

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="development-tests",
    expires_after=ExpiresAfterParam(anchor="last_active_at", days=7),
)

print(store)

The last_active_at anchor resets the expiration timer whenever you add files, delete files, or perform searches. Stores never expire unless explicitly configured.

Public AccessLink to section

Control read access to your Store:

Create Store with Public Access
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="public-documentation",
    description="Public API documentation and tutorials",
    is_public=True,
)

print(store)

Private (default): Only your organization can access. You pay all costs.

Public: Anyone with an API key can search. They pay for their own searches.

File contextualizationLink to section

Improve retrieval for long documents by adding global context to individual chunks. When enabled, Mixedbread automatically generates chunk-specific explanatory context from the original file and prepends it to each chunk before embedding.

Create Store with File Contextualization
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="docs-store",
    config={
        "contextualization": {
            "with_file_context": True,
        }
    },
)

print(store)

Metadata contextualizationLink to section

Improve retrieval using metadata by including selected file metadata in each chunk before embedding.

  • false (default): Do not include file metadata
  • true: Include all file metadata (flattened)
  • An array of field names: Include only the selected fields (supports nested fields using dot notation)
Create Store with Metadata Contextualization
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="docs-store",
    config={
        "contextualization": {
            "with_metadata": ["title", "author.name", "category"]
        }
    },
)

print(store)

Configuration GuideLink to section

Use CaseName PatternExpirationPublicPurpose
Developmentdev-{feature}7 daysNoTemporary testing
Production Docsdocs-v{version}NeverYesPublic documentation
Customer Datacustomer-{id}NeverNoPrivate customer content
Demo/POCdemo-{client}30 daysNoTime-limited demos

Combined ConfigurationLink to section

Use multiple configuration options together for specific use cases:

Development Environment with Auto-cleanup
from mixedbread import Mixedbread
from mixedbread.types import ExpiresAfterParam


mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="dev-feature-search",
    description="Development testing for new search feature",
    expires_after=ExpiresAfterParam(anchor="last_active_at", days=7),
)

print(store)

Public Knowledge Base
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

store = mxbai.stores.create(
    name="api-docs-v2",
    description="Public API documentation version 2.0",
    is_public=True,
)

print(store)