Backend resilience: LLM retry/backoff, OpenAI-compatible embeddings, connection guards#50
Open
shivswami wants to merge 1 commit into
Open
Backend resilience: LLM retry/backoff, OpenAI-compatible embeddings, connection guards#50shivswami wants to merge 1 commit into
shivswami wants to merge 1 commit into
Conversation
…guards - llm_client: retry transient failures (429/5xx/timeout/connection) with exponential backoff honoring Retry-After; non-retryable errors fail fast - embedding_service: support OpenAI-compatible /v1/embeddings servers (e.g. LMStudio) alongside Ollama, auto-detected from EMBEDDING_BASE_URL - neo4j_storage: verify Neo4j reachable before create_graph/add_text; log batch-embedding failures as errors (empty vectors silently break vector search) - graph build: fail the task explicitly when NER extracts 0 entities instead of reporting a misleading "completed" status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Improves backend robustness for local deployments (Ollama / LMStudio / Neo4j in Docker) where services are flaky or use non-Ollama providers.
Why
Changes
llm_client.py— retry transient failures (429 / 5xx / timeout / connection) with exponential backoff (2/4/8…s, capped at 60s), honoringRetry-After; non-retryable errors fail fast. Configurable viaLLM_MAX_RETRIES.embedding_service.py— support OpenAI-compatible/v1/embeddingsendpoints alongside Ollama; format auto-detected fromEMBEDDING_BASE_URL.neo4j_storage.py—health_check()+ pre-flight_verify_connection()beforecreate_graph/add_text; batch-embedding failures now logged as errors (empty vectors silently break vector search).graph.py— a build that extracts 0 entities now fails the task explicitly with an actionable message instead of showing "completed".Notes / limitations
:11434→ Ollama;/v1in path → OpenAI). A non-default Ollama port behind a/v1proxy could misdetect._verify_connectionadds oneRETURN 1round-trip before eachadd_text.Tested
backend/venv).