[Agent Platform in Practice (4)] Towards Cloud Two-layer Decoupling and Full Persistence: Completing the LINE AI Business Card M A developer extended the open-source LINE AI Business Card Assistant (line-card-assistant) with a Cloud SQL PostgreSQL-backed PostgresStore, completing a three-part cloud-native persistence scheme alongside GCS artifact storage and Vertex AI session storage. The update, shipped in PR #12 for Issues #5 and #6, also adds a HybridSearch node with token-scoring fault-tolerant BroadSearch and splits the system into a Cloud Run LINE webhook gateway and a Google Cloud Agent Runtime execution layer. The two-tier decoupling lets the webhook verify X-Line-Signature and return 200 OK within 1-2 seconds while the agent runtime handles the 12-node ADK workflow. In the first three articles of the "Agent Platform in Action" series, we step-by-step pushed the LINE AI Business Card Assistant line-card-assistant from a conceptual prototype to a cloud-native architecture: google.golang.org/adk/v2/workflow to build a 12-node business card processing graph Graph Workflow , covering Vision OCR, AddFanOut / AddFanIn parallel background investigations, and the HITL Human-in-the-Loop pause and modification loop of NewRequestInputEvent . agents-cli adk go standard dual-channel architecture, allowing the project to support LINE Webhook, ADK WebUI Playground, and the A2A protocol simultaneously. artifact/gcsartifact to move multi-MB business card photos out of Session.State , and combining session/vertexai to implement resolvePendingHITL , allowing stateless containers to seamlessly continue HITL modification and saving even if scaled to 0 or instances are switched. In today's fourth episode of the series, we will complete the final piece of Phase 2 Issue 5 https://github.com/kkdai/line-card-assistant/issues/5 and the Phase 3 core architecture upgrade Issue 6 https://github.com/kkdai/line-card-assistant/issues/6 corresponding to PR 12 https://github.com/kkdai/line-card-assistant/pull/12 : PostgresStore / Cloud SQL HybridSearch and token-scoring fault-tolerant BroadSearch . When we deploy line-card-assistant to a Google Cloud production environment, a careful examination of the responsibilities of every piece of data and component in the system reveals two key problems that must be solved: CardStore Business Card Database In the previous post PR 11 , we already placed the "original business card photos" in Google Cloud Storage GCSArtifactService and the "workflow execution state and HITL breakpoints" in Vertex AI / Cloud SQL SessionService . However, when a user clicks "✅ Confirm Save" in LINE and reaches SaveCardNode , if the final confirmed business card data models.BusinessCard is still written to local memory MemoryStore or a local SQLite file inside the container: HybridSearchNode won't find the card just saved in Instance B's memory Therefore, we must complete the final corner of the "Cloud-Native Persistence Triad" — Cloud SQL PostgreSQL PostgresStore : | Persistence Dimension | Content Responsible for Storing | Cloud Backend Service | ADK / Go Implementation Package | |---|---|---|---| | 1. Binary Large Files Artifacts | Original business card photos business card.jpg v1, v2… | Google Cloud Storage GCS | sessions.NewArtifactService artifact/gcsartifact | | 2. Conversation and Graph Breakpoints Sessions | Graph Checkpoints, active interrupt id , draft card | Vertex AI Agent Engine / Cloud SQL | sessions.NewService session/vertexai , session/database | | 3. Structured Business Data Domain DB | Verified BusinessCard official records, JSON industry tags, hybrid retrieval | Cloud SQL for PostgreSQL | store.NewStore internal/store/postgres.go | In monolithic All-in-One mode, cmd/server receives LINE Webhooks, runs Vision OCR, and executes three parallel Grounding search nodes in the same process. However, in an enterprise-grade Google Cloud Agent Platform architecture, splitting the system into "Cloud Run LINE Webhook Gateway Edge Layer " and "Google Cloud Agent Runtime Agent Execution Layer " offers three major advantages: POST /webhook to push events, uses LINE CHANNEL SECRET to verify the X-Line-Signature , and must 200 OK within 1-2 seconds app.NewRootAgent hosted on the Agent Runtime AGENT RUNTIME URL is not set, cmd/server automatically runs in AGENT RUNTIME URL=https://... in Cloud Run automatically switches Let's look at the cross-layer interaction under the two-tier decoupled architecture with a complete system sequence diagram: sequenceDiagram autonumber actor User as LINE User participant GW as Cloud Run