From cac6a858d0e580f3e5afd4edcac4eeb115f8eb95 Mon Sep 17 00:00:00 2001 From: george Date: Sat, 6 Jun 2026 12:26:42 +0100 Subject: [PATCH] Fix long ingestion and Qdrant compatibility --- backend/app/ingest.py | 3 ++- backend/requirements.txt | 2 +- mcp-server/requirements.txt | 2 +- webui/app/main.py | 6 +++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/app/ingest.py b/backend/app/ingest.py index 5974788..4283517 100644 --- a/backend/app/ingest.py +++ b/backend/app/ingest.py @@ -154,7 +154,8 @@ async def ingest_library(library_id: str, name: str, description: Optional[str] # Embed chunks and prepare for storage print(f" Chunked into {len(chunks)} pieces (approx. {num_tokens} tokens)") - embeddings = embed_texts(chunks) + # FastEmbed is synchronous and CPU-heavy; keep it off the API event loop. + embeddings = await asyncio.to_thread(embed_texts, chunks) # Build chunk dicts chunk_dicts = [] diff --git a/backend/requirements.txt b/backend/requirements.txt index 6f40768..0251fc0 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -6,7 +6,7 @@ python-dotenv==1.0.0 python-multipart==0.0.6 # Qdrant Vector Store Client -qdrant-client==1.7.0 +qdrant-client==1.18.0 # Text Processing for token estimation tiktoken==0.7.0 diff --git a/mcp-server/requirements.txt b/mcp-server/requirements.txt index 4f76817..19e54e3 100644 --- a/mcp-server/requirements.txt +++ b/mcp-server/requirements.txt @@ -3,7 +3,7 @@ fastmcp==2.12.5 httpx>=0.28.1,<1.0 # For Qdrant vector store operations -qdrant-client==1.7.0 +qdrant-client==1.18.0 # Text processing for token estimation tiktoken==0.7.0 diff --git a/webui/app/main.py b/webui/app/main.py index acc9335..969202b 100644 --- a/webui/app/main.py +++ b/webui/app/main.py @@ -49,7 +49,11 @@ async def run_sync_job(job_id: str, override: bool) -> None: job["status"] = "running" job["started_at"] = utc_now() try: - result = await get_client().post("/sources/sync", json={"override": override}) + result = await get_client().post( + "/sources/sync", + json={"override": override}, + timeout=None, + ) job["result"] = result job["status"] = "succeeded" if result.get("success") else "failed" except Exception as exc: