GovPolicy Engine

Overview

Government policies are often lengthy, unstructured, and written in complex legal language. Field officers, however, require clear and actionable workflows for implementation.

GovPolicy Engine converts unstructured policy documents into structured workflows, decision trees, document checklists, and an automated rule engine for case validation.


What It Does

  • Extracts entities, conditions, and rules from policy text
  • Converts logic into step-by-step workflows
  • Generates decision trees
  • Creates required document checklists
  • Builds a workflow graph (nodes + transitions)
  • Validates real-world cases using a rule engine

How It Works

The GovPolicy Workflow Engine works in four simple steps: Ingestion: You upload a policy PDF or paste text. The engine uses PDF.js to extract the raw text directly in your browser. AI Extraction: The text is sent to the Gemini AI Engine, which "reads" the policy like a human expert to identify: Nodes: Start points, steps, and decision junctions. Edges: The logical flow between steps. Rules: The specific conditions (e.g., "Revenue < $2M").

Visualization: The extracted data is instantly mapped into an interactive D3.js Graph, showing you the policy as a visual decision tree.
Validation: You can describe a specific "case" (e.g., a business application), and the Rule Engine checks those details against every extracted policy rule to tell you if the case is compliant or has violations

Features

  • Interactive Workflow Graph
  • AI-powered rule extraction
  • Deterministic validation engine
  • Transparent approval/rejection reasoning
  • Modern UI with smooth animations

Accomplishments

  • Successfully converted legal text into machine-readable rules
  • Built an end-to-end AI workflow pipeline
  • Designed a graph-based decision visualization
  • Delivered a fully working demo

What We Learned

  • Prompt engineering for structured AI output
  • Converting probabilistic AI results into deterministic logic
  • Graph-based workflow visualization
  • Building reliable validation systems

Additional Note

The GovPolicy Workflow Engine currently operates as a real-time, client-side engine, which means it does not use a persistent database for its core operations.

Why no database? This is a deliberate design choice for this specific tool: Privacy & Security: Since government policies can be sensitive, all processing (PDF extraction and AI analysis) happens in your browser's memory. Your documents are not stored on a server. Speed: By keeping the workflow data in-memory, the graph and validation engine respond instantly without waiting for database queries.


Challenges

  • Handling ambiguity in legal text
  • Ensuring consistent JSON structure from AI
  • Designing clean workflow graph layouts

What's Next

  • Multi-policy comparison
  • Conflict detection
  • Multilingual support
  • Department-level deployment
  • Scalable SaaS implementation

Built With

Share this project:

Updates