n8n

How to Connect Gemini and MongoDB Trip Planning?

Build a chat based trip planner that answers travel questions using your own points of interest. It remembers each conversation and pulls the best local spots from a MongoDB database. Great for travel teams, hotel concierges, and tourism desks.

Incoming chat messages trigger a smart agent powered by Google Gemini. The agent uses MongoDB chat memory to keep context and a vector search tool to look up points of interest you load into Atlas. OpenAI creates embeddings so the agent can match questions to the right locations. A separate webhook lets you add new places by sending a simple JSON payload. The agent searches up to ten matches and replies with clear tips instead of guessing.

Setup needs a MongoDB Atlas cluster with a vector index, an OpenAI key for embeddings, and a Google Gemini key for replies. Expect faster replies, less manual research, and more accurate suggestions. Ideal use cases include building a travel chat on your site, helping agents answer faster, or powering a kiosk assistant in a lobby.

What are the key features?

  • Chat trigger starts a session whenever a user sends a message
  • Google Gemini model generates clear travel answers based on context
  • MongoDB chat memory stores conversation threads for follow up questions
  • MongoDB Atlas Vector Search retrieves the best matching places using OpenAI embeddings
  • Agent tool PointofinterestKB searches up to ten relevant results
  • Webhook endpoint ingests new points of interest from any external source
  • Default Data Loader formats title and description for embedding
  • Optional text splitter prepares longer input text when needed
  • Insert and retrieve modes keep your collection updated and searchable

What are the benefits?

  • Reduce travel research from hours to minutes by answering common questions instantly
  • Automate up to 80 percent of repeat inquiries with consistent replies
  • Improve suggestion accuracy by using your curated points of interest
  • Handle several chat sessions at once with memory that keeps context
  • Connect Gemini, OpenAI, and MongoDB without custom code

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with MongoDB Atlas, Google Gemini, OpenAI and Webhook.site. See the Tools Required section above for links to create accounts with these services.
  3. In MongoDB Atlas, create a project and cluster. Add your IP to the Access List so n8n can connect. Create a database and a collection named points_of_interest.
  4. In MongoDB Atlas, create a vector index named vector_index on the embedding field with 1536 dimensions and cosine similarity to match the embeddings model.
  5. In the n8n credentials manager, open the MongoDB nodes, choose Create new credential, and paste your MongoDB connection string and database name. Use a clear name like MongoDB Atlas Prod.
  6. Open the OpenAI Embeddings nodes, choose Create new credential, and add your OpenAI API key from the OpenAI account API page. Save the credential.
  7. Open the Google Gemini Chat Model node, choose Create new credential, and add your Google AI API key from the Google AI Studio. Save the credential.
  8. Select the MongoDB Atlas Vector Store nodes and confirm the collection is points_of_interest and the index is vector_index. Ensure mode is retrieve as tool for the search node and insert for the ingestion node.
  9. Open the Webhook node and copy the endpoint path. In a terminal, run the provided curl example to post a point_of_interest with a title and description. You can also use Webhook.site to test requests.
  10. In MongoDB Atlas, check the points_of_interest collection to confirm new records with embeddings were inserted.
  11. Activate the workflow. Open the chat interface tied to the chat trigger and ask a question like Where should I go for a romantic getaway. Confirm the reply includes relevant places from your database.
  12. If results look empty, check API keys, confirm the vector index name and embedding dimensions, and ensure your Atlas IP Access List allows the n8n server. Also verify topK is set to 10 on the vector search tool.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

MongoDB Atlas

Sign up

Free (M0) tier: $0/hour (free forever), 512MB storage

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Webhook.site

Sign up

Free tier: $0, public API available; free URLs expire after 7 days and accept up to 100 requests

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.