Inspiration

Inspiration

Dhaka's municipal response grids and emergency dispatch channels are frequently crippled by communication backlogs during flash waterlogging or severe road incidents. We wanted to build an automated, secure framework that structures incoming chaotic reports into clean operational data.

How We Built It

We engineered the backend framework using FastAPI, implementing a rigorous system for mapping urban risk indices securely behind OAuth2 security protocols and HS256 encrypted JWT tokens.

Agent Design & Human Handoff Boundaries

Following strict agent guidelines, the platform processes algorithmic calculations deterministically. We integrated strict operational boundaries directly into the backend logic: if utility path permutations scale past safe human triage thresholds ($n!$ combination limits), or the moment a definitive hazard priority matrix is finalized, the system trips an exception layer to hand off total control over to live human dispatch coordinators.

Challenges We Faced

Ensuring complete parameter validation across every single query string while maintaining absolute test reliability was a major focus. We resolved this by building a comprehensive testing layer that guarantees functional consistency.

What We Learned

We mastered configuring isolated multi-tenant projects on the OpenAI Developer Platform, structuring specialized agent skill registries, and maintaining 100% test coverage using advanced python authentication architectures.

What it does

Dhaka CivicPulse Engine is an AI-native urban calculation and telemetry framework optimized for assessing civic infrastructure failures, waterlogging risks, and emergency triage priority metrics across Dhaka City Corporation zones. Securing its routing endpoints under valid user sessions, the engine ingests numeric urban vulnerability factors to perform the following critical operations:

  • Priority Dispatch Scoring (/add): Combines hazard factors and localized structural indices to generate a triage dispatch sorting key.
  • Affected Population Radius Footprint (/multiply): Multiplies regional citizen densities by neighborhood block dimensions to define hazard zone perimeters.
  • Cascading Risk Projections (/power): Computes exponential risk expansion tracking how rapid utility blockages or flood levels amplify over delay intervals.
  • Path Permutation Layouts (/factorial): Evaluates exact combinations for routing utility and emergency vehicle deployment.

How we built it

We engineered the core system architecture on top of the high-performance FastAPI framework, utilizing explicit type hinting to enforce data validation. To establish a secure operational parameter, we integrated an OAuth2 password-tracking layer that hashes credentials using Bcrypt and issues time-delimited access security keys signed with an encrypted HS256 JWT protocol. The entire architecture operates deterministically to eliminate any risk of generative AI hallucinations.

Challenges we ran into

One of our biggest hurdles was refactoring abstract algebraic validation paths into tangible municipal telemetry parameters while maintaining strict backwards compatibility with pre-existing client assertions. Under immense hackathon time pressure, we had to ensure that introducing complex exponential risk matrices and custom error bounds did not break our authorization filters or payload delivery contracts.

Accomplishments that we're proud of

  • 100% Automated Test Coverage: We successfully built a bulletproof testing layer using pytest, validation-checking edge cases, query validation models, missing token rejections, and parameter boundaries over 52 consecutive validation tests.
  • Hardcoded Human Handoff Safeguards: We successfully implemented clear boundaries into our logic loops. If calculations exceed physical triage capabilities (such as negative block allocations or excessive routing permutations triggering a 400 Bad Request), the engine halts processing to transition control to live emergency dispatchers.

What we learned

Through this development sprint, we learned how to effectively construct markdown registries like AGENTS.md and explicit SKILL.md workflows to define how automated engines process structural tasks. We also gained deep insight into optimizing applications using the OpenAI Developer Platform, structuring environments to handle rapid token-efficient validation loops smoothly for fractions of a cent.

What's next for Dhaka CivicPulse Engine

The immediate next phase is building the unstructured multi-lingual ingestion front-end. We will use OpenAI models to intercept chaotic, raw citizen complaints submitted in Bangla, English, or Banglish via social media or messaging webhooks. The model will parse the unstructured text, extract the raw mathematical variables (hazard vectors, density coordinates, block numbers), and feed them securely straight into our validated FastAPI optimization endpoints for instant, automated routing.

Built With

  • bcrypt
  • fastapi
  • pwdlib
  • pyjwt
  • pytest
  • python
Share this project:

Updates

Submission history