https://github.com/toweringcloud/streamlit-vector-search
vector embedding on faiss, postgresql and opensearch using python v3.12.8 + streamlit v1.45.1 + langchain v0.3.25
https://github.com/toweringcloud/streamlit-vector-search
claude cloudflare-kv cloudflare-vectorize elasticsearch faiss gemini mongodb openai opensearch postgresql redis superbase
Last synced: about 1 month ago
JSON representation
vector embedding on faiss, postgresql and opensearch using python v3.12.8 + streamlit v1.45.1 + langchain v0.3.25
- Host: GitHub
- URL: https://github.com/toweringcloud/streamlit-vector-search
- Owner: toweringcloud
- License: mit
- Created: 2025-06-05T15:46:20.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-10T08:50:38.000Z (12 months ago)
- Last Synced: 2025-06-30T09:44:16.758Z (11 months ago)
- Topics: claude, cloudflare-kv, cloudflare-vectorize, elasticsearch, faiss, gemini, mongodb, openai, opensearch, postgresql, redis, superbase
- Language: Python
- Homepage:
- Size: 5.15 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-vector-search
embedding vector search using faiss, postgresql and opensearch with python v3.12.8 + streamlit v1.45.1 + langchain v0.3.25
## how to run
### setup
- install python 3.10 ~ 3.12 LTS and add system path on python & pip
```sh
$ python --version
Python 3.12.8
$ python -m pip install --upgrade pip
$ pip --version
pip 25.1.1 from /usr/lib/python3/dist-packages/pip
$ docker -v
Docker version 28.1.1, build 4eba377
$ docker-compose -v
Docker Compose version v2.35.1-desktop.1
$ ./docker-postgres-pgvector.sh
$ docker exec -it pgvector-db psql -U postgres
(SQL) CREATE DATABASE streamlit_documents;
(SQL) CREATE EXTENSION IF NOT EXISTS vector;
$ docker compose up -d -f docker-compose-opensearch.yml
$ curl -k -u admin:admin https://localhost:9200
$ docker compose up -d -f docker-compose-elasticsearch.yml
$ curl -k https://localhost:19200
```
### config
- runtime option A: venv
```sh
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ pip list
$ deactivate
```
- runtime option B: poetry
```sh
$ pip install poetry==1.8.5
$ poetry shell
$ poetry install
$ poetry show
$ exit
```
### launch
- update runtime secrets in streamlit env
```sh
$ vi .streamlit/secrets.toml
OPENSEARCH_HOST = "localhost"
OPENSEARCH_PORT = 9200
...
OPENSEARCH_INDEX_NAME = "streamlit_documents"
OPENSEARCH_CACHE_INDEX_NAME = "embedding_cache"
```
- run streamlit app in root environment
```sh
$ streamlit run index.py
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
```