File size: 1,328 Bytes
5ea1a28
78995aa
 
1e1638d
 
5ea1a28
5b797ed
5ea1a28
 
 
 
 
1e1638d
 
 
 
 
 
 
 
6e47c47
1e1638d
 
 
 
 
 
 
5b797ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
title: Haystack and MongoDB Integrated chat
emoji: 🍃
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 4.37.2
app_file: app.py
pinned: false
license: apache-2.0
---

This simple ChatBot is designed to communicate with MongoDB Atlas Vector Search via Haystack [integration](https://haystack.deepset.ai/integrations/mongodb). 

It uses OpenAI  embeddings to query the database for semantic similarity search.

## How to setup your own

1. [Create an Atlas cluter](https://www.mongodb.com/docs/atlas/tutorial/deploy-free-tier-cluster/) (free clusters are available)
2. Load [sample data](https://www.mongodb.com/docs/atlas/sample-data/)
3. Deploy the relevant [Vector Index](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-tutorial/#create-the-atlas-vector-search-index) on `sample_mflix.haystack_embedded_movies` with 1536 dimensions.
     - [Whitelist](https://www.mongodb.com/docs/atlas/security/ip-access-list/#std-label-access-list) access from everywhere (`0.0.0.0/0`)
     - Locate your [cluster connection](https://www.mongodb.com/docs/atlas/tutorial/connect-to-your-cluster/) URI 
5. Obtain your Open AI api key
6. "Duplicate" this space and input
     - `MONGO_CONNECTION_STRING` - Your Atlas Cluster connection string
     - `OPENAI_API_KEY`- Open AI API key

Build and query the chat!