> ## Documentation Index
> Fetch the complete documentation index at: https://sambanova-systems.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Milvus integration guide

[Milvus](https://milvus.io/) is an open-source vector database designed for building Retrieval-Augmented Generation (RAG) applications. By combining Milvus with SambaNova LLMs, you can create scalable, high-performance RAG pipelines.

## Prerequisites

* A [SambaCloud account](https://cloud.sambanova.ai/?utm_source=milvus\&utm_medium=external\&utm_campaign=cloud_signup)
* A [SambaNova API key](https://cloud.sambanova.ai/apis?utm_source=milvus\&utm_medium=external\&utm_campaign=cloud_signup)
* Python 3.9 or higher
* A running Milvus instance (local or cloud). See the [Milvus quickstart guide](https://milvus.io/docs/quickstart.md) to set one up.

## Installation and setup

<Steps>
  <Step title="Create a virtual environment">
    **macOS/Linux:**

    ```bash theme={}
    python -m venv .venv
    source .venv/bin/activate
    ```

    **Windows:**

    ```bash theme={}
    python -m venv .venv
    .venv\Scripts\activate
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={}
    pip install openai
    pip install pymilvus
    pip install langchain-sambanova
    ```
  </Step>

  <Step title="Set your SambaNova API key">
    ```bash theme={}
    export SAMBANOVA_API_KEY="your-sambanova-api-key"
    ```
  </Step>
</Steps>

## Example use cases

* Build Retrieval-Augmented Generation (RAG) systems
* Store and query embeddings efficiently
* Combine SambaNova LLMs with Milvus for scalable knowledge retrieval

## Example notebooks

You can explore example notebooks to learn how to build RAG systems with SambaCloud and Milvus:

* OpenAI Client guide: [Build RAG with Milvus and SambaCloud](https://github.com/sambanova/integrations/blob/main/milvus/build_RAG_with_milvus_and_SNCloud.ipynb)
* LangChain Connector guide: [RAG with Milvus and SambaCloud using LangChain](https://github.com/sambanova/integrations/blob/main/milvus/langchain_RAG_with_milvus_and_SNCloud.ipynb)

These guides walk you through setting up and integrating the systems to create a functional RAG application.

## Troubleshooting

<AccordionGroup>
  <Accordion title="ModuleNotFoundError: No module named 'pymilvus'">
    Install dependencies with the virtual environment active: `pip install pymilvus`.
  </Accordion>

  <Accordion title="Authentication error or 401 Unauthorized">
    Verify your API key is exported correctly. Get a new key from the [SambaNova API dashboard](https://cloud.sambanova.ai/apis?utm_source=milvus\&utm_medium=external\&utm_campaign=cloud_signup).
  </Accordion>

  <Accordion title="Connection error to Milvus">
    Ensure Milvus is running and accessible. See the [Milvus quickstart guide](https://milvus.io/docs/quickstart.md) for setup instructions.
  </Accordion>
</AccordionGroup>
