kion-vectorstore


Namekion-vectorstore JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/Thoriso-Molefe/kion-vectorstore
SummaryKion Consulting: Postgres (pgvector) vector database file management library and web GUI.
upload_time2025-11-05 07:17:41
maintainerNone
docs_urlNone
authorKion Consulting
requires_python>=3.8
licenseMIT License Copyright (c) 2025 Kion Consulting Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pgvector postgresql rag vectorstore flask openai
VCS
bugtrack_url
requirements python-dotenv flask flask-cors langchain langchain_community langchain_text_splitters langchain-openai psycopg2-binary pypdf pgvector
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
- 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
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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Thoriso-Molefe/kion-vectorstore",
    "name": "kion-vectorstore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pgvector, postgresql, rag, vectorstore, flask, openai",
    "author": "Kion Consulting",
    "author_email": "Kion Consulting <thoriso@kion.co.za>",
    "download_url": "https://files.pythonhosted.org/packages/79/a2/05bc21968a57a782e7423b981073929b383886f8d90875da46af50d9e688/kion_vectorstore-0.2.1.tar.gz",
    "platform": null,
    "description": "# kion_vectorstore\r\n\r\nLicense: MIT\r\n\r\nOverview\r\nkion_vectorstore is a Python library and GUI application for managing vector stores in PostgreSQL (with pgvector).\r\nIt lets you upload ONLY PDFs or .txt files, organize them into collections, perform semantic search, and query them via an OpenAI-powered chat UI.\r\nYou can also delete files or whole collections from a simple web interface.\r\n\r\nFeatures\r\n- Upload PDFs and text files\r\n- Organize documents into named collections\r\n- OpenAI-powered semantic search across selected collections\r\n- Delete individual files or entire empty collections\r\n- Use functions programmatically in Python\r\n- Simple Flask-based web UI\r\n\r\nPrerequisites\r\n- Python 3.8+\r\n- PostgreSQL installed locally or reachable on your network\r\n- pgvector extension enabled in your database\r\n  See: https://github.com/pgvector/pgvector\r\n\r\nQuick Start\r\n1) Install the package\r\n   pip install kion-vectorstore\r\n\r\n2) Create a .env file (once per project) using the CLI\r\n   env-init --path \"<-your folder name->\" \r\n      - This folder is MANDATORY as it will store your .env file: \r\n         (*Not entering a folder name or storing the .env file directly in the project folder will result in errors*)\r\n      - Enter *ONLY* the name of the folder (*DO NOT ENTER A PATH*)\r\n      - To overwrite existing .env, simply add the --force flag:\r\n         *e.g. env-init --path \"env\" --force*\r\n\r\n3) Fill in your .env\r\n   OPENAI_API_KEY=sk-...\r\n   OPENAI_MODEL=gpt-4o-mini\r\n   OPENAI_EMBEDDING_MODEL=text-embedding-3-small\r\n   PGHOST=localhost\r\n   PGUSER=postgres\r\n   PGPASSWORD=yourpassword\r\n   PGDATABASE=yourdb\r\n   PGPORT=5432\r\n\r\n4) Launch the web app\r\n   - Locate the *\"app.py\"* in the folder where you store your .env file\r\n   - Run the *\"app.py\"* file\r\n   The app will open http://127.0.0.1:5000/ in your browser.\r\n\r\nUsing the Web UI\r\n- File Loader tab: upload .txt or .pdf files to a collection (set chunk size/overlap)\r\n- Remove Files tab: select a collection, list files, and delete\r\n- Chat tab: pick collections and ask questions; the assistant answers using only your documents\r\n\r\nProgrammatic Use - Use as library\r\n  Initialize config once in your Python script, then use the plugin:\r\n  from kion_vectorstore.pgvector_plugin import PGVectorPlugin\r\n  from kion_vectorstore.config import Config\r\n  from kion_vectorstore.file_loader import FileLoader\r\n  from kion_vectorstore.text_file_loader import KionTextFileLoader\r\n  from kion_vectorstore.pdf_file_loader import KionPDFFileLoader\r\n\r\n  initialize_config(\".env\")\r\n  embeddings = OpenAIEmbeddings()  # uses OPENAI_API_KEY from .env file\r\n\r\n  Example Usage:\r\n   db = PGVectorPlugin(embedding_model=embeddings)\r\n   print(db.list_collections())\r\n\r\nNotes\r\n- This package ships a .env template inside the package. The env-init CLI copies it to your project.\r\n- Static HTML files are served from within the installed package; you do not need to copy them.\r\n\r\nTroubleshooting\r\n- If you see \"Configuration has not been initialized\", ensure your .env exists and initialize_config has been called (the web app does this automatically).\r\n- Ensure the pgvector extension is installed in your database\r\n- The kion_pg tables are created on first insert.\r\n\r\nLicense\r\nMIT \u00a9 2025 Kion Consulting\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2025 Kion Consulting\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE.",
    "summary": "Kion Consulting: Postgres (pgvector) vector database file management library and web GUI.",
    "version": "0.2.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Thoriso-Molefe/kion_vectorstore/issues",
        "Documentation": "https://github.com/Thoriso-Molefe/kion_vectorstore",
        "Homepage": "https://github.com/Thoriso-Molefe/kion_vectorstore"
    },
    "split_keywords": [
        "pgvector",
        " postgresql",
        " rag",
        " vectorstore",
        " flask",
        " openai"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "32d386c0b6188b3d1cffbcf1f210bca7d7e7440d921da67ac5ecded4c7093a5a",
                "md5": "08739aaa08ddfd87331a2ddb04e24c63",
                "sha256": "61ebd0e4c32828bf39295b41704bdb0da1b0319638bb2c35e61500fbf71eead8"
            },
            "downloads": -1,
            "filename": "kion_vectorstore-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "08739aaa08ddfd87331a2ddb04e24c63",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 52035,
            "upload_time": "2025-11-05T07:17:39",
            "upload_time_iso_8601": "2025-11-05T07:17:39.335768Z",
            "url": "https://files.pythonhosted.org/packages/32/d3/86c0b6188b3d1cffbcf1f210bca7d7e7440d921da67ac5ecded4c7093a5a/kion_vectorstore-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "79a205bc21968a57a782e7423b981073929b383886f8d90875da46af50d9e688",
                "md5": "1eebffb317adcfd40aedf5cce72b0166",
                "sha256": "a612f687deaf461ed18f785806201f4dc3ba2f284ecd15002a660bc560f6db29"
            },
            "downloads": -1,
            "filename": "kion_vectorstore-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1eebffb317adcfd40aedf5cce72b0166",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 41861,
            "upload_time": "2025-11-05T07:17:41",
            "upload_time_iso_8601": "2025-11-05T07:17:41.467975Z",
            "url": "https://files.pythonhosted.org/packages/79/a2/05bc21968a57a782e7423b981073929b383886f8d90875da46af50d9e688/kion_vectorstore-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-05 07:17:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Thoriso-Molefe",
    "github_project": "kion-vectorstore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "python-dotenv",
            "specs": []
        },
        {
            "name": "flask",
            "specs": []
        },
        {
            "name": "flask-cors",
            "specs": []
        },
        {
            "name": "langchain",
            "specs": []
        },
        {
            "name": "langchain_community",
            "specs": []
        },
        {
            "name": "langchain_text_splitters",
            "specs": []
        },
        {
            "name": "langchain-openai",
            "specs": []
        },
        {
            "name": "psycopg2-binary",
            "specs": []
        },
        {
            "name": "pypdf",
            "specs": []
        },
        {
            "name": "pgvector",
            "specs": []
        }
    ],
    "lcname": "kion-vectorstore"
}
        
Elapsed time: 2.78833s