Hosting fixes: security, read-only DB creds, per-request OpenAI key - #18
Merged
Merged
Conversation
…r logging
- CORS now driven by CORS_ORIGINS env (default localhost:3000); drop invalid
allow_origins=* + allow_credentials=True combo.
- /api/neo4j/stats uses plain MATCH label counts instead of db.labels()/APOC,
which a read-only Neo4j role is forbidden from executing.
- Replace logger.error(f"...{e}...") with loguru-safe logging so Neo4j error
messages containing { } braces no longer crash the handler and mask the real error.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Demo users supply their own OpenAI key so the host never pays for inference. - SearchRequest.openai_api_key (required); threaded through run_tools_sequence_and_summarize -> tool_calling / AsyncQdrantQuery / AsyncQdrantVectorStore. Removes the module-global OpenAI clients. - Key used for both the LLM agent and query-time embeddings (direct or via Qdrant Cloud Inference header). Never stored or logged. - Rejected keys surface as HTTP 401 detail=openai_key_rejected so the frontend can reopen its key gate. - Tests: key threading + openai_api_key required. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summarization is a phase, not a retrieval/graph tool. Drop the ToolExecution(name='summarize') from the trace so it is never counted as a 'tool executed' (was causing a 4-vs-3 mismatch between the trace panel and the chat header). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy of Dockerfile without COPY data/ — the serving backend only queries Qdrant + Neo4j and never reads the JSON datasets at runtime (config warns, doesn't fail). Reads $PORT (Vercel injects it). A Dockerfile.vercel.dockerignore keeps the build context lean without affecting the legacy Dockerfile. Validated: image builds and the container boots + serves /health. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Prep for hosting the demo on Vercel with Qdrant-owned infra.
Fixes
CORS_ORIGINSenv (drops invalid*+ credentials).MATCHcounts instead ofdb.labels()/APOC, so a read-only Neo4j role (which can't execute procedures) works.logger.opt(exception=True).error("...", e)so Neo4j error messages containing{ }no longer crash the handler and mask the real error (was in the main search path too).Feature
openai_key_rejected. Unit tests added.Misc
🤖 Generated with Claude Code