Spaces:
Build error
Build error
| """ | |
| Rebuilds the embedded Qdrant vector store on each boot (free tier = no persistence). | |
| Run as: python -m backend.ingest | |
| Keep this idempotent and fast — it runs on every cold start. Point it at seed | |
| documents baked into the image (e.g. backend/seed_docs/) rather than user uploads, | |
| since uploads won't survive a restart anyway. | |
| """ | |
| import os | |
| def main(): | |
| qdrant_path = os.environ.get("QDRANT_PATH", "/home/user/qdrant_data") | |
| # Embedded Qdrant — no server process, just a local path. | |
| # from qdrant_client import QdrantClient | |
| # client = QdrantClient(path=qdrant_path) | |
| # | |
| # 1. read seed docs (Docling parse) | |
| # 2. chunk + embed (your HF embedding model) | |
| # 3. client.recreate_collection(...) then client.upsert(...) | |
| print(f"[ingest] Would rebuild collection at {qdrant_path}") | |
| if __name__ == "__main__": | |
| main() | |