Certainly! Here’s a detailed description of the updated Structured Summary Generation System Architecture incorporating a vector database to enhance context retrieval and semantic search capabilities:
Structured Summary Generation System Architecture
(with Vector Database Integration)
This architecture enables Macy’s systems to generate rich, structured summaries of orders, notes, and products by leveraging state-of-the-art language models on Vertex AI (Gemini model), enhanced with semantic search capabilities via a vector database.
1. Macy’s Systems (Client)
Macy’s internal systems initiate API requests for summaries related to orders, notes, or products. Each request includes a summary_type flag indicating the kind of summary needed. Requests are sent as JSON payloads to the backend API.
2. API Gateway / Backend Service
The API Gateway serves as the entry point for all incoming requests. This layer validates inputs and inspects the summary_type field to route requests to appropriate processing pipelines. It also manages authentication, throttling, and security policies.
3. Summarization Engine & Router
This component acts as the central coordinator for preparing requests to the Vertex AI Gemini model:
- Data Preparation: Converts input JSON into structured prompt templates, tailored for each summary type.
- Vector DB Query: Before generating the summary, it queries the Vector Database for relevant, semantically similar data such as previous summaries, notes, or product descriptions. This retrieval enables injecting contextual knowledge into prompts, improving output coherence and richness.
- Request Forwarding: Sends the enriched prompt payload to Vertex AI’s text generation API.
4. Vertex AI (Gemini Model)
Google Cloud’s Gemini model processes the prompts to generate detailed, structured summaries. Outputs are typically in JSON or markdown-like format and include fields such as:
final_outcome
critical_events
key_notes
order_timeline_overview
key_evidence
This ensures summaries are comprehensive and formatted according to Macy’s business requirements.
5. Vector Database
A dedicated vector database stores embeddings of past summaries, notes, product descriptions, and other relevant documents. Functions include:
- Semantic Indexing: Converts textual data into high-dimensional vectors for similarity comparison.
- Contextual Retrieval: Enables fast, semantic search to find relevant documents related to the current summarization request.
- Continuous Updates: After each summarization, embeddings for new summaries or notes are added to the vector DB, keeping it current.
- Enhancement of Summarization: By integrating relevant retrieved context into prompts, it helps Gemini generate more accurate and context-aware summaries.
Popular technologies in this space include Pinecone, Weaviate, Milvus, FAISS, and Google’s Vertex Matching Engine.
6. API Response Formatter
This component parses the output from Vertex AI, normalizes and validates the structured summary, and formats it according to Macy’s API schema for consistent downstream consumption.
7. API Response to Macy’s Systems
The finalized, structured summaries are returned as JSON responses to Macy’s API clients. These responses feed into dashboards, internal analytics tools, or automated workflows for enhanced decision-making.
Additional Considerations
- Security & Monitoring: OAuth2 and IAM enforce secure, authorized access. Cloud Logging and Error Reporting provide observability and operational insights.
- Deployment: The architecture can be deployed on Google Kubernetes Engine (GKE), Cloud Run, or App Engine for scalability and fault tolerance.
- Prompt Templates: Version-controlled prompt templates (stored as YAML or JSON) ensure consistency and enable easy updates or A/B testing.
Summary
The addition of a vector database complements Vertex AI’s generative capabilities by enabling semantic search and knowledge augmentation. This hybrid approach ensures Macy’s structured summaries are not only accurate but enriched with relevant historical context, leading to better insights and operational efficiency.
If you’d like, I can also provide a diagram visually illustrating these components and their interactions!