Skip to content

Repository files navigation

Off Grid Commercial Intelligence Engine

Python 3.12 FastAPI React 19 TypeScript 5.9

Docker AWS OpenAI SQLite

A decision engine—not a data pump.

Turns construction-project records into evidence-backed commercial opportunities.
Separates what looks valuable from what is actually trustworthy.

How it works  ·  Stafford golden path  ·  Commercial motions  ·  Architecture  ·  Run locally



Why Off Grid needs this

CONSTRUCTION DATA IS USEFUL · COMMERCIAL JUDGMENT MAKES IT ACTIONABLE

Off Grid's workflow spans ConstructConnect, Apollo, Pipedrive, Google Sheets/Forms, and Trello. Connecting those tools is not the hard part. The hard part is deciding:

  • which projects matter;
  • which facts deserve trust;
  • which company and person are relevant;
  • what Off Grid could sell; and
  • when an opportunity is clean enough to enter the CRM.
QUALIFY
Is this project commercially relevant?
VERIFY
What evidence supports the decision?
ACT
What should the commercial team do next?

Important

The application does not treat parsed source data as truth and push it into Pipedrive. Every important conclusion retains provenance, confidence, and decision treatment.


How it works

FROM SOURCE RECORD TO COMMERCIAL ACTION

Source data moves through trust, qualification, resolution, action and CRM readiness

Evidence treatment What it means System behavior
Explicit The source directly states it Preserve with provenance
Derived Deterministic logic can reproduce it Use under versioned rules
Inferred Commercial reasoning suggests it Explain and verify
Questionable The source conflicts with itself or reality Cap, warn, route, or block
Unknown The evidence is not there yet Keep it unknown; identify the next step

Note

Commercial fit and data confidence are separate dimensions. A project can be attractive while still containing unreliable information.


Stafford golden path

THE END-TO-END DECISION CASE

The supplied Stafford Technology Campus Phases 3 & 4 record contains strong opportunity signals: data-center construction, site work, paving, EE Reed involvement, and multiple phases.

It also reports a $7.5B value that should not be trusted blindly. The source says that value reflects the larger development and that phase-level costs are not publicly confirmed.

$7.5B
retained as source-reported
LOW CONFIDENCE
phase value not verified
ZERO POINTS
cannot control disposition
PROMISING / VERIFY
investigate before action
Commercial Fit and Data Confidence remain separate dimensions

Golden result Value
Commercial Fit Promising candidate — VERIFY
Data Confidence MEDIUM (independent evidence state)
Without the reported $7.5B No band or action change
CRM state Lead-ready / Deal-blocked

The internal qualification-2.0 ordering score is 57, but the UI presents the defensible band and action—not false decimal precision or a success probability. KVT, KV6, and KVP remain UNVERIFIED_APPLICABILITY until direct lighting or power need is confirmed.

Product applicability is separate from the deterministic products-2.1 characteristic-relevance index. Stafford currently produces KVT 75/100 (strong context), KV6 75/100 (strong context), and KVP 59/100 (moderate context). These values are ordering aids, not fit percentages or demand. Each product counts one bounded site_activity_context signal plus new-construction and multi-phase context; site_work, paving, GC-awarded stage, reported value, and large-development scale cannot add duplicate product points. Direct lighting or power evidence remains an independent gate.

Tip

The backend can remove the reported value from scoring and recalculate the recommendation. The result explains what drives the decision instead of hiding judgment inside one AI score.

What could change the recommendation?
  • Who controls temporary lighting and portable power?
  • Has relevant equipment already been committed elsewhere?
  • Which rental company serves the project?
  • What work is actually underway?
  • Does the site create meaningful KVT, KV6, or KVP demand?

Two commercial motions

ONE PROJECT · TWO CONNECTED AUDIENCES

Contractor-demand and rental-house fleet motions

Contractor demand Rental-house / fleet opportunity
Move from a live project to the people experiencing the site need Translate demonstrated demand into a partner, branch, fleet, or channel opportunity
Goal: product demonstration request Goal: demo, fleet placement, or channel sale
Current path: highest investigation priority Current path: dependent on partner identification

Warning

If Stafford's rental provider is not identified, that node remains UNRESOLVED. The engine does not invent an answer to complete the workflow.

What the EE Reed record reveals

The EE Reed record contains useful intelligence alongside repeated contacts, likely name variants, generic inboxes, multiple domains, mixed historical/current projects, and limited project-specific role evidence.

The engine surfaces those issues before CRM promotion and recognizes related phases without automatically double-counting them:

Stafford Technology Campus
├── Phases 1 & 2
└── Phases 3 & 4
Why contact resolution is a verification ladder
Discovered
    ↓
Employment Verified
    ↓
Project Association Verified
    ↓
Role Relevant
    ↓
Authority Verified

A strong project contact is not automatically the final rental decision-maker. If the evidence stops early, the application says so and generates the next verification questions.


Deterministic truth, optional AI

AI EXPLAINS AND REASONS · SOFTWARE RETAINS AUTHORITY

Deterministic software owns OpenAI may assist with
IDs, money, dates, deduplication Understanding construction descriptions
Provenance and evidence state Extracting semantic commercial signals
Workflow and verification state Evidence-grounded product reasoning
CRM identity and readiness gates Explanations, summaries, and analysis

Important

AI-generated factual claims must point back to application evidence. Unsupported claims are rejected instead of promoted into company data. The deterministic core works when OpenAI is disabled or unavailable.

Questions the Commercial Analyst can answer
  • Why should we pursue Stafford?
  • What data should I not trust?
  • Would the recommendation change without the $7.5B value?
  • Which product appears to fit best?
  • Who should we investigate next?
  • What blocks this opportunity from entering Pipedrive?
  • What should I ask on the first call?

CRM readiness—not CRM noise

QUALIFY FIRST · RESOLVE IDENTITY · VERIFY AUTHORITY · THEN PROMOTE

Raw intelligence → Qualified opportunity → Entity resolution
      → Contact resolution → CRM readiness → Pipedrive Lead
      → Commercial validation → Pipedrive Deal

External adapters default to safe modes:

PIPEDRIVE_MODE=dry_run
APOLLO_MODE=off
DEMO_MODE=true

Ambiguous records enter an Exception Queue instead of continuing quietly. They can be verified, corrected, deferred, retried, or escalated.

Note

The intended production KPI is System-Sourced Demos Booked — Rolling 30 Days. It displays N/A in the interview environment because no production outcome history is connected.


Architecture

ONE APPLICATION · CLEAR BUSINESS BOUNDARIES

Off Grid application architecture

FRONTEND
React 19 · TypeScript · Vite
BACKEND
Python 3.12 · FastAPI · SQLAlchemy
DATA
SQLite · Alembic · portable models
DOCUMENTS
PyMuPDF · pdfplumber
INTELLIGENCE
Deterministic rules · optional OpenAI
DELIVERY
Docker · GitHub Actions · AWS

The implementation deliberately stays compact: one frontend, one backend, and one relational database. Complexity lives in the commercial rules and evidence boundaries—not unnecessary infrastructure.


Run locally

THE FASTEST PATH IS ONE DOCKER IMAGE

git clone https://github.com/KevinSGarrett/Off_Grid.git
cd Off_Grid

docker build -t offgrid-commercial-intelligence:local .
docker run --rm -p 8080:8000 offgrid-commercial-intelligence:local

Open http://localhost:8080 and verify http://localhost:8080/api/v1/health.

The employer demo is publicly viewable without login; external writes remain disabled or dry-run, and private/source data remains excluded. The deterministic core works without OpenAI, Apollo, or Pipedrive credentials.

Hosted employer demo

The publicly viewable AWS employer demo is available at:

https://of-f07eea2ba1d043d6804dad505d7498ab.ecs.us-east-1.on.aws

No dashboard login is required. The hosted Commercial Analyst uses the authorized bounded server-side OpenAI path, while deterministic behavior remains available during provider disablement or failure. Apollo and consequential CRM writes remain off or dry-run; private source documents and credentials remain excluded.

Developer setup

Requirements: Python 3.12, Node.js 22, npm, and Docker.

Windows PowerShell:

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe scripts\run_public_test_matrix.py

npm --prefix apps/web ci --no-audit --no-fund
npm --prefix apps/web run typecheck
npm --prefix apps/web run build

Linux or macOS:

python3.12 -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python scripts/run_public_test_matrix.py

npm --prefix apps/web ci --no-audit --no-fund
npm --prefix apps/web run typecheck
npm --prefix apps/web run build

Repository map

apps/api/           FastAPI application, domain services, migrations
apps/web/           React + TypeScript employer/analyst interface
config/             Qualification, trust, product and workflow rules
prompts/            Versioned, evidence-aware OpenAI prompts
data/demo_seed/     Sanitized deterministic demo database
tests/              Golden, unit, integration, failure and E2E tests
scripts/            Validation, reset, scoring and privacy tools
infra/aws/          ECR, ECS, Secrets Manager and OIDC templates

Parsed does not mean trusted.
A likely contact is not a verified decision-maker.
Commercial fit and data confidence are not the same thing.
Unknown is better than fabricated certainty.


Kevin Garrett
AI Solutions Architect · Applied AI & ML/LLM Engineering · Systems & Cloud Architecture

GitHub profile  ·  Built for the Off Grid Innovation USA technical interview

About

Evidence-backed commercial intelligence engine that turns construction project data into qualified, CRM-ready sales opportunities for Off Grid Innovation.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages