Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use_milvus_with_sambanova #1462

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions bootcamp/tutorials/integration/use_milvus_with_sambanova.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Use Milvus with SambaNova

[SambaNova](https://sambanova.ai/) is an innovative AI technology platform that accelerates the deployment of advanced AI and deep learning capabilities. Designed for enterprise use, it empowers organizations to leverage generative AI for enhanced performance and efficiency. By providing cutting-edge solutions like the SambaNova Suite and DataScale, the platform enables businesses to extract valuable insights from their data, driving operational improvements and fostering new opportunities in the AI landscape.

[SambaNova AI Starter Kits](https://github.com/sambanova/ai-starter-kit) are a collection of open-source resources designed to assist developers and enterprises in deploying AI-driven applications with SambaNova. These kits provide practical examples and guides that facilitate the implementation of various AI use cases, making it easier for users to leverage SambaNova's advanced technology.

This tutorial leverages Milvus integration in SambaNova AI Starter Kits to build an Enterprise Knowledge Retrieval system, similar to RAG(Retrieval-Augmented Generation), for retrieval and answering based on the enterprise private documents.

> This tutorial is mainly referred to the [SambaNova AI Starter Kits](https://github.com/sambanova/ai-starter-kit/tree/main) official guide. If you find that this tutorial has outdated parts, you can prioritize following the official guide and create an issue to us.

## Prerequisites

We recommend using Python >= 3.10 and < 3.12.

Visit the [SambaNova Cloud](https://cloud.sambanova.ai/) to get an SambaNova API key.

## Clone the repository
```shell
git clone https://github.com/sambanova/ai-starter-kit.git
cd ai-starter-kit/enterprise_knowledge_retriever
```

## Change the vector store type
Change the vector store by setting `db_type='milvus'` in the `create_vector_store()` and `load_vdb()` functions in `src/document_retrieval.py`.
```python
...
vectorstore = self.vectordb.create_vector_store(
..., db_type='milvus'
)
...
vectorstore = self.vectordb.load_vdb(..., db_type='milvus', ...)
```

## Install dependencies
Install the required dependencies by running the following command:

```shell
python3 -m venv enterprise_knowledge_env
source enterprise_knowledge_env/bin/activate
pip install -r requirements.txt
```

## Start the application

Use the following command to start the application:
```bash
streamlit run streamlit/app.py --browser.gatherUsageStats false
```
After that, you see the user interface in your browser:
`http://localhost:8501/`

![](../../../images/sambanava_ui.png)

After set your SambaNova API key in the UI, you can play around with the UI and ask questions about your documents.

For further details, please refer to the [Enterprise Knowledge Retrieval
of SambaNova AI Starter Kits](https://github.com/sambanova/ai-starter-kit/tree/main/enterprise_knowledge_retriever) official documentation.
Binary file added images/sambanava_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.