Skip to main content

Kion Consulting: Postgres (pgvector) vector database file management library and web GUI.

Project description

kion_vectorstore

License: MIT

Overview kion_vectorstore is a Python library and GUI application for managing vector stores in PostgreSQL (with pgvector). It lets you upload ONLY 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

Quick Start

  1. Install the package pip install kion-vectorstore

  2. Create a .env file (once per project) using the CLI env-init --path "<-your folder name->"

    • This folder is MANDATORY as it will store your .env file: (Not entering a folder name or storing the .env file directly in the project folder will result in errors)
    • Enter ONLY the name of the folder (DO NOT ENTER A PATH)
    • To overwrite existing .env, simply add the --force flag: e.g. env-init --path "env" --force
  3. 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

  4. Launch the web app

    • Locate the "app.py" in the folder where you store your .env file
    • Run the "app.py" file 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 - Use as library Initialize config once in your Python script, then use the plugin: from kion_vectorstore.pgvector_plugin import PGVectorPlugin from kion_vectorstore.config import Config from kion_vectorstore.file_loader import FileLoader from kion_vectorstore.text_file_loader import KionTextFileLoader from kion_vectorstore.pdf_file_loader import KionPDFFileLoader

initialize_config(".env") embeddings = OpenAIEmbeddings() # uses OPENAI_API_KEY from .env file

Example Usage: 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
  • The kion_pg tables are created on first insert.

License MIT © 2025 Kion Consulting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kion_vectorstore-0.2.2.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kion_vectorstore-0.2.2-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file kion_vectorstore-0.2.2.tar.gz.

File metadata

  • Download URL: kion_vectorstore-0.2.2.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for kion_vectorstore-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ba9cbe0dfab84b25c18f2fa85908d31aa353ce2270b213a6688cecdfd088bcb3
MD5 501410daf49e5b2550e22bd6b017e747
BLAKE2b-256 a795d6c15de9fb0e8cad3590e0c55cad4877d23afde5d04cd247145e9966fca2

See more details on using hashes here.

File details

Details for the file kion_vectorstore-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kion_vectorstore-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 262a5bb30a934fb791ce4889f9702c6ad3847764e78fd9c1a5586e006a28b4b5
MD5 2ac2b98e5bfd46093094ad933bc15826
BLAKE2b-256 3ad20f49c9226be7873e4a8354158b057cb7ead9f73d6d06e1de8cb87ad05ef5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page