Repository navigation
Add MongoDB, RabbitMQ ingest, evals, and deploy config - #1
Merged
Merged
Conversation
LangGraph rejected the tools because they had no docstrings, and the MCP entry point still imported FastMCP, which mcp 2.x removed. Pin the stack and cover both paths so CI installs the same dependencies the agent uses. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
Ingest splits text, stores a hashed embedding, and ranks matches by shared tokens with cosine as the tiebreaker. MONGO_URL selects MongoDB; without it the API keeps working in memory. Atlas $vectorSearch is used when MONGO_VECTOR_INDEX is set and the local ranker is the fallback. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
POST /docs publishes to the ingest queue when RABBITMQ_URL is set and the worker stores chunks after a failure budget of three attempts. Poison messages skip retries. Without a broker the API still ingests inline and drops cached answers that the new document would change. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
Golden questions score tool choice, exact calculator answers, and document hits. Empty input, oversized questions, and prompt-injection phrasing are refused before a tool runs. python -m app.evals exits non-zero on a miss. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
The image now has a healthcheck. CI builds it and exercises /health, ingest, and /ask. render.yaml and fly.toml run the API and the ingest worker. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
The README now covers the environment variables, ingest retries, Atlas vector search, and how to deploy the API and worker on Render or Fly. Co-authored-by: naveecode <naveecode@users.noreply.github.com>
naveecode
marked this pull request as ready for review
October 14, 2026 13:04
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.
Summary
create_react_agent, and the server uses MCP 2'sMCPServer(theFastMCPimport was removed). Tests drive a scripted ReAct loop and call the registered tools.MONGO_URLselects MongoDB; otherwise the API stays in memory. Chat turns are saved on/ask. Atlas$vectorSearchruns whenMONGO_VECTOR_INDEXis set, and the local ranker is the fallback.POST /docspublishes to RabbitMQ whenRABBITMQ_URLis set. The worker tries each message three times, then publishes it toingest.dlq. Without a broker, ingest stays inline and drops cached answers the new document would change.python -m app.evalsscores tool choice, golden answers, and guardrails on the offline router. Empty input, oversized questions, and prompt-injection phrasing are refused before a tool runs./health, ingest, and/ask.render.yamlandfly.tomlrun the API and the worker.Verification
pytest -q: 30 passedpython -m app.evals: 6 passed, 0 faileddocker buildsucceeded, and a container smoke test covered/health,/docs,/ask, and/chats. The image healthcheck reported healthy.docker compose configvalidates the API, worker, Redis, MongoDB, and RabbitMQ stack.Still open