Mixedbread

Web Store

Search the web using the same API as your stores. Combine web results with your own data for comprehensive search.

The Web Store lets you search the web using the same familiar Store API. Instead of searching your uploaded documents, it searches the internet and returns results in the same format as regular store searches.

Search the web by using mixedbread/web as a store identifier:

Web Search
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

results = mxbai.stores.search(
    query="latest developments in transformer architectures",
    store_identifiers=["mixedbread/web"],
    top_k=10,
)

for chunk in results.data:
    print(f"Title: {chunk.metadata.get('title')}")
    print(f"URL: {chunk.metadata.get('url')}")
    print(f"Content: {chunk.text[:200]}...")
    print()

Each result includes the page title, the source URL (available in both the filename field and metadata.url), and a relevant excerpt from the page content.

Filtering by Domain

Restrict web results to specific sites, or exclude sites, with a metadata filter on the domain key:

Domain Filter
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

results = mxbai.stores.search(
    query="latest developments in transformer architectures",
    store_identifiers=["mixedbread/web"],
    top_k=10,
    filters={"key": "domain", "operator": "in", "value": ["arxiv.org", "nature.com"]},
)

for chunk in results.data:
    print(f"{chunk.metadata.get('domain')}: {chunk.metadata.get('url')}")
  • eq and in only return results from the listed domains; listing several domains under any works the same way
  • not_eq and not_in exclude the listed domains, as do eq and in under none
  • A domain also matches its subdomains: wikipedia.org covers en.wikipedia.org. You can add a path (nature.com/articles) or filter by top-level domain (.gov)
  • A search accepts at most 20 domains. When you both include and exclude domains, the excluded ones are removed from the included list. Excluding part of an included domain (such as en.wikipedia.org from wikipedia.org) removes those results after the search, so the search can return fewer than top_k results
  • Combining two included lists keeps what both match: wikipedia.org and en.wikipedia.org together only return en.wikipedia.org

Other operators on domain, such as like or regex, return a validation error. Every result carries its host in metadata.domain.

Hybrid Search: Web + Your Data

Combine web results with your own stores for comprehensive search. This is useful when you want to augment your internal knowledge base with up-to-date information from the web.

Hybrid Search
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

results = mxbai.stores.search(
    query="how to implement rate limiting",
    store_identifiers=[
        "mixedbread/web",  # Search the web
        "internal-docs",  # Your documentation store
        "code-examples",  # Your code examples store
    ],
    top_k=15,
)

print(results)

When combining web search with regular stores, results from all sources are merged together and reranked for consistent relevance scoring. The final response contains the top results based on combined relevance across all sources.

Response Format

Web search results follow the same structure as regular store search results:

Response
{
  "object": "list",
  "data": [
    {
      "type": "text",
      "text": "Page title\n\nA relevant excerpt from the page content...",
      "chunk_index": 0,
      "score": 0.95,
      "file_id": "generated-uuid-from-url",
      "filename": "https://example.com/article",
      "store_id": "00000000-0000-0000-0000-000000000001",
      "metadata": {
        "title": "Page Title",
        "url": "https://example.com/article",
        "domain": "example.com",
        "source": "web_search"
      }
    }
  ]
}
  • text: Contains the page title followed by a relevant excerpt
  • filename: The source URL
  • metadata.url: The source URL (same as filename)
  • metadata.title: The page title
  • metadata.domain: The host of the source URL
  • metadata.source: Always "web_search" for web results
  • store_id: Fixed ID for the web store

Considerations

Web search results are always reranked for optimal relevance. Usage counts toward your API rate limits like any other store search. A single search returns at most 20 web results, whatever top_k you ask for; in a hybrid search, top_k still applies in full to your own stores.

Apart from conditions on domain, metadata filters and file_ids do not apply to web search results. In a hybrid search, filters still apply to your own stores, so a domain condition also filters their chunks by a domain metadata field. Results reflect current web content at search time, providing fresh information for your queries.