{"id":16122338,"url":"https://github.com/uezo/vsslite","last_synced_at":"2025-10-23T02:47:06.060Z","repository":{"id":199302336,"uuid":"702619285","full_name":"uezo/vsslite","owner":"uezo","description":"A vector similarity search engine for humans🥳","archived":true,"fork":false,"pushed_at":"2023-10-30T23:30:44.000Z","size":92,"stargazers_count":18,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T17:08:06.169Z","etag":null,"topics":["chatgpt","chromadb","langchain","sqlite","vector-search","vector-similarity-search"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uezo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-09T16:54:32.000Z","updated_at":"2025-02-01T19:00:43.000Z","dependencies_parsed_at":"2024-10-27T18:12:34.877Z","dependency_job_id":"d8634357-65f8-458e-aff2-bf5e19ec756e","html_url":"https://github.com/uezo/vsslite","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"e5826af7abe86ade97bf3beb2008570936db3973"},"previous_names":["uezo/vsslite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uezo%2Fvsslite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uezo%2Fvsslite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uezo%2Fvsslite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uezo%2Fvsslite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uezo","download_url":"https://codeload.github.com/uezo/vsslite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244210836,"owners_count":20416532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chromadb","langchain","sqlite","vector-search","vector-similarity-search"],"created_at":"2024-10-09T21:10:40.404Z","updated_at":"2025-10-23T02:47:05.954Z","avatar_url":"https://github.com/uezo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VSSLite\n\nA vector similarity search engine for humans🥳\n\n\n# 🎁 Install\n\n```sh\n$ pip install vsslite\n```\n\n\n# ✨ Features\n\nVSSLite provides a user-friendly interface for langchain and sqlite-vss.\n\n\n## 🧩 Start API server\n\n```sh\n$ export OPENAI_APIKEY=\"YOUR_API_KEY\"\n$ python -m vsslite\n```\n\nOr\n\n```python\nimport uvicorn\nfrom vsslite import LangChainVSSLiteServer\n\napp = LangChainVSSLiteServer(YOUR_API_KEY).app\nuvicorn.run(app, host=\"127.0.0.1\", port=8000)\n```\n\nGo http://127.0.0.1:8000/docs to know the details and try it out.\n\n\n## 🔍 Search\n\n```python\nfrom vsslite import LangChainVSSLiteClient\n\n# Initialize\nvss = LangChainVSSLiteClient()\n\n# Add data with embeddings\nvss.add(\"The difference between eel and conger eel is that eel is more expensive.\")\nvss.add(\"Red pandas are smaller than pandas, but when it comes to cuteness, there is no \\\"lesser\\\" about them.\")\nvss.add(\"There is no difference between \\\"Ohagi\\\" and \\\"Botamochi\\\" themselves; they are used interchangeably depending on the season.\")\n\n# Search\nprint(vss.search(\"fish\", count=1))\nprint(vss.search(\"animal\", count=1))\nprint(vss.search(\"food\", count=1))\n```\n\nNow you can get these search results.\n\n```bash\n$ python run.py\n\n[{'page_content': 'The difference between eel and conger eel is that eel is more expensive.', 'metadata': {'source': 'inline'}}]\n[{'page_content': 'Red pandas are smaller than pandas, but when it comes to cuteness, there is no \"lesser\" about them.', 'metadata': {'source': 'inline'}}]\n[{'page_content': 'There is no difference between \"Ohagi\" and \"Botamochi\" themselves; they are used interchangeably depending on the season.', 'metadata': {'source': 'inline'}}]\n```\n\n## 🔧 Data management (Add, Get, Update, Delete)\n\nHelps CRUD.\n\n```python\n# Add\nid = vss.add(\"The difference between eel and conger eel is that eel is more expensive.\")[0]\n# Get\nvss.get(id)\n# Update\nvss.update(id, \"The difference between eel and conger eel is that eel is more expensive. Una-jiro is cheaper than both of them.\")\n# Delete\nvss.delete(id)\n# Delete all\nvss.delete_all()\n```\n\nUpload data. Accept Text, PDF, CSV and JSON for now.\n\n```python\nvss.upload(\"path/to/data.json\")\n```\n\n\n## 🍻 Asynchronous\n\nUse async methods when you use VSSLite in server apps.\n\n```python\nawait vss.aadd(\"~~~\")\nawait vss.aupdate(id, \"~~~\")\nawait vss.aget(id)\nawait vss.adelete(id)\nawait vss.aupdate_all()\nawait vss.asearch(\"~~~\")\nawait vss.aupload(\"~~~\")\n```\n\n\n## 🧇 Namespace\n\nVSSLite supports namespaces for dividing the set of documents to search or update.\n\n```python\nvss = LangChainVSSLiteClient()\n\n# Search product documents\nvss.search(\"What is the difference between super size and ultra size?\", namespace=\"product\")\n# Search company documents\nvss.search(\"Who is the CTO of Unagiken?\", namespace=\"company\")\n```\n\n\n# 🌐 Web UI\n\nYou can quickly launch a Q\u0026A web service based on documents 🚅\n\n## Install dependency\n\n```sh\n$ pip install streamlit\n$ pip install streamlit-chat\n```\n\n## Make a script\n\nThis is an example for OpenAI terms of use (upload terms of use to VSSServer with namespace `openai`).\nSave this script as `runui.py`.\n\n```python\nimport asyncio\nfrom vsslite.chat import (\n    ChatUI,\n    VSSQAFunction\n)\n\n# Setup QA function\nopenai_qa_func = VSSQAFunction(\n    name=\"get_openai_terms_of_use\",\n    description=\"Get information about terms of use of OpenAI services including ChatGPT.\",\n    parameters={\"type\": \"object\", \"properties\": {}},\n    namespace=\"openai\",\n    # answer_lang=\"Japanese\",  # \u003c- Uncomment if you want to get answer in Japanese\n    # is_always_on=True,  # \u003c- Uncomment if you want to always fire this function\n    verbose=True\n)\n\n# Start app\nchatui = ChatUI(temperature=0.5, functions=[openai_qa_func])\nasyncio.run(chatui.start())\n```\n\n## Start UI\n\n```sh\n$ streamlit run runui.py\n```\n\nSee https://docs.streamlit.io to know more about Streamlit.\n\n\n\n# 💬 LINE Bot\n\nYou can quickly launch a LINE Bot based on documents 🛫\n\n## Install dependency\n\n```sh\n$ pip install aiohttp line-bot-sdk\n```\n\n## Make a script\n\nThis is an example for OpenAI terms of use (upload terms of use to VSSServer with namespace `openai`).\nSave this script as `line.py`.\n\n```python\nimport os\nfrom vsslite.chatgpt_processor import VSSQAFunction\nfrom vsslite.line import LineBotServer\n\n# Setup QA function(s)\nfrom vsslite.chatgpt_processor import VSSQAFunction\nopenai_qa_func = VSSQAFunction(\n    name=\"get_openai_terms_of_use\",\n    description=\"Get information about terms of use of OpenAI services including ChatGPT.\",\n    parameters={\"type\": \"object\", \"properties\": {}},\n    vss_url=os.getenv(\"VSS_URL\") or \"http://127.0.0.1:8000\",\n    namespace=\"openai\",\n    # answer_lang=\"Japanese\",  # \u003c- Uncomment if you want to get answer in Japanese\n    # is_always_on=True,  # \u003c- Uncomment if you want to always fire this function\n    verbose=True\n)\n\napp = LineBotServer(\n    channel_access_token=YOUR_CHANNEL_ACCESS_TOKEN,\n    channel_secret=YOUR_CHANNEL_SECRET,\n    endpoint_path=\"/linebot\",   # \u003c- Set \"https://your_domain/linebot\" to webhook url at LINE Developers\n    functions=[openai_qa_func]\n).app\n```\n\n## Start LINE Bot Webhook Server\n\n```sh\n$ uvicorn line:app --host 0.0.0.0 --port 8002\n```\n\nSet `https://your_domain/linebot`` to webhook url at LINE Developers.\n\n\n# 🐳 Docker\n\nIf you want to start VSSLite API with chat console, use `docker-compose.yml` in examples.\n\nSet your OpenAI API Key in vsslite.env and execute the command below:\n\n```sh\n$ docker-compose -p vsslite --env-file vsslite.env up -d --build\n```\n\nOr, use Dockerfile to start each service separately.\n\n```sh\n$ docker build -t vsslite-api -f Dockerfile.api .\n$ docker run --name vsslite-api --mount type=bind,source=\"$(pwd)\"/vectorstore,target=/app/vectorstore -d -p 8000:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY vsslite-api:latest\n```\n```sh\n$ docker build -t vsslite-chat -f Dockerfile.chat .\n$ docker run --name vsslite-chat -d -p 8001:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY vsslite-chat:latest\n```\n\n# 🌊 Using Azure OpenAI Service\n\nVSSLite supports Azure OpenAI Service👍\n\n## API Server\n\nUse `OpenAIEmbeddings` configured for Azure.\n\n```python\nfrom langchain.embeddings import OpenAIEmbeddings\nazure_embeddings = OpenAIEmbeddings(\n    openai_api_type=\"azure\",\n    openai_api_base=\"https://your-endpoint.openai.azure.com/\",\n    openai_api_version=\"2023-08-01-preview\",\n    deployment=\"your-embeddings-deployment-name\"\n)\n\napp = LangChainVSSLiteServer(\n    apikey=YOUR_API_KEY or os.getenv(\"OPENAI_API_KEY\"),\n    persist_directory=\"./vectorstore\",\n    chunk_size=500,\n    chunk_overlap=0,\n    embedding_function=azure_embeddings\n).app\n```\n\n## Chat UI\n\nCreate `ChatUI` with Azure OpenAI Service configurations.\n\n```python\nchatui = ChatUI(\n    apikey=YOUR_API_KEY or os.getenv(\"OPENAI_API_KEY\"),\n    temperature=0.5,\n    functions=[openai_qa_func],\n    # Config for Azure OpenAI Service\n    api_type=\"azure\",\n    api_base=\"https://your-endpoint.openai.azure.com/\",\n    api_version=\"2023-08-01-preview\",\n    engine=\"your-embeddings-deployment-name\"\n)\n```\n\nSee also the [examples](https://github.com/uezo/vsslite/tree/main/examples).\n\n\n# 🍪 Classic version (based on SQLite)\n\nSee [v0.3.0 README](https://github.com/uezo/vsslite/blob/6cee7e0421b893ed9e16fba0508e025270e2550a/README.md)\n\n\n# 🥰 Special thanks\n\n- sqlite-vss: https://github.com/asg017/sqlite-vss\n- https://note.com/mahlab/n/n5d59b19be573\n- https://qiita.com/Hidetoshi_Kawaguchi/items/f84f7a43d5d1c15a5a17\n- https://zenn.dev/koron/articles/8925963f432361\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuezo%2Fvsslite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuezo%2Fvsslite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuezo%2Fvsslite/lists"}