AI travel planner, powered by Spanner (Multi-model)
By Google Cloud Tech
Spanner Multimodel Capabilities for AI Applications
Key Concepts:
- Spanner: Google Cloud’s globally-distributed, scalable, strongly consistent database service.
- Multimodel Database: A database capable of handling multiple data models (relational, graph, vector) within a single system.
- OLTP (Online Transaction Processing): Traditional database queries focused on fast, individual transactions (e.g., finding top attractions).
- OLAP (Online Analytical Processing): Queries focused on complex analytical tasks and data aggregation (e.g., counting restaurants near attractions).
- Vector Embeddings: Numerical representations of data (text, images, etc.) used for semantic search.
- Semantic Search: Search based on the meaning of the query, rather than just keyword matches.
- Knowledge Graph (Property Graph): A database structure that represents entities and their relationships.
- Gemini 3 Flash: Google’s large language model used for query intelligence and understanding.
- Cosine Distance: A metric used to measure the similarity between vectors.
- ETL (Extract, Transform, Load): Processes used to move data between systems, often creating data silos and consistency issues.
1. Introduction & The Problem of Data Silos
Rakkesh and Nha introduce Spanner and its multimodel capabilities, highlighting the challenges of building sophisticated AI applications that often require multiple database types (relational, graph, vector). This fragmented approach leads to complex ETL pipelines, data silos, and consistency problems for developers. The core proposition is that Spanner can unify these capabilities into a single, high-performance database. As Rakkesh states, the goal is to move away from the “endless troubleshooting loop” of managing multiple databases and ETL processes.
2. Spanner’s Core Strengths
Nha emphasizes Spanner’s foundational strengths: pro-relability (strong transactional consistency), global scale, high availability, and effortless horizontal scaling. These features make Spanner suitable for mission-critical applications requiring zero downtime. Spanner’s multimodel approach simplifies development by consolidating relational, graph, and vector search capabilities.
3. The AI Travel Agent Demonstration
The demonstration centers around an AI travel agent designed to help users plan trips to San Francisco. The agent handles a variety of search queries, categorized as OLTP, OLAP, vector, and full-text search. The entire database schema is visible within the Spanner console, showcasing the integrated data models.
4. Data Models within Spanner
- Relational Tables: Used for structured data like attractions and restaurants.
- Knowledge Graph (Property Graph): Represents relationships between entities (e.g., connecting attractions to nearby amenities). Nha explains this shifts the focus from isolated data points to meaningful connections, ensuring relevance to the user.
- Vector Embeddings Table: Stores vector representations of text data, enabling semantic search.
5. OLTP Queries & Limitations
The demonstration begins with traditional OLTP queries, such as finding “top attractions” and “beaches.” These queries use standard keyword searches (e.g., LIKE operator). Nha points out a limitation: these queries are sensitive to misspellings or synonyms and may not return relevant results if the exact keyword isn't present.
6. Semantic Search with Vector Embeddings
To address the limitations of keyword-based search, the demonstration showcases semantic search. When asked “What are the best beaches?”, the semantic search query retrieves more records because it understands that terms like “coastal gem” are conceptually related to “beach,” even without the explicit keyword. The process involves:
- Input: Natural language question ("What are the best beaches?").
- LLM Processing: The question is sent to an LLM model (implicitly Gemini 3 Flash).
- Vector Generation: The LLM generates a vector embedding representing the meaning of the question.
- Cosine Distance Calculation: The query uses the cosine distance function to rank data chunks based on their semantic similarity to the question’s vector.
- Automatic Synonym Recognition: The system automatically links related terms like "shoreline," "coast," and "beach."
7. The “Crown Jewel” – Multimodel Query
The most powerful demonstration involves a complex query: “Find family-friendly dining conveniently located near top-rated beaches.” This query combines multiple data models and query types:
- Graph Traversal: Finds restaurants close to beach attractions.
- Full-Text Search: Finds attractions with “family fun” in their descriptions.
- Joins: Implements OLTP query logic.
- Semantic Search: Finds attractions semantically similar to “beaches.”
- OLAP Query: Counts the number of restaurants near the identified attractions.
The query is executed in a single call to the database, providing actionable insights for the user. The results are displayed in the AI travel agent UI.
8. Benefits of a Unified Spanner Instance
The demonstration concludes by reiterating the benefits of consolidating architecture onto a single Spanner instance:
- Reduced Complexity: Eliminates the need to manage fragmented data systems.
- Improved Performance: Enables high-performance multimodel AI applications.
- Simplified Development: Streamlines the development process by providing a unified platform.
9. Notable Quotes
- Rakkesh: “ETL… which I call it as endless troubleshooting loop.” (Highlighting the pain points of traditional data integration)
- Nha: “Spanner seamlessly combines all these query types to to give the traveler exactly what they're looking for. All this in a single call to the database.” (Emphasizing the power of the multimodel approach)
10. Conclusion
Spanner’s multimodel capabilities offer a compelling solution for building modern, high-performance AI applications. By unifying relational, graph, and vector search within a single, scalable, and strongly consistent database, Spanner simplifies development, reduces complexity, and unlocks new possibilities for data-driven innovation. The AI travel agent demonstration effectively illustrates how Spanner can handle complex queries that leverage multiple data models to deliver actionable insights.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "AI travel planner, powered by Spanner (Multi-model)". What would you like to know?