Skip to content

Add MongoDB Text-to-MQL Agent Tutorial to Gen-AI Showcase #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MMBazel
Copy link
Collaborator

@MMBazel MMBazel commented May 28, 2025

Add MongoDB Text-to-MQL Agent Tutorial to Gen-AI Showcase

This PR adds a comprehensive tutorial showcasing how to build natural language agents using MongoDB Atlas and LangChain's Text-to-MQL tools. The guide walks developers through two agent architectures:

  • ReAct-style agent – ideal for fast prototyping, demos, and dynamic tool usage.
  • LangGraph-style agent – designed for production with deterministic, auditable flows.

Key Features

  • Use the langchain_mongodb.agent_toolkit to generate, validate, and execute secure MongoDB aggregation pipelines from plain English.
  • Simplified prompt design using MONGODB_AGENT_SYSTEM_PROMPT.
  • Detailed comparison of ReAct vs. graph-style agents (speed, accuracy, tradeoffs).
  • Patterns for extending agents with memory, hybrid search (Vector + Full-Text + MQL), and observability.

Audience

This tutorial is intended for developers and teams building:

  • GenAI agents over structured data
  • Internal tools and analytics bots
  • Production-grade agentic systems with audit/control requirements

@MMBazel MMBazel requested a review from a team as a code owner May 28, 2025 21:49
@MMBazel MMBazel added the enhancement New feature or request label May 28, 2025
@ajosh0504
Copy link
Collaborator

Nice work! I like the comparison between an easy (React) and a more customized (LangGraph) agent. Few comments:

  • I found the wording "graph-based agent" a bit confusing. I took it to mean it was using graph-based retrieval or GraphRAG. Might want to specifically say "custom LangGraph agent" or similar.
  • The long outputs at every step make the notebook a bit hard to read. Consider clearing the outputs of some cells
  • In the LangGraph agent, curious why there is a conditional edge after generate_query? Shouldn't check_query, run_query, etc., always be run if the agent decides to generate a query?
  • Instead of saving the output to a local file, you could persist it in MongoDB? Could also use the MongoDB LangGraph checkpointer to show how to use these persisted outputs as memory for the agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants