|

Build an Agentic Event Venue Operator with MongoDB Atlas, Voyage, and LangGraph

Introduction

This tutorial starts where most agent demos stop: giving the agent persistent memory, operational context, and a place to write back what happened. An occasion operator doesn’t simply want an agent that may summarize a climate report or generate a generic plan. The operator wants an agent that may bear in mind what occurred at prior occasions, retrieve related customer and venue context, reply to stay operational adjustments, and write the result again as reminiscence for the following related scenario.

We constructed this event-venue operator demo with MongoDB Atlas, Voyage AI embeddings, LangGraph, and non-obligatory Langfuse tracing. The demo state of affairs is the MongoDB Open, a fictional premium tennis match on Day 6 of play. Rain is approaching, coated hospitality capability is constrained, and the operator has two completely different customer journeys to guard: Mikiko, a first-time attendee making an attempt to profit from the grounds, and Nina, a premier visitor with hospitality expectations and a historical past the agent can retrieve.

This will not be a buyer case examine or a manufacturing deployment. It is a fictional builder state of affairs impressed by actual occasion operations economics. Major tennis occasions present why these selections matter: the 2025 US Open broke attendance, viewership, and digital reach records and provided $90 million in complete participant compensation; USTA has additionally stated the three-week US Open drives more than $1.2 billion in annual economic impact for New York City. Premium fan expectations are excessive, too: PwC found that 60% of high-income U.S. sports activities followers would spend greater than $250 for a particular occasion, and 20% would spend greater than $1,000. Weather provides one other layer of threat, which is why the U.S. Census Bureau now tracks the monetary impact of extreme weather on business sales by way of its Business Trends and Outlook Survey.

The MongoDB Open demo agent isn’t just producing a believable plan. It reads present venue state, retrieves prior occasion reminiscence, distinguishes between customer segments, and acts. At the identical time, hospitality capability continues to be accessible, and writes the result again so the following disruption might be dealt with with extra context. Check out the total repo here

The demo is break up into three layers:

  • A guided, deterministic UI that makes the operator story straightforward to comply with.
  • A hosted Vercel demo that offers readers a public app link.
  • Live API endpoints and scripts for Atlas Vector Search, vector-plus-lexical retrieval, visual-document RAG, LangGraph execution, and non-obligatory Langfuse traces, to display how the stack all works collectively. 

What You Will Build

By the tip of the tutorial, you’ll have a FastAPI app backed by MongoDB Atlas that may run domestically and deploy to Vercel.

The app contains:

  • A four-tab guided UI for the event-operations story and stay backend validation.
  • Atlas collections for operational state, semantic reminiscence, agent actions, and LangGraph checkpoints.
  • Voyage multimodal embeddings saved in Atlas.
  • Atlas Vector Search for reminiscence retrieval.
  • A hybrid retrieval endpoint that mixes vector similarity with lexical scoring.
  • A Vision RAG endpoint that retrieves visible operational paperwork and passes them to Claude Vision.
  • Optional Langfuse tracing for retrieval calls and the stay LangGraph run.
  • A runnable LangGraph script that follows the identical rain-delay story.
  • A Vercel deployment configuration for a hosted demo.

The present repo ought to be handled as a reference demo, not a manufacturing platform. There isn’t any manufacturing auth, no CI suite, and the total LangGraph agent stays a script-based validation path somewhat than a public hosted endpoint.

Architecture Overview

The structure facilities on MongoDB Atlas as each the operational and reminiscence layer. Speed issues within the occasion venue operator state of affairs as a result of the helpful window for motion is brief. If rain is 20 minutes away and coated hospitality house is filling up, the operator doesn’t want a post-event dashboard or a batch abstract a couple of minutes later. The agent must learn the present venue state, retrieve related reminiscence, resolve what to do, and write again the consequence whereas there’s nonetheless capability to guard the visitor expertise.

That is why the kind of database and how it’s used are crucial system design selections. Operational information, semantic reminiscence, vector embeddings, visible paperwork, and agent actions all stay in the identical information layer. The agent doesn’t want to attend for a separate analytics pipeline, sync information right into a second vector database, or reconcile what the reminiscence layer says with what the operational system says. Atlas acts as each the system of report and the retrieval layer for the agent loop: understand what modified, retrieve the appropriate context, take motion, and persist what occurred for the following occasion.

This can be why the demo retains reminiscence in MongoDB somewhat than treating it as a sidecar. The agent is not just retrieving chunks; it is composing operational context. A helpful determination might have customer historical past, present venue standing, hospitality stock, prior rain-delay patterns, and related visible paperwork on the similar time. With Atlas, these items can keep queryable collectively as an alternative of being scattered throughout separate techniques.

Caption: MongoDB Atlas shops the demo’s operational state, semantic reminiscence, visible doc embeddings, agent actions, and LangGraph checkpoints in a single backend.

The demo makes use of 4 major state layers:

  • Operational information: friends, visits, venue standing, climate occasions, reservations, occasion metrics, and agent actions.
  • Semantic reminiscence: memory_store, with Voyage embeddings and Atlas Vector Search.
  • Visual paperwork: operational photos embedded into the identical reminiscence retailer as image-derived multimodal embeddings and doc metadata.
  • Agent state: LangGraph checkpoints and checkpoint writes.

Setup

Before you start, ensure you have:

  • Python 3.12 or later
  • uv put in
  • A MongoDB Atlas cluster with Vector Search enabled (this may be arrange totally free)
  • An Anthropic API key (or be happy to make use of an LLM of your alternative and reconfigure API keys)
  • A Voyage API key (this may be arrange totally free)

Clone the repo and set up dependencies: GitHub repo

git clone https://github.com/mongodb-developer/event-venue-operator.git
cd event-venue-operator
uv sync

If you solely wish to examine the app earlier than establishing credentials, begin with the live Vercel demo. The hosted demo makes use of the identical UI and deployment form because the repo, whereas native setup allows you to run the total seed, smoke check, Vision RAG, and LangGraph paths your self.

Create your atmosphere file:

cp .env.instance .env

Add the required values:

MONGODB_URI=mongodb+srv://<consumer>:<password>@<cluster>.mongodb.internet/?retryWrites=true&w=majority
MONGODB_APP_NAME=devrel-tutorial-agentic_retrieval-memory-marktechpost
MONGODB_DATABASE=event_venue_operator
ANTHROPIC_API_KEY=sk-ant-...
VOYAGE_API_KEY=pa-...

Langfuse is non-obligatory for observability:

LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_HOST=https://cloud.langfuse.com

Initialize Atlas:

uv run python scripts/setup_atlas.py

This script creates collections and begins the Atlas Vector Search index, then waits as much as 60 seconds for the index to develop into READY. 

Then seed textual content and visible paperwork:

uv run python scripts/seed_data.py
uv run python scripts/seed_visual_docs.py

Start the app:

uv run python -m event_venue_operator.server

Open http://127.0.0.1:8000/.

In a second terminal, run the smoke check:

uv run python scripts/smoke_test.py

With the server operating in one other terminal, the smoke check checks MongoDB well being, Atlas Vector Search, hybrid search, visual-document indexing, Vision RAG, non-obligatory Langfuse wiring, and assortment stats.

Walk Through the UI

The UI has 4 tabs:

  1. The venue-operations dashboard. It establishes the occasion context: a tennis match, rain approaching, hospitality constraints, and two customer personas.
  2. The state of affairs walkthrough. The agent reads the present state, retrieves long-term reminiscence, plans differentiated actions, acts on behalf of the operator, and writes the consequence again to reminiscence. 
  3. Final outcomes for the day: retention, income, status, and new reminiscence patterns.
  4. Live backend validation calls towards Atlas. It lets readers set off vector and hybrid searches from the browser and emits non-obligatory Langfuse traces when Langfuse keys are configured.

Build the Memory Store

The reminiscence retailer lives within the memory_store assortment. Each reminiscence doc features a namespace, key, textual content payload, class metadata, and an embedding.

Namespaces let the app separate completely different sorts of reminiscence:

  • (“friends”, guest_id) for visitor-specific reminiscence.
  • (“fleet”, event_id) for operator-wide occasion patterns.
  • (“docs”, event_id) for visible operational paperwork.

This design alternative streamlines the agent’s entry to each operational information and its reminiscence for its personal operations. Agent reminiscence in manufacturing has many aspects: some reminiscences belong to an individual, some to a location, some to a enterprise course of, and some to reference paperwork. Atlas provides the app a single backend for all of them whereas nonetheless permitting scoped retrieval, because of its flexible data model.

At this level, the reminiscence retailer has already been initialized and seeded. The memory_store assortment comprises embedded reminiscence paperwork, and the Atlas Vector Search index is on the market.

This part reveals the best way to question that reminiscence retailer instantly. You don’t must run these queries to create reminiscence; they’re validation calls that aid you examine how retrieval works earlier than the agent makes use of the identical backend path throughout the state of affairs.

The easiest retrieval endpoint is vector search:

curl "http://127.0.0.1:8000/api/search?q=weatherpercent20problems&namespace=friends"

This embeds the question with Voyage and searches Atlas for semantically related reminiscences.

The hybrid endpoint combines vector similarity with lexical scoring over reminiscence textual content:

curl "http://127.0.0.1:8000/api/hybrid-search?q=thunderstormpercent20dinnerpercent20reservation&namespace=friends"

The response contains vector rating, lexical rating, and mixed hybrid rating. This is helpful as a result of event-operations queries usually combine semantic intent with precise operational phrases. “Rain delay,” “dinner reservation,” and “coated seating” are all significant as ideas, however precise phrases can nonetheless carry a powerful sign.

In this implementation, hybrid search means Atlas Vector Search plus deterministic lexical scoring over reminiscence textual content. It works with the prevailing vector index and seeded information, so readers don’t must create a separate Atlas Search textual content index for this tutorial. A pure extension can be so as to add a devoted Atlas Search textual content index and mix these outcomes with vector retrieval.

Add Visual RAG

Operational information will not be all the time textual content. Accessibility maps, hospitality capability charts, allergen matrices, weather-response sheets, and evacuation diagrams usually exist as photos or PDFs.

This repo seeds 5 visible paperwork:

uv run python scripts/seed_visual_docs.py

Each picture is embedded with Voyage multimodal embeddings and saved within the reminiscence assortment. A textual content question can then retrieve the related visible doc:

curl -X POST "http://127.0.0.1:8000/api/vision-rag/question" 
  -H "Content-Type: software/json" 
  -d '{"question":"What ought to we do for a thunderstorm throughout dinner service?", "restrict": 1}'

The endpoint retrieves the best-matching visible doc from Atlas and sends it to Claude Vision with the consumer query. This turns static operational materials into retrievable agent context.

Run the LangGraph Agent Path

The repo additionally features a LangGraph proof-of-concept:

uv run python scripts/run_poc.py

The graph follows the identical tennis-event narrative because the guided UI, however runs it by way of the stay agent path:

  • understand: retrieve prior reminiscences and present operational state.
  • plan: name Claude with retrieved context to provide persona-specific actions for Mikiko and Nina.
  • Hitl_gate: auto-approve proposed actions in V1, whereas exhibiting the place human approval would slot in manufacturing. 
  • act: execute instruments that replace Atlas.
  • mirror: write new inferences again to semantic reminiscence.

The generated output will differ as a result of Claude is planning from retrieved reminiscence, however the seeded reminiscences and immediate are aligned to the tennis rain-delay state of affairs.

Add Optional Langfuse Observability

Langfuse is non-obligatory. If you add keys to .env, the app emits tracing round retrieval calls:

LANGFUSE_PUBLIC_KEY=...
LANGFUSE_SECRET_KEY=...
LANGFUSE_HOST=https://cloud.langfuse.com

Check whether or not the operating server is configured:

curl "http://127.0.0.1:8000/api/observability/standing"

Run a retrieval request from the Live Backend tab or with /api/search and /api/hybrid-search, then examine Langfuse for traces named api.search and api.hybrid_search.

The stay LangGraph script additionally emits a run-level langgraph.run_agent remark when Langfuse keys are configured in order that readers can validate observability for each the API layer and the agent path.

For a tutorial, it is a useful solution to present readers the place observability matches with out making it a tough setup requirement.

Deploy the Hosted Demo to Vercel

The repo features a Vercel deployment path so the app might be shared as a public demo hyperlink. The deployment makes use of api/index.py because the Vercel ASGI entrypoint, and vercel.json to route requests to FastAPI. The repo contains .python-version  for native Python 3.12 tooling; verify the Vercel Python runtime can be set to three.12 and that the construct installs dependencies from pyproject.toml.

For the hosted demo, configure these atmosphere variables in Vercel:

MONGODB_URI=<atlas-connection-string>
MONGODB_DATABASE=event_venue_operator
MONGODB_APP_NAME=devrel-tutorial-agentic_retrieval-memory-marktechpost
VOYAGE_API_KEY=<voyage-key>

Langfuse keys are non-obligatory. Add ANTHROPIC_API_KEY provided that you deliberately need hosted Vision RAG or different LLM-backed endpoints uncovered. The full LangGraph path continues to be validated domestically through scripts/run_poc.py somewhat than by way of a public, unauthenticated endpoint.

After deployment, validate:

  1. Open / and verify the guided UI masses.
  2. Open /api/well being and verify MongoDB reviews up.
  3. Use the Live Backend tab to run vector search.
  4. Use the Live Backend tab to run hybrid search.
  5. If Langfuse keys are configured, verify traces seem in Langfuse.

Production Notes and Constraints

This demo is deliberately scoped.

The UI is deterministic. It is helpful for speaking the state of affairs, however it’s not a full real-time operations console.

The seed information is artificial. It is nice sufficient to display retrieval patterns, nevertheless it shouldn’t be handled as consultant manufacturing information.

The present undertaking doesn’t embrace manufacturing authentication, price limiting, tenant isolation, secret administration, or CI. Those can be required earlier than adapting the sample for an actual operator-facing software.

You can run this tutorial on an Atlas Free cluster to check the Vector Search workflow. Free clusters are meant for small-scale growth and testing; for severe prototyping or manufacturing workloads, use a devoted Atlas tier sized in your information and question quantity.

Where to Go Next

The demo retains the helpful components of the agent stack in information: operational information, semantic reminiscences, visible paperwork, checkpoints, and traces. MongoDB Atlas can maintain these items collectively whereas nonetheless supporting vector search, multimodal retrieval, and software state in a single place.

 If you loved this tutorial, be happy to create your personal state of affairs and/or add options you suppose would make the demo extra lifelike. 

If you wish to study extra, try our different tutorials in GenAI Showcase or study extra about brokers and reminiscence at MongoDB University

Check out the GitHub repo here.


Note:Thanks to the MongoDB workforce for the Technical Resources and promotional help for this text. 

The publish Build an Agentic Event Venue Operator with MongoDB Atlas, Voyage, and LangGraph appeared first on MarkTechPost.

Similar Posts