### Install Mixedbread SDK (TypeScript) Source: https://www.mixedbread.com/docs/quickstart Installs the Mixedbread SDK for TypeScript, facilitating seamless integration into Node.js applications. ```bash npm install @mixedbread/sdk # or yarn add @mixedbread/sdk # or bun add @mixedbread/sdk ``` -------------------------------- ### Install Mixedbread SDK (Python) Source: https://www.mixedbread.com/docs/quickstart Installs the Mixedbread SDK for Python, enabling programmatic control for building Search with Vector Stores. ```bash pip install mixedbread-sdk ``` -------------------------------- ### Install Mixedbread CLI Source: https://www.mixedbread.com/docs/quickstart Installs the Mixedbread Command Line Interface for streamlined scripting and automation of Vector Store workflows. ```bash npm install -g mixedbread-cli # or yarn global add mixedbread-cli # or bun add -g mixedbread-cli ``` -------------------------------- ### CLI Introduction Source: https://www.mixedbread.com/docs/index Get to know Mixedbread's CLI and its capabilities for streamlining Vector Store operations. ```APIDOC ## Mixedbread CLI Overview ### Description The Mixedbread CLI is a command-line tool designed to simplify the management of Vector Stores. It allows for bulk file uploads, directory synchronization, and integration into CI/CD pipelines. ### Key Features - **Bulk Uploads**: Upload multiple files efficiently. - **Directory Sync**: Keep Vector Stores synchronized with local directories. - **CI/CD Integration**: Automate Vector Store operations in your deployment workflows. ### Installation & Setup Refer to the 'Installation & Setup' guide for instructions on installing and configuring the CLI. ``` -------------------------------- ### Public Knowledge Base Configuration Source: https://www.mixedbread.com/docs/vector-stores/create Example demonstrating the configuration for a public knowledge base Vector Store. ```Python # Example for public knowledge base is not provided in the text. ``` -------------------------------- ### Basic Metadata Filtering Example (Python) Source: https://www.mixedbread.com/docs/vector-stores/metadata-filtering Demonstrates a simple metadata filter to narrow down files by category. This is a fundamental example for understanding filter syntax. ```Python from mixedbread_api.api import Mixedbread client = Mixedbread(api_key="YOUR_API_KEY") response = client.filter_files(filter='category = "example"') ``` -------------------------------- ### Development Environment with Auto-cleanup Source: https://www.mixedbread.com/docs/vector-stores/create Example demonstrating how to configure a Vector Store for a development environment with auto-cleanup policies. ```Python # Example for development environment with auto-cleanup is not provided in the text. ``` -------------------------------- ### Retrieve Vector Store Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Get detailed information about a specific Vector Store. This includes file counts, status, and usage statistics. You can identify the Vector Store by its ID or unique name. ```APIDOC ## GET /vector-stores/{vector_store_identifier} ### Description Retrieves detailed information about a specific Vector Store, including file counts, status, and usage statistics. The Vector Store can be identified by its unique ID or name. ### Method GET ### Endpoint `/vector-stores/{vector_store_identifier}` ### Parameters #### Path Parameters - **vector_store_identifier** (string) - Required - The unique ID or name of the Vector Store. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the Vector Store. - **name** (string) - The unique name assigned to the Vector Store. - **description** (string) - A description of the Vector Store. - **is_public** (boolean) - Indicates if the Vector Store is publicly accessible. - **expires_after** (string) - The expiration policy for the Vector Store. - **file_counts** (object) - Contains counts of files within the Vector Store. - **usage_statistics** (object) - Contains usage statistics for the Vector Store. #### Response Example ```json { "id": "vs_abc123", "name": "MyFirstVectorStore", "description": "Stores embeddings for my primary dataset", "is_public": false, "expires_after": "7d", "file_counts": { "remaining": 100, "completed": 500 }, "usage_statistics": { "total_tokens": 1000000, "total_embedding_requests": 5000 } } ``` ``` -------------------------------- ### Advanced Metadata Filtering Example (Python) Source: https://www.mixedbread.com/docs/vector-stores/metadata-filtering Illustrates a complex, nested metadata filter combining multiple conditions and logical operators. This showcases advanced filtering capabilities. ```Python from mixedbread_api.api import Mixedbread client = Mixedbread(api_key="YOUR_API_KEY") response = client.filter_files(filter='(category = "example" AND "custom-metadata-field" > 10) OR (is_processed = true)') ``` -------------------------------- ### Generate Embeddings with Mixedbread API (Python) Source: https://www.mixedbread.com/docs/inference/embedding This Python code snippet demonstrates how to generate embeddings using the Mixedbread API. It likely involves making an API call with specific model and input data. Ensure you have the necessary API key and client library installed. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.embed( model="mxbai-embed-large-v1", input_data=["This is a sample sentence.", "Another sentence for embedding."] ) print(response.embeddings) ``` -------------------------------- ### Control Number of Search Results (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Adjust the 'top_k' parameter to control the number of search results returned. Start with 10 for most use cases, increase for comprehensive searches, or decrease for faster responses. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_id="YOUR_VECTOR_STORE_ID", query="What are the main causes of climate change?", top_k=5 ) print(response.json()) ``` -------------------------------- ### MCP Server Introduction Source: https://www.mixedbread.com/docs/index Understand how Mixedbread's Model Context Protocol (MCP) Server enhances AI workflows by connecting AI assistants to your Vector Stores. ```APIDOC ## MCP Server Introduction ### Description The MCP Server acts as a bridge between AI assistants (like Claude Desktop, Cursor) and your Mixedbread Vector Stores. It enables these assistants to search and retrieve context directly from your knowledge bases during conversations. ### Benefits - **Enhanced Context**: Provide richer, more relevant context to AI assistants. - **Seamless Integration**: Connect popular AI tools with your data. - **Improved Workflows**: Streamline AI-powered research and development. ### Configuration See the 'Configuration' guide for details on connecting your AI assistant to the MCP Server. ``` -------------------------------- ### Create Vector Store Source: https://www.mixedbread.com/docs/index Creates a new Vector Store to index your data for natural language search. ```APIDOC ## POST /vector-stores ### Description Creates a new Vector Store. ### Method POST ### Endpoint /vector-stores ### Parameters #### Request Body - **name** (string) - Required - The name for the new Vector Store. - **description** (string) - Optional - A description for the Vector Store. ### Request Example ```json { "name": "My New Vector Store", "description": "This store contains documents about AI research." } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created Vector Store. - **name** (string) - The name of the Vector Store. - **created_at** (string) - The timestamp when the Vector Store was created. #### Response Example ```json { "id": "vs-456def", "name": "My New Vector Store", "created_at": "2023-10-27T10:05:00Z" } ``` ``` -------------------------------- ### Vector Stores Overview Source: https://www.mixedbread.com/docs/index Learn how Vector Stores work and what makes them unique. Vector Stores are managed indexes that transform unstructured data into a searchable knowledge base. ```APIDOC ## GET /vector-stores ### Description Retrieves a list of all available Vector Stores. ### Method GET ### Endpoint /vector-stores ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of Vector Stores to return. - **offset** (integer) - Optional - The number of Vector Stores to skip. ### Response #### Success Response (200) - **vector_stores** (array) - A list of Vector Store objects. - **id** (string) - The unique identifier for the Vector Store. - **name** (string) - The name of the Vector Store. - **created_at** (string) - The timestamp when the Vector Store was created. #### Response Example ```json { "vector_stores": [ { "id": "vs-123abc", "name": "My First Vector Store", "created_at": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### File Ingestion with Parsing Options Source: https://www.mixedbread.com/docs/vector-stores/ingest Ingest files into a Vector Store using specified parsing strategies. Choose between 'fast' for speed or 'high_quality' for complex layouts. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.ingest_file( vector_store_id="YOUR_VECTOR_STORE_ID", file="/path/to/your/complex_document.docx", parsing_strategy="high_quality" ) print(response.json()) ``` -------------------------------- ### Basic File Ingestion to Vector Store Source: https://www.mixedbread.com/docs/vector-stores/ingest Upload a single file to a Vector Store. The system automatically processes the content to make it searchable via natural language queries. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.ingest_file( vector_store_id="YOUR_VECTOR_STORE_ID", file="/path/to/your/file.pdf" ) print(response.json()) ``` -------------------------------- ### Advanced Reranking Configuration (Python) Source: https://www.mixedbread.com/docs/vector-stores/search/rerank Allows customization of the reranking process by specifying models, top-k constraints, and metadata inclusion. Useful for fine-tuning reranking performance and data output. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.rerank( query="your search query", documents=[ {"text": "document 1 content", "metadata": {"source": "web"}}, {"text": "document 2 content", "metadata": {"source": "pdf"}} ], rerank=True, rerank_model="mixedbread-ai/mxbai-rerank-base-v1", top_k=5, return_metadata=["source"] ) print(response.results) ``` -------------------------------- ### Create Vector Store with Public Access Source: https://www.mixedbread.com/docs/vector-stores/create Creates a Vector Store with configurable read access. Options include 'Private' (default, organization access only) and 'Public' (anyone with an API key can search). ```Python # Example for creation with public access is not provided in the text. ``` -------------------------------- ### Create Vector Store - Basic Creation Source: https://www.mixedbread.com/docs/vector-stores/create Creates a new Vector Store with default settings. A Vector Store object with a unique ID (UUID) is returned, which can be used as an identifier. ```Python # Example for basic creation is not provided in the text. ``` -------------------------------- ### List all Vector Stores using Python Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Retrieves a paginated list of all Vector Stores within an organization. Supports cursor-based pagination for efficient handling of large numbers of stores. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") # List first page of vector stores response = client.vector_store.list() vector_stores = response.data next_page_token = response.next_page_token # Example of fetching the next page if available # if next_page_token: # response = client.vector_store.list(page_token=next_page_token) # vector_stores.extend(response.data) ``` -------------------------------- ### List Vector Store Files (Python) Source: https://www.mixedbread.com/docs/vector-stores/ingest/manage-vector-store-files Lists all files within the Vector Store. This operation supports cursor-based pagination for efficient retrieval of large datasets. ```python client.beta.vector_stores.files.list(vector_store_id="vector_store_id") ``` -------------------------------- ### Enable Reranking with Default Model (Python) Source: https://www.mixedbread.com/docs/vector-stores/search/rerank Enables reranking using the default model (`mixedbread-ai/mxbai-rerank-large-v2`) with standard settings. This is the simplest way to improve search result relevance. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.rerank( query="your search query", documents=[ {"text": "document 1 content"}, {"text": "document 2 content"} ], rerank=True ) print(response.results) ``` -------------------------------- ### Create Vector Store with Name Source: https://www.mixedbread.com/docs/vector-stores/create Creates a Vector Store and assigns a unique name. Names must be unique within an organization and can be updated. ```Python # Example for creation with name is not provided in the text. ``` -------------------------------- ### File Ingestion with Metadata Source: https://www.mixedbread.com/docs/vector-stores/ingest Ingest files into a Vector Store while adding structured metadata. Metadata enhances organization and enables precise filtering during search operations. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.ingest_file( vector_store_id="YOUR_VECTOR_STORE_ID", file="/path/to/your/document.txt", metadata={ "category": "reports", "year": 2023, "is_public": True } ) print(response.json()) ``` -------------------------------- ### Create Vector Store with Expiration Source: https://www.mixedbread.com/docs/vector-stores/create Creates a Vector Store with automatic cleanup policies based on activity. The `last_active_at` anchor resets the expiration timer on file additions, deletions, or searches. ```Python # Example for creation with expiration is not provided in the text. ``` -------------------------------- ### Perform a Basic Vector Store Search (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Search your Vector Store using natural language to find relevant content. Results are ranked by relevance with confidence scores. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_id="YOUR_VECTOR_STORE_ID", query="What is the capital of France?" ) print(response.json()) ``` -------------------------------- ### Retrieve a Vector Store using Python Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Fetches detailed information about a specific Vector Store, including file counts, status, and usage statistics. Requires the Vector Store ID or its unique name. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") # Retrieve by ID vector_store = client.vector_store.retrieve(id="vs_abc123") # Retrieve by name vector_store = client.vector_store.retrieve(name="my_vector_store") ``` -------------------------------- ### Inference API - Reranking Source: https://www.mixedbread.com/docs/index Utilize Mixedbread's reranking models to reorder search results for improved relevance. ```APIDOC ## POST /v1/rerank ### Description Reorders a list of documents based on their relevance to a query using a specified reranking model. ### Method POST ### Endpoint /v1/rerank ### Parameters #### Request Body - **query** (string) - Required - The search query. - **documents** (array of objects) - Required - A list of documents to reorder. - **content** (string) - Required - The text content of the document. - **id** (string) - Required - A unique identifier for the document. - **model** (string) - Required - The ID of the reranking model to use (e.g., "mixedbread-rerank-lightweight"). ### Request Example ```json { "query": "What is multimodal search?", "documents": [ { "content": "Multimodal search allows searching across different types of data, like text and images.", "id": "doc-1" }, { "content": "Mixedbread focuses on fast and efficient search capabilities.", "id": "doc-2" } ], "model": "mixedbread-rerank-lightweight" } ``` ### Response #### Success Response (200) - **results** (array) - A list of reranked document objects. - **document** (object) - The original document object. - **content** (string) - The text content of the document. - **id** (string) - A unique identifier for the document. - **relevance_score** (float) - The relevance score assigned to the document. - **model** (string) - The ID of the model used. #### Response Example ```json { "results": [ { "document": { "content": "Multimodal search allows searching across different types of data, like text and images.", "id": "doc-1" }, "relevance_score": 0.95 }, { "document": { "content": "Mixedbread focuses on fast and efficient search capabilities.", "id": "doc-2" }, "relevance_score": 0.70 } ], "model": "mixedbread-rerank-lightweight" } ``` ``` -------------------------------- ### Update a Vector Store's configuration using Python Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Allows modification of an existing Vector Store's configuration. Updatable properties include name, description, visibility (is_public), and expiration policy (expires_after). ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") # Update name and description client.vector_store.update( id="vs_abc123", name="new_vector_store_name", description="Updated description for the vector store." ) # Update visibility to public client.vector_store.update(id="vs_abc123", is_public=True) # Remove expiration policy client.vector_store.update(id="vs_abc123", expires_after=None) ``` -------------------------------- ### List Vector Stores Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Retrieve a list of all Vector Stores within your organization. This operation supports cursor-based pagination to handle large numbers of Vector Stores efficiently. ```APIDOC ## GET /vector-stores ### Description Retrieves a list of all Vector Stores in the organization. This API uses cursor-based pagination to manage potentially large result sets. ### Method GET ### Endpoint `/vector-stores` ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of Vector Stores to return in the response. - **after** (string) - Optional - A cursor for retrieving the next page of results. - **before** (string) - Optional - A cursor for retrieving the previous page of results. ### Response #### Success Response (200) - **data** (array) - An array of Vector Store objects. - Each object contains: `id`, `name`, `description`, `is_public`, `expires_after`. - **has_more** (boolean) - Indicates if there are more Vector Stores available beyond the current page. - **next_cursor** (string) - A cursor for fetching the next page of results, if `has_more` is true. #### Response Example ```json { "data": [ { "id": "vs_abc123", "name": "MyFirstVectorStore", "description": "Stores embeddings for my primary dataset", "is_public": false, "expires_after": "7d" }, { "id": "vs_def456", "name": "SecondaryVectorStore", "description": "Embeddings for secondary data", "is_public": true, "expires_after": null } ], "has_more": true, "next_cursor": "cursor_xyz789" } ``` ``` -------------------------------- ### Code Metadata Structure Source: https://www.mixedbread.com/docs/vector-stores/ingest/generated-metadata For source files like Python, TypeScript, Java, and C#, the metadata includes type, file type, detected programming language, an approximate tokenized word count, and file size. ```json { "type": "code", "file_type": "text/x-python", "language": "Python", "word_count": 300, "file_size": 5120 } ``` -------------------------------- ### List Vector Store Files with Metadata Filter (Python) Source: https://www.mixedbread.com/docs/vector-stores/ingest/manage-vector-store-files Filters files in the Vector Store based on their associated metadata. This allows for targeted retrieval of files using various filter operators and logical operations. ```python client.beta.vector_stores.files.list(vector_store_id="vector_store_id", filter={'user_id': 'user_123'}) ``` -------------------------------- ### Retrieve Vector Store File Information (Python) Source: https://www.mixedbread.com/docs/vector-stores/ingest/manage-vector-store-files Retrieves detailed information about a specific file in the Vector Store using its file ID. The response includes processing status, metadata, usage statistics, and error details. ```python client.beta.vector_stores.files.retrieve("file_id") ``` -------------------------------- ### Search for Complete Files in Vector Store (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Retrieve entire files rather than individual content chunks. Ideal for document discovery, content exploration, and research, providing document-level context. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.file_search( vector_store_id="YOUR_VECTOR_STORE_ID", query="Find research papers on machine learning", top_k=3 ) print(response.json()) ``` -------------------------------- ### Inference API - Embedding Source: https://www.mixedbread.com/docs/index Access Mixedbread's powerful embedding models for creating vector representations of your data. ```APIDOC ## POST /v1/embeddings ### Description Generates embeddings for a given list of texts using a specified model. ### Method POST ### Endpoint /v1/embeddings ### Parameters #### Request Body - **input** (array of strings) - Required - The list of texts to embed. - **model** (string) - Required - The ID of the model to use for embedding (e.g., "mixedbread-e5-large"). ### Request Example ```json { "input": [ "What is Mixedbread?", "How do I use the CLI?" ], "model": "mixedbread-e5-large" } ``` ### Response #### Success Response (200) - **data** (array) - A list of embedding objects. - **embedding** (array of floats) - The generated embedding vector. - **index** (integer) - The index of the input text. - **model** (string) - The ID of the model used. - **usage** (object) - Information about the token usage. - **prompt_tokens** (integer) - The number of tokens in the prompt. - **total_tokens** (integer) - The total number of tokens processed. #### Response Example ```json { "data": [ { "embedding": [ 0.0023, -0.0045, ... ], "index": 0 }, { "embedding": [ -0.0123, 0.0089, ... ], "index": 1 } ], "model": "mixedbread-e5-large", "usage": { "prompt_tokens": 10, "total_tokens": 10 } } ``` ``` -------------------------------- ### Search Across Multiple Vector Stores (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Query multiple Vector Stores simultaneously to gather information from diverse sources. Results are merged and re-ranked together. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_ids=["VS_ID_1", "VS_ID_2", "VS_ID_3"], query="Compare different programming languages" ) print(response.json()) ``` -------------------------------- ### Update Vector Store Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Modify the configuration of an existing Vector Store. You can update its name, description, visibility (public/private), or expiration policy. ```APIDOC ## PUT /vector-stores/{vector_store_identifier} ### Description Updates the configuration of an existing Vector Store. You can modify properties such as the name, description, visibility, and expiration policy. The Vector Store can be identified by its unique ID or name. ### Method PUT ### Endpoint `/vector-stores/{vector_store_identifier}` ### Parameters #### Path Parameters - **vector_store_identifier** (string) - Required - The unique ID or name of the Vector Store to update. #### Request Body - **name** (string) - Optional - The new unique identifier for the Vector Store. - **description** (string) - Optional - A new description for the Vector Store. - **is_public** (boolean) - Optional - Sets the visibility of the Vector Store (true for public, false for private). - **expires_after** (string) - Optional - Sets or modifies the expiration policy (e.g., "7d" for 7 days, or null to remove expiration). ### Request Example ```json { "name": "UpdatedVectorStoreName", "description": "An updated description for the vector store.", "is_public": true, "expires_after": null } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the updated Vector Store. - **name** (string) - The updated unique name. - **description** (string) - The updated description. - **is_public** (boolean) - The updated visibility setting. - **expires_after** (string) - The updated expiration policy. #### Response Example ```json { "id": "vs_abc123", "name": "UpdatedVectorStoreName", "description": "An updated description for the vector store.", "is_public": true, "expires_after": null } ``` ``` -------------------------------- ### Delete a Vector Store using Python Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Permanently removes a Vector Store and all its associated content, including files, embeddings, and metadata. This action is irreversible. ```Python from mixedbread_api import Client client = Client("YOUR_API_KEY") # Delete by ID client.vector_store.delete(id="vs_abc123") # Delete by name client.vector_store.delete(name="my_vector_store") ``` -------------------------------- ### Text Metadata Structure Source: https://www.mixedbread.com/docs/vector-stores/ingest/generated-metadata Plain text chunks receive a simpler metadata structure, including type, file type, detected language, word count, and file size. ```json { "type": "text", "file_type": "text/plain", "language": "English", "word_count": 200, "file_size": 2048 } ``` -------------------------------- ### Delete Vector Store Source: https://www.mixedbread.com/docs/vector-stores/create/manage-vector-stores Permanently remove a Vector Store and all its associated files, embeddings, and metadata. This action is irreversible. ```APIDOC ## DELETE /vector-stores/{vector_store_identifier} ### Description Permanently deletes a Vector Store and all its contents, including files, embeddings, and metadata. This operation is irreversible. The Vector Store can be identified by its unique ID or name. ### Method DELETE ### Endpoint `/vector-stores/{vector_store_identifier}` ### Parameters #### Path Parameters - **vector_store_identifier** (string) - Required - The unique ID or name of the Vector Store to delete. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the deleted Vector Store. - **deleted** (boolean) - Indicates that the Vector Store has been successfully deleted. #### Response Example ```json { "id": "vs_abc123", "deleted": true } ``` ``` -------------------------------- ### PDF Metadata Structure Source: https://www.mixedbread.com/docs/vector-stores/ingest/generated-metadata PDF chunks are enriched with document-level statistics, including the total number of pages and the total size of the original file. ```json { "type": "pdf", "file_type": "application/pdf", "total_pages": 50, "total_size": 10485760 } ``` -------------------------------- ### Markdown Metadata Structure Source: https://www.mixedbread.com/docs/vector-stores/ingest/generated-metadata When processing markdown files, Mixedbread extracts heading structures. The `generated_metadata` for markdown chunks includes type, file type, detected language, word count, file size, chunk headings, and heading context. ```json { "type": "markdown", "file_type": "text/markdown", "language": "English", "word_count": 150, "file_size": 1024, "chunk_headings": [ { "level": 2, "text": "Configuration" }, { "level": 3, "text": "Environment Variables" } ], "heading_context": [ { "level": 2, "text": "Configuration" } ] } ``` -------------------------------- ### Rerank Vector Store Search Results (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Improve search result quality by applying a second-stage ranking model. This is particularly useful for complex queries or refining initial results. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_id="YOUR_VECTOR_STORE_ID", query="Explain the impact of AI on modern society", rerank=True ) print(response.json()) ``` -------------------------------- ### Filter Vector Store Search Results by Metadata (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Narrow down search results by applying metadata filters. This allows for more precise querying based on document attributes. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_id="YOUR_VECTOR_STORE_ID", query="Find documents about renewable energy", filter={"source": "news", "year": {"$gt": 2020}} ) print(response.json()) ``` -------------------------------- ### Filter Vector Store Search Results by File (Python) Source: https://www.mixedbread.com/docs/vector-stores/search Filter search results to include only content from specific files within your Vector Store. This is useful for targeted information retrieval. ```python from mixedbread_api import Client client = Client("YOUR_API_KEY") response = client.vector_store.search( vector_store_id="YOUR_VECTOR_STORE_ID", query="Summarize the key findings", files=["report_q3_2023.pdf", "analysis_final.docx"] ) print(response.json()) ``` -------------------------------- ### Delete Vector Store File (Python) Source: https://www.mixedbread.com/docs/vector-stores/ingest/manage-vector-store-files Removes a file from the Vector Store using its file ID. This action permanently deletes the file, its associated chunks, embeddings, metadata, and indexes. ```python client.beta.vector_stores.files.delete(file_id="file_id") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.