DEV Community

Batila Amulya
Batila Amulya

Posted on

Building NEXUS: How I Architected a Multi-Agent AI System on Google Cloud in 48 Hours

`One sentence. Four AI agents. Real results — in under 4 seconds. Here's everything I learned building NEXUS for the Gen AI Academy APAC Edition hackathon.

The problem I wanted to solve

How many apps do you open on a typical workday just to stay organized? Calendar. Task manager. Notes app. Each one lives in its own silo, and switching between them adds up to a surprising amount of mental overhead.

I wanted to build something different — a single conversational interface where you say what you need to do, and the system figures out the rest. Not a chatbot that gives you a list of suggestions. An actual agent that acts.

That idea became NEXUS.

NEXUS is a fully deployed multi-agent AI system on Google Cloud Platform. You send one natural language request, and NEXUS automatically coordinates specialized AI agents to complete complex workflows — simultaneously.

What NEXUS actually does

Here's a quick example. You send:

"Schedule a team meeting tomorrow and create a task to prepare the agenda."

Within 4 seconds, two things happen in parallel:

  • ChronoBot creates event EVT-EACD61F3 in Firestore
  • TaskMind creates task TASK-462C3D6C in Firestore

No manual switching. No separate apps. One message, multiple agents, real results.

Meet the agent network

The architecture: how it all fits together

The core insight behind NEXUS is that routing intelligence should live in the AI, not in the code. The orchestrator sends your message to Gemini 2.5 Flash, which returns a JSON routing plan:

json
{"agents": ["calendar", "tasks"], "plan": "Schedule meeting using calendar agent, then create prep task."}

The relevant agents are called in parallel — each an independent Cloud Run service. They write to Firestore and return structured results back to the orchestrator.

plaintext
User message
→ NEXUS Core (Cloud Run + Gemini 2.5 Flash)
→ Dynamic routing to ChronoBot / TaskMind / MemoryVault
→ Firestore (5 collections)
→ Structured response with agent IDs + execution trace

Why Google Cloud Platform?

  • Cloud Run — Each agent scales to zero. No cost when idle, instant burst when needed.
  • Firestore (Native mode) — Schemaless and real-time. No schema migrations during a 48-hour build.
  • Gemini 2.5 Flash — Sub-second JSON responses at ~$0.000125 per request.
  • Cloud Pub/Sub — Async agent messaging. Decouples agents for future event-driven scaling.
  • Secret Manager — Zero hardcoded credentials. Non-negotiable for anything touching APIs.

What made this genuinely hard

Dynamic routing vs hardcoded logic. The temptation was to write explicit routing rules. I pushed back on that—trusting Gemini to classify intent and return a structured JSON plan is far more robust and extensible.

Keeping agents truly independent. Strict API contracts, no shared state except through Firestore. Tedious to maintain, but it means I can add a new agent without touching existing code.

IAM and least privilege. The service account uses exactly 8 roles. Getting this right during a hackathon is easy to skip; I'm glad I didn't.

Try it yourself

NEXUS is fully deployed and live:

shell
curl -X POST "https://nexus-orchestrator-yqumqe2gtq-uc.a.run.app/query" \
-H "Content-Type: application/json" \
-d '{"message": "Remind me to follow up with the team on Friday"}'

What I'd build next

  • An email agent—draft a follow-up and schedule a reminder in one go
  • Agent-to-agent communication via Pub/Sub
  • A memory-aware orchestrator that learns your preferences over time

Closing thoughts

Building NEXUS taught me that the hardest part of a multi-agent system isn't the individual agents — it's the orchestration layer. Getting the routing right, keeping agents independent, and building proper observability is where the real engineering lives.

If you're building something similar or have questions about the GCP architecture, drop a comment or find me on GitHub!


Built for the Gen AI Academy APAC Edition — Google Cloud × H2S. Track: Multi-Agent AI Systems.`

Top comments (1)

Collapse
 
amulya631 profile image
Batila Amulya

if you like my content follow for more!!