Skip to content

Add MongoDB, RabbitMQ ingest, evals, and deploy config - #1

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/mongo-rabbit-evals-deploy-5821
Oct 14, 2026
Merged

cursor[bot] merged 6 commits into
mainfrom
cursor/mongo-rabbit-evals-deploy-5821

Conversation

@naveecode

Copy link
Copy Markdown
Owner

Summary

  • The LangGraph tool loop and MCP server now actually run. Tools need docstrings for create_react_agent, and the server uses MCP 2's MCPServer (the FastMCP import was removed). Tests drive a scripted ReAct loop and call the registered tools.
  • Documents are chunked and stored with embeddings. MONGO_URL selects MongoDB; otherwise the API stays in memory. Chat turns are saved on /ask. Atlas $vectorSearch runs when MONGO_VECTOR_INDEX is set, and the local ranker is the fallback.
  • POST /docs publishes to RabbitMQ when RABBITMQ_URL is set. The worker tries each message three times, then publishes it to ingest.dlq. Without a broker, ingest stays inline and drops cached answers the new document would change.
  • python -m app.evals scores tool choice, golden answers, and guardrails on the offline router. Empty input, oversized questions, and prompt-injection phrasing are refused before a tool runs.
  • The Dockerfile has a healthcheck. CI builds the image and exercises /health, ingest, and /ask. render.yaml and fly.toml run the API and the worker.

Verification

  • pytest -q: 30 passed
  • python -m app.evals: 6 passed, 0 failed
  • docker build succeeded, and a container smoke test covered /health, /docs, /ask, and /chats. The image healthcheck reported healthy.
  • docker compose config validates the API, worker, Redis, MongoDB, and RabbitMQ stack.

Still open

  • Next.js chat UI
  • Kubernetes manifests
Open in Web Open in Cursor 

cursoragent and others added 6 commits October 14, 2026 12:55
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
naveecode marked this pull request as ready for review October 14, 2026 13:04
@cursor
cursor Bot merged commit 90c006a into main Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants