SQLite handles basic isolation for single-node, low-throughput jobs. But its [locking model](https://sqlite.org/howtocorrupt.html) breaks for multi-writer concurrency; you’ll hit `database is locked` unless all writes are serialized. WAL mode buys some time, but distributed or high-scale concurrency will break this pattern. ## Architecture: Concrete Roles for Each Component The core pieces: - **ADK Agent Primitives:** Define agent skills and tools, but do not own orchestration or state. - **Workflow Router:** Holds workflow definitions (agent ID sequences, logic policies) and invokes agents in proper order, passing shared context and results. - **Persistence Layer:** Writes inputs, outputs, workflow metadata, and session state to SQLite using transactional APIs. - **Session Management:** Every request issues or accepts a session ID for all DB ops and cross-agent calls, ensuring traceability and recovery. - **Parallel/Sequential Controller:** Orchestrator chooses—per workflow—parallel agent execution (with `execute_parallel`) or sequential traversal (via the router). - **API Layer:** Thin HTTP layer exposes orchestration. Receives input, resolves agents and workflows, persists and returns results. Operational flow: API request → router picks or builds agent sequence → orchestrator runs agents in parallel or sequence → everything tracked in SQLite per session → results, sessions, and artifacts returned and logged. ## Where Single-Agent Patterns Shatter Major pain points arise fast: - **Concurrency Control:** Naive parallelism explodes without transactional locking, especially with file-based DBs like SQLite. - **Flexible Routing:** Hardcoding agent handoffs can’t handle even modest workflow complexity. Declarative routing or agent graphs are required. - **Persisted State:** In-memory tricks fail as soon as session continuity or recovery is needed. Even a simple persistent DB takes you far. - **Session Isolation:** No session context? No recovery, no traceability, no multi-step workflows. - **Observability:** Multi-agent flows demand structured logs and per-step state tracking—or debugging becomes impossible. - **Infra Coupling:** Orchestrators hard-locked to sequence-only chains or HTTP-only triggers slow evolution as agents multiply. Single-agent chains don’t scale or survive real usage. Invest in real orchestration early: explicit invocation, parallelization, persistent state, and robust session management save you from painful rework. Google ADK is a strong base, but production multi-agent workflows require deliberate orchestration architecture. Patch these gaps or expect brittle systems and firefighting down the road.