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.
Basic Web Search
Search the web by using mixedbread/web as a store identifier:
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:
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')}")
eqandinonly return results from the listed domains; listing several domains underanyworks the same waynot_eqandnot_inexclude the listed domains, as doeqandinundernone- A domain also matches its subdomains:
wikipedia.orgcoversen.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.orgfromwikipedia.org) removes those results after the search, so the search can return fewer thantop_kresults - Combining two included lists keeps what both match:
wikipedia.organden.wikipedia.orgtogether only returnen.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.
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:
{
"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 excerptfilename: The source URLmetadata.url: The source URL (same as filename)metadata.title: The page titlemetadata.domain: The host of the source URLmetadata.source: Always"web_search"for web resultsstore_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.