Skip to main content

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

Quick Start

  1. Install the package pip install kion-vectorstore

  2. 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

  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 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


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.1.1.tar.gz (27.1 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.1.1-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kion_vectorstore-0.1.1.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

Hashes for kion_vectorstore-0.1.1.tar.gz
Algorithm Hash digest
SHA256 01940dd1f1990c7d5d6f5af2810cf915123b5f5ca111e5f929c7d2cf6a52db2c
MD5 d143d3a37aac65d0d1fc870dd413459c
BLAKE2b-256 d05cd9e2f793ff28c599e326279c801ea876a1d8a20c990f0210497c631e633d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kion_vectorstore-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00f2cd4cab21b1bc246d8e25e2b01aff1b8f5a841421d5e51731203c190e4de3
MD5 b60e09b2beb13ccd3ae4d06705f0c6e2
BLAKE2b-256 cd94b81d8dcdbe73b7a0077ee4916a8758f08d61027f168bfe15d94f757e9733

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