Kion Consulting: Postgres (pgvector) vector database file management library and web GUI for LangChain.
Project description
kion_vectorstore
License: MIT
Overview kion_vectorstore is a Python library and GUI application for managing vector stores in PostgreSQL (with pgvector) using LangChain. It lets you upload PDFs or .txt files, organize them into collections, perform semantic search, and query them via an OpenAI-powered chat UI. You can also delete files or whole collections from a simple web interface.
Features
- Upload PDFs and text files
- Organize documents into named collections
- OpenAI-powered semantic search across selected collections
- Delete individual files or entire empty collections
- Use functions programmatically in Python
- Simple Flask-based web UI
Prerequisites
- Python 3.8+
- PostgreSQL installed locally or reachable on your network
- pgvector extension enabled in your database See: https://github.com/pgvector/pgvector
Quick Start
-
Install the package pip install kion-vectorstore
-
Create a .env file (once per project) using the CLI env-init --path "C:\Path\To\Your\Project" # Windows example
Add --force to overwrite an existing .env:
env-init --path "C:\Path\To\Your\Project" --force
-
Fill in your .env OPENAI_API_KEY=sk-... OPENAI_MODEL=gpt-4o-mini OPENAI_EMBEDDING_MODEL=text-embedding-3-small PGHOST=localhost PGUSER=postgres PGPASSWORD=yourpassword PGDATABASE=yourdb PGPORT=5432
-
Launch the web app Option A: Use the CLI kion-vectorstore-web
Option B: From Python python -m kion_vectorstore.app
The app will open http://127.0.0.1:5000/ in your browser.
Using the Web UI
- File Loader tab: upload .txt or .pdf files to a collection (set chunk size/overlap)
- Remove Files tab: select a collection, list files, and delete
- Chat tab: pick collections and ask questions; the assistant answers using only your documents
Programmatic Use Initialize config once in your Python script, then use the plugin: from kion_vectorstore import initialize_config, PGVectorPlugin from langchain_openai import OpenAIEmbeddings
initialize_config(".env") embeddings = OpenAIEmbeddings() # uses OPENAI_API_KEY from env db = PGVectorPlugin(embedding_model=embeddings) print(db.list_collections())
Notes
- This package ships a .env template inside the package. The env-init CLI copies it to your project.
- Static HTML files are served from within the installed package; you do not need to copy them.
Troubleshooting
- If you see "Configuration has not been initialized", ensure your .env exists and initialize_config has been called (the web app does this automatically).
- Ensure the pgvector extension is installed in your database, and the required LangChain tables exist (they are created on first insert by langchain_community.vectorstores.PGVector).
License MIT © 2025 Kion Consulting
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kion_vectorstore-0.1.2.tar.gz.
File metadata
- Download URL: kion_vectorstore-0.1.2.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94f37a2c43596d7c7ef96c0b1919e140378cbf84da7332e73d77a3625fbed987
|
|
| MD5 |
b727a6a5ddb9583495546d58d01c51de
|
|
| BLAKE2b-256 |
e0709954f3ed44e4786129efab9248b953323085d235548fefbbc63279bb3b17
|
File details
Details for the file kion_vectorstore-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kion_vectorstore-0.1.2-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5012b78a366cb9396e0648b034fb2b7b7502464695850f0f2ed337d3f14d5a37
|
|
| MD5 |
f5be8eb1a553d74f7ae5a0351346e7f3
|
|
| BLAKE2b-256 |
c6bf6f001ea2845303c36ae59d566deff32932f17aeda18d9f5d6d97cf0a6763
|