Get natural language answers to questions about actual New York City property deeds!
App Link: http://35.224.150.159:8000
Deployed a scalable web app with LLM integration on GCP, containerizing a full-stack solution with Docker via REST API to deliver Pinecone-based vector search (lexical and semantic) over 500k+ property records with BigQuery-powered access control.
React UI (built with Node/Vite) sends a question to a Python FastAPI service, which triggers Airflow to run data/AI steps; Airflow produces a natural-language answer (using DuckDB/dbt + Pinecone + Gemini), FastAPI returns it, React shows it. Everything runs in Docker containers on a GCP Compute Engine (VM: e2-standard-2 with 2 vCPUs and 8 GB Memory, OS: Debian GNU/Linux 12) with BigQuery access control enforcing 3 queries per day per IP and top ranked record matches ≤ 100 limits.
- User types a question in the React page.
- The page sends the question to the Python FastAPI server.
- FastAPI checks BigQuery for IP-based query limits (3 queries/day) and validates top_k ≤ 100.
- If limits exceeded, FastAPI returns 429/400 error without triggering DAG.
- If allowed, FastAPI calls the Airflow REST API to trigger a DAG run.
- Airflow runs tasks in Docker containers:
- Build dbt models
- Upsert and search vectors using the VectorDB's integrated embedding models
- Call the Gemini API to route the question and generate an answer
- FastAPI polls the Airflow REST API to get the result.
- FastAPI logs the successful query to BigQuery for access control tracking.
- FastAPI sends the result back to the browser.
- React displays the answer to the user.
- React.js: UI in the browser.
- Node.js/Vite: builds the React app.
- FastAPI: main backend that coordinates and returns answers.
- Airflow: orchestrates the workflow.
- Docker: runs each task in its own container.
- Compose: defines setup and runs Docker containers together as one stack.
- PostgresSQL: stores Airflow metadata.
- Redis: handles task queuing used by Airflow's Celery executor.
- DuckDB + dbt: quick lightweight db + data transformation.
- Pinecone VectorDB: serverless vector database with integrated embedding to upsert and search text
- BigQuery: cloud data warehouse for access control and query logging.
- Gemini 2.5 Flash Lite: LLM that routes queries + creates the final answer.
- GCP VM: server host (machine/IP) where containers run.
- Containerization of each service.
- BigQuery access control: IP-based rate limiting and resource validation.
- Query logging: All successful requests logged to BigQuery for governance tracking.
- Health checks in Compose:
- Postgres check (every 5s, 5 retries): Checks if the database is accepting connections.
- Redis (every 5s, 5 retries): Sends a ping to Redis, expects pong back.
- Airflow webserver (every 30s, 30s start period, 5 retries): Makes an HTTP request to Airflow's health endpoint.
- Startup dependencies in Compose:
airflow-initwaits for Postgres/Redis healthy.- Webserver/Scheduler/Worker wait for
airflow-initsuccess. apiwaits for webserver healthy.
- Env variables for credentials/URLs.
- Tracing/metrics: use OpenTelemetry SDKs for FastAPI and Airflow to capture request timing and failures.
- Dashboards/alerts: Cloud Monitoring for error rates, latency, task failures.
- BigQuery analytics: Create dashboards showing query patterns, user behavior, and access control metrics.
- Cost optimization: Add query cost tracking and automatic throttling for expensive operations.
- CI: on git push, run tests, build images.
- Security: scan Docker images for vulnerabilities.
- CD: to deploy new images to the GCP VM if CI passes,
- Rollback: keep last known good image/version.