{"id":50975612,"url":"https://github.com/edgelesssys/privatemode-document-store-demo","last_synced_at":"2026-06-19T07:32:35.448Z","repository":{"id":320149441,"uuid":"1072874733","full_name":"edgelesssys/privatemode-document-store-demo","owner":"edgelesssys","description":"Demonstration of document retrieval using Privatemode","archived":false,"fork":false,"pushed_at":"2026-01-16T15:01:34.000Z","size":119,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-23T00:10:01.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/edgelesssys.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-09T10:27:43.000Z","updated_at":"2026-03-25T23:51:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f56e322-ffb5-49fc-8720-d354889854da","html_url":"https://github.com/edgelesssys/privatemode-document-store-demo","commit_stats":null,"previous_names":["edgelesssys/privatemode-document-store-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edgelesssys/privatemode-document-store-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgelesssys%2Fprivatemode-document-store-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgelesssys%2Fprivatemode-document-store-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgelesssys%2Fprivatemode-document-store-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgelesssys%2Fprivatemode-document-store-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgelesssys","download_url":"https://codeload.github.com/edgelesssys/privatemode-document-store-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgelesssys%2Fprivatemode-document-store-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34522035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-19T07:32:34.089Z","updated_at":"2026-06-19T07:32:35.429Z","avatar_url":"https://github.com/edgelesssys.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Privatemode Document Store (Experimental)\n\nThis is a demo of document storage and retrieval powered by the embeddings and LLM inference services of [Privatemode AI](https://www.privatemode.ai/). The system combines a local ChromaDB vector store with SQLite-based keyword search (BM25) to enable hybrid retrieval. All data remains encrypted end-to-end during embedding and LLM inference in the cloud, ensuring privacy-preserving AI operations.\n\n## 🚀 Getting started\n\n### Prerequisites \n\nMake sure the [Privatemode Proxy](https://docs.privatemode.ai/guides/proxy-configuration) is running. Enable [prompt caching](https://docs.privatemode.ai/guides/proxy-configuration#prompt-caching) in the proxy to reduce latency and cost.\n\n### macOS and Linux\n\nInstall the venv using your favorite method or the provided script:\n\n```bash\nsource scripts/venv.rc\n```\n\nOr with your own env setup:\n\n```bash\npython3.12 -m venv .venv\nsource .venv/bin/activate\npip install -e .[dev]\n```\n\nAfter installation, you can run it locally:\n\n```bash\npython -m privatemode.document_store\n# Optional env overrides:\n# HOST=0.0.0.0 PORT=8081 RELOAD=0 LOG_LEVEL=info python -m privatemode.document_store\n```\n\n### Windows (PowerShell)\n\nInstall Python 3.12 or later from https://www.python.org/downloads/windows/ or Microsoft Store.\n\n```powershell\npy -3.12 -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npython -m pip install -U pip\npip install -e .[dev]\n```\n\nTo run in foreground (dev/testing):\n\n```bash\npython -m privatemode.document_store\n```\n\n## 🛠️ Development\n\nFor installation as background service see [INSTALL.md](INSTALL.md).\n\n### Components\n\n- FastAPI app (`privatemode.document_store`), served by Uvicorn\n- REST API:\n  - GET `/health`\n  - POST `/documents` (store; auto-chunking, stable chunk IDs, metadata with hash and chunk count)\n  - POST `/retrieval/query` (vector search; returns text and scores)\n  - POST `/admin/reset` (wipe data)\n- ChromaDB as vector store\n- Sqlite for keyword search (bm25)\n\n### Environment variables\n\nThe following variables can be set optionally:\n\n- HOST (default 127.0.0.1)\n- PORT (default 8081)\n- RELOAD (0/1; default 0)\n- LOG_LEVEL (debug,info,warning,error; default info)\n- PRIVATEMODE_API_KEY (default: none; i.e., the value configured in the Privatemode proxy)\n- PRIVATEMODE_API_BASE (default: `http://localhost:8080/v1`)\n- VECTOR_DB_PATH (default: ./data/chroma - relative to working directory)\n\n### Smoke test\n\nYou can smoke test a running instance:\n\n```bash\n# Health\ncurl -sf http://127.0.0.1:8081/health \u0026\u0026 echo\n\n# Store a document\ncurl -sS -X POST \"http://127.0.0.1:8081/documents\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"collection\":\"docs\",\"id\":\"readme-smoke\",\"text\":\"hello world\",\"metadata\":{}}'\n\n# Query\ncurl -sS -X POST \"http://127.0.0.1:8081/retrieval/query\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"collection\":\"docs\",\"query\":\"hello world\",\"top_k\":5}'\n```\n\n### Running tests\n\nRun tests with pytest:\n\n```bash\npytest\npytest -vv -s\n```\n\nThe `-vv` flag increases verbosity to show detailed test output.\nThe `-s` flag enables capturing of stdout/stderr, showing print statements and logging in real-time.\n\nRun a single test file or test by name:\n\n```bash\npytest tests/test_health.py\npytest -k health\n```\n\nUseful flags:\n\n- `-x` stop on first failure\n- `-lf` rerun only last failed tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgelesssys%2Fprivatemode-document-store-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgelesssys%2Fprivatemode-document-store-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgelesssys%2Fprivatemode-document-store-demo/lists"}