Project Story

Inspiration

I wanted prospective students in emerging markets to get transparent admissions guidance without waiting for a counselor. Watching human advisors juggle profile gaps, program research, and funding constraints inspired us to encode the same workflow inside a reliable agent that can appear in any chat interface.

What it does

  • Authenticates learners through Firebase, then passes their prompts—tagged with verified email context—to the CampusConnect root agent.
  • Uses ADK tools to pull/update Firestore profiles, parse resumes, and perform BigQuery-poIred course searches.
  • Serves a Next.js experience with chat, My Profile, and My Applications views, backed by the same Cloud Run endpoint.

How I built it

  • Agent core: Google ADK orchestrates the CampusConnect root agent plus sub-agents for document analysis and profile updates.
  • Serverless runner: FastAPI on Cloud Run verifies JWTs, initializes the Runner + session service, and forwards messages to the agent.
  • Data + auth: Firestore and BigQuery hold student data and catalog insights, while Firebase Authentication unifies email/social logins.
  • Frontend: Next.js consumes Firebase client SDKs for auth and calls /grestok-agent/ for chat + dashboard data.
  • Session management : The user’s Firebase JWT token is decoded to extract the UID, which serves as the unique session identifier in the ADK runtime. This ensures that every agent interaction is tied to the correct user context. The UID is used to fetch and update the corresponding user profile in Firestore, while maintaining an in-memory session within the Cloud Run instance for fast context retrieval. This design also lays the groundwork for future integration with Vertex AI Memory Bank, allowing persistent memory across sessions and devices.

  • Deployment workflow: The backend is containerized with a custom Dockerfile and deployed to Cloud Run using a Cloud Build YAML. For the frontend (Next.js app), the setup uses Firebase App Hosting’s GitHub integration, which triggers automatic builds and deployments on every GitHub check-in, maintaining a continuous delivery flow for both layers of the application.

  • Gemini CLI & AI Studio: Gemini CLI & AI Studio to the rescue! AI Studio helped accelerate frontend development even without deep frontend experience—generating clean UI scaffolds, component stubs, and markdowns directly from prompts. Gemini CLI served as an excellent “vibe coding” companion during agent development, offering inline suggestions and quick iterations while testing ADK logic and refining the Cloud Run workflow.

Challenges I ran into

  • Token verification: Supporting both inline JSON credentials and ADC fallback was essential for local dev vs. Cloud Run.

  • Asynchronous orchestration: Running multiple ADK sub-agents in sequence (resume parsing → Firestore update → BigQuery query) exposed timing issues when context was reused across calls. Implementing in-memory session caching solved it without additional database reads.

  • Vector search tuning: BigQuery’s vector embeddings were powerful but required fine-tuning. Early queries often returned too broad or irrelevant results until I added filtering logic and prompt-based guardrails to balance recall and precision.

  • Cold start edge cases: Even with Cloud Run optimizations, initializing Firebase Admin, Pydantic models, and ADK runners together caused startup latency spikes. Pre-warming key modules during the FastAPI startup event helped stabilize performance.

Accomplishments that I'm proud of

  • Maintained deterministic behavior by tying user_id to Firebase UID and injecting authenticated email text into every prompt.
  • Produced a reusable agent runner template that can be used to interact with other agents.
  • Using auth decorator to authenticate each call from frontend to backend

What I learned

  1. Fine-grained session management in ADK matters—tying user_id to Firebase UID keeps context isolated.
  2. Cloud Run cold starts can be mitigated by warming long-lived singletons during the FastAPI startup event.
  3. Prompt hygiene matters; surfacing the authenticated email in every message reduces hallucinated personas.

What's next for CampusConnect Agent

  • Expand the tool catalog with financial-aid estimators, visa-readiness checklists, and application timeline planners.
  • Add multilingual prompts plus translation layers so non-English speakers can participate.
  • Add voice based search using Gemini Live API

Built With

Share this project:

Updates