Building operations · facility management

Every complaint answered.
Every lift serviced on time.

Keystone is the operations desk for the people who run buildings: a helpdesk that logs and routes work with a live SLA clock, a service schedule for every lift, DG set and pump, a QR link residents use without an app, a digital gate register and weekly utility meters. One screen tells the manager what needs them today, and why.

The demo opens straight in, with no PIN or sign-up. All properties, people and numbers in it are synthetic.

Keystone's Today screen: occupancy, open work, work past its SLA, service overdue, a list of flags and a ranked plan
The Today screen for a four-property portfolio. Every tile equals a stated database query; every flag links to the record it names.
4property types in one desk: homes, offices, a plaza, warehouses
7kinds of attention flag, each linking to its record
4 hcritical-work SLA, paused only while on hold
0apps residents need to install
The problem

Buildings run on WhatsApp, registers and memory.

A facility firm in Hyderabad may look after a gated community, an office block, a mall-front plaza and a warehouse park at once. The work is relentless and mostly invisible until something fails.

Complaints get lost

Residents message the supervisor, the guard, the association secretary. Nobody knows which leak is three days old, or that the "lift making noise" message came before the lift stopped.

Service slips quietly

The DG set's monthly load test, the fire pump check and the lift AMC visit live in a notebook. The first sign of a missed service is a breakdown, often the week an AMC lapsed.

Nobody sees the whole picture

Occupancy sits in one spreadsheet, the gate book in another, diesel consumption in a third. A manager cannot say, before 9 am, what needs them first.

"The desk should tell me which three things will hurt us today, not show me forty tickets in the order they arrived."

The product

One desk, four jobs done properly.

Keystone is server-rendered, fast on a helpdesk PC and a technician's phone, and built around a simple rule: anything that can drift (vacancy, SLA state, service due dates, consumption) is computed from facts when you look at it, never typed in.

Work orders with an honest SLA clock

  • Every complaint gets a number, a property, optionally a unit and an asset, a category and a priority.
  • The SLA window follows the priority: 4 hours critical, 1 day high, 3 days medium, 7 days low. Time on hold for parts or access pauses the clock.
  • A guarded lifecycle (open, assigned, in progress, on hold, resolved, closed) refuses shortcuts like closing unassigned work.
  • The technician board shows each person's queue oldest-first, with late work edged in red.
A work order page with its SLA over by several hours, next-step buttons and a timeline
A work order past its window. The timeline is written by the lifecycle itself.

Portfolio at a glance

  • Property cards show occupancy, open work, work past SLA and overdue service.
  • A floor-by-floor unit grid shows occupied, vacant and leases ending in 60 days.
  • Move-in and move-out are the only ways a unit changes status, so the vacancy count cannot disagree with the occupant list.
Kaveri Heights: 96 flats on a floor-by-floor grid, open work and the systems list
Kaveri Heights, a 96-flat community: the unit grid, open work and every system's next service.

Preventive service that moves by itself

  • Lifts, DG sets, pumps, STP and WTP plants, fire systems, chillers, transformers, CCTV and solar, each with an interval.
  • Next due is derived from the last service record: overdue, due this week, later.
  • AMC contracts are flagged 30 days before they end. A breakdown takes the asset out of service and raises a linked work order.
The preventive service schedule in three columns: overdue, due in seven days, later
The schedule is never edited by hand. Record a service and the asset moves column.

Residents report in their own words

  • Each property has a public link, printed as a QR poster for the lift lobby. No app, no login.
  • Triage reads English or Hinglish ("lift atak gaya", "paani nahi aa raha") and sets category and urgency; a stuck lift, smoke or a gas smell is always critical.
  • The resident gets a signed tracking link that shows their request's progress and nothing else.
The public request form on a phone
The resident's tracking page showing the request was received

An assistant that shows its working

  • Log a complaint: paste the WhatsApp message; the work-order form fills itself.
  • What needs me today: a ranked list across every property, each item with its reason. The ranking follows fixed rules, so it is the same every time.
  • Brief on this property: four sentences with the real numbers and one recommendation.
  • It uses Claude or OpenRouter when a key is configured and a deterministic fallback when not, and the badge always says which.
The assistant drawer reading a Hinglish complaint as a critical lift problem
"Lift atak gaya hai, ek aunty andar hai": critical, lift, flat 702, with the words that decided it.
RULE 1

Derived, never stored

Vacancy, SLA breaches, service due dates and utility consumption are computed when read. A reading lower than the last one is refused ("the meter went backwards").

RULE 2

The assistant degrades honestly

Every AI feature has an offline path, model output is checked against a schema, and a model can never downgrade a safety-critical call.

RULE 3

Residents never need an account

One public link per property creates work; one signed link per request shows its status. Staff notes, names and costs stay inside.

RULE 4

Everything exports

Work orders (with the SLA verdict), occupants, assets and readings download as CSV from the same functions the screens use.

Architecture

One process, one file, two ways to run it.

FastAPI renders every page; SQLite holds the whole desk in one file. The same code runs on a site office PC under pm2 and as this hosted twin, where the database lives in temporary storage and rebuilds itself from a deterministic seed.

WHO USES IT ResidentsQR link · tracking page Helpdesk & managerbrowser, signed in Techniciansphone: queue, services Other systemsJSON API · CSV ONE FASTAPI PROCESS Pages (Jinja2) · public /r/ and /t/ · /api/v1 with feed tokensigned-cookie sessions: manager · helpdesk · technician · shared OC Apps guest Domain rulesSLA clock · lifecycleschedule · consumptionoccupancy · flags Assistanttriage · today's plan · briefClaude → OpenRouter→ deterministic fallback Facts only, in SQLite (one file)properties · units · occupants · assets · services · work ordersvisitors · meters · readings · events (the activity log) WHERE IT RUNS On-site lanea PC or small serverpm2 · data stays on siteAI optional Hosted twin (this site)Vercel · same codesynthetic seed, rebuilton every cold startshared OC Apps gate
Feature matrix

What is built, and how we know.

Generated from the internal build tracker. A capability is marked built only after its acceptance test has run; the reference product's larger ideas are listed as roadmap, not claimed.

43 of 47 tracked capabilities built and verified · 0 partial · 4 on the roadmap. Generated from the build tracker; each row names the test that proved it.

AreaCapabilityStatusProof (acceptance test)
FoundationsSchema: properties, units, occupants, assets, services, work_orders, visitors, meters, readings, eventsBuiltdb.init() on an empty file creates exactly those 10 tables plus schema_version; running it twice is a no-op (row counts unchanged)
FoundationsSynthetic seed: a Hyderabad facility firm's four propertiesBuiltseeded DB holds 4 properties of 4 different types, >=130 units, >=100 occupants, >=30 assets, >=60 work orders covering every status and priority, >=12 weeks of readings on >=10 meters and >=20 visitors; reseeding an empty DB gives the same counts
FoundationsApp shell: FastAPI boot, /healthz, base layout with design tokensBuiltcurl /healthz returns 200 JSON with ok=true, db path, property/unit/work-order counts and ai provider; the signed-in dashboard returns 200 HTML with the nav
FoundationsTest harnessBuiltpytest -q runs >=1 test against a temp DB via TestClient and passes
PortfolioProperty list with health tiles (occupancy, open work, overdue service, SLA breaches)BuiltGET /properties shows one card per seeded property; each card's occupancy % equals occupied/total units from SQL and its open-work count equals the SQL count of unclosed work orders
PortfolioProperty detail: floor-by-floor unit grid coloured by status, systems, open work, metersBuiltGET /properties/{id} renders one cell per unit grouped by floor (headless: cell count == SQL unit count, 0 console errors) plus the property's assets and its open work orders
PortfolioUnits and occupants: move-in, move-out, lease dates, vacancy derived from occupantsBuiltPOST a move-in on a vacant unit makes it occupied and writes an 'occupant.moved_in' event; a second move-in on the same unit returns 409; move-out makes it vacant again; unit status is never stored, only derived
PortfolioOccupant directory with search and lease-expiry filterBuiltGET /occupants?q=<fragment> lists only matches; ?expiring=60 lists exactly the occupants whose lease ends within 60 days of today (SQL check)
PortfolioProperty create/edit with unit generator (floors x units per floor)BuiltPOST /properties with floors=3 and per_floor=4 creates the property and 12 units numbered 101…304; a missing name returns 422 with the field message
Work ordersWork-order register with property, status, priority, category and technician filtersBuiltGET /work?status=open&priority=critical returns only rows matching both; headless: one row per matching seeded work order with 0 console errors
Work ordersCreate work order (property, unit, asset, category, priority) with sequential WO numbersBuiltPOST /work creates WO-<year>-NNNN one higher than the last and an event; a unit from another property is refused with 422
Work ordersLifecycle: open → assigned → in progress ⇄ on hold → resolved → closed; reopen guardedBuilttests/test_lifecycle.py walks every legal edge and asserts 409 on open→closed, closed→in_progress and resolved→assigned; resolving stamps resolved_at and needs a resolution note
Work ordersSLA clock computed at read time from priority (critical 4 h, high 24 h, medium 72 h, low 7 d)Builttests/test_sla.py freezes 'now' and asserts due time, time left and breached flag for one work order per priority, including one resolved late (breached stays true) and one on hold
Work ordersTechnician board: each technician's open work, oldest first, with breach countBuiltGET /board lists every technician with a count equal to SQL open work orders assigned to them; unassigned work appears in its own column
AssetsAsset register per property: lifts, DG sets, pumps, STP, fire systems, HVAC, transformersBuiltGET /assets?property=<id> lists only that property's assets; ?kind=lift lists only lifts
AssetsPreventive schedule derived from last service + interval: overdue / due in 7 days / laterBuiltGET /maintenance groups every asset into overdue, due this week and later with counts equal to a SQL recomputation for today's date
AssetsRecord a service: log row, next due date moves, asset status can changeBuiltPOST /assets/{id}/service with a date and note writes a services row and an event; the asset's next due date becomes that date + interval; a future date is refused with 422
AssetsAMC (annual maintenance contract) tracking with expiry flagsBuiltassets whose AMC ends within 30 days show an 'AMC expiring' flag on the asset page and in the dashboard flags; the seeded DB has >=1 such asset
AssetsAsset breakdown raises a work order linked to the assetBuiltPOST /assets/{id}/breakdown marks the asset out of service and creates a high-priority work order whose asset_id is that asset; resolving the work order offers to return the asset to service
Residents & gatePublic request page per property (QR poster link) with no loginBuiltGET /r/<property token> returns 200 without a session; POST with flat and message creates a work order with source=resident, category and priority set by triage, and redirects to a tracking link; a bad token is 404
Residents & gateResident tracking page shows status and time line, never other residents' dataBuiltGET /t/<signed token> shows only that work order's status history; a tampered token returns 404
Residents & gatePrintable QR poster for each property's request linkBuiltGET /properties/{id}/poster returns 200 HTML containing an inline SVG QR code that decodes to that property's request URL (checked by a QR decoder in the test)
Residents & gateGate register: visitor in / out, purpose, unit visited, on-premises list, overstay flagBuiltPOST /gate logs a visitor in and an event; POST /gate/{id}/out stamps exit; GET /gate lists on-premises visitors only; a visitor in for >8 h carries the overstay class
Utilities & dashboardMeter readings entry: electricity (kWh), DG diesel (litres), water (kL); consumption derivedBuiltPOST a reading lower than the previous one on the same meter returns 422 ('meter went backwards'); a valid reading appears and weekly consumption equals the difference of successive readings
Utilities & dashboard12-week utility trends per property plus energy intensity (kWh per 1,000 sq ft)BuiltGET /utilities renders 12 bars per meter kind (headless: bar count check) and an intensity figure equal to hand-computed kWh / area * 1000 for one property in a test
Utilities & dashboardDashboard: occupancy, open work, SLA breaches, overdue service, today's visitors, flagsBuilta test asserts each dashboard tile equals its SQL definition on the seeded DB; headless: 0 console errors
Utilities & dashboardAttention flags: SLA breaches, overdue service, AMC expiring, leases expiring, diesel spikeBuiltthe seeded DB raises >=3 flag kinds; each flag links to the record it names and the link returns 200
Utilities & dashboardActivity log and CSV exports (work orders, occupants, assets, readings)BuiltGET /export/work.csv has work-order count + 1 rows with an SLA-breached column; /activity lists events newest first and filters by kind
AssistantProvider layer: Anthropic → OpenRouter → heuristic; never raises; badge in /healthzBuiltwith no keys set /healthz ai=heuristic; a test monkeypatches a failing provider and the assistant still answers with provider='heuristic'
AssistantComplaint triage: a resident's WhatsApp-style message → category, priority, flat, asset, titleBuilttests/test_triage.py runs >=12 labelled messages (English and Hinglish) through the heuristic; category accuracy >=10/12, every 'lift stuck' / 'fire' / 'gas smell' message is critical; LLM output is validated against the same schema and rejected on mismatch
AssistantToday's plan: ranked next actions across the portfolio with the reason for eachBuiltGET /copilot/plan returns >=5 actions on the seeded DB, ordered by score, each naming a record id that exists; every SLA breach on the seeded DB appears before any routine service item
AssistantProperty brief: one paragraph with the numbers and one recommended actionBuiltthe brief for a seeded property mentions its occupancy %, open work count, breach count and overdue service count exactly as the property page shows them
AssistantAssistant drawer on every page with an honest provider badge; triage prefills the formBuiltheadless: drawer hidden at rest, opens, badge text matches /healthz ai, sample triage fills category and priority on /work/new and closes the drawer
AccountsRoles manager / helpdesk / technician with signed-cookie sessionsBuiltsigned-out GET /desk redirects to /login; each seeded login signs in; a technician POST /properties returns 403 and a helpdesk POST /work returns 303
AccountsShared OC Apps guest login (guest-YYMMDD-xxxx, HMAC password, 2 days)Builta test derives a guest password with SESSION_SECRET, signs in and gets the manager role; a 4-day-old guest name is refused
AccountsUsers page: invite link, role change, deactivate (manager only)Builta manager creates an invite, signing up with it yields that role; a helpdesk GET /users returns 403
ShipJSON API v1 with feed token (properties, work orders, readings)BuiltGET /api/v1/work without token returns 401 JSON; with ?token=<FEED_TOKEN> returns 200 with count equal to the work-order table
ShipLocal lane under pm2 on :8381, survives restartBuiltpm2 shows 'keystone' online; curl 127.0.0.1:8381/healthz ok=true after pm2 restart keystone; pm2 save done
ShipHeadless walk of every page: 0 console errors, 0 failed requests, both themesBuilttools/walk.py exits 0 against :8381 and prints every check as ok
ShipHosted twin on Vercel behind the shared OC Apps gateBuiltkeystone.ajaykongala.online/healthz returns ok=true; /desk without the oc_access cookie redirects to /demo; with the PIN and a shared guest login the dashboard renders (walk against the twin exits 0)
ShipBetadoc LONG: story, architecture, honest matrix generated from this tracker, documentation pageBuiltGET / and /documentation.html on the twin return 200; the matrix block equals tools/matrix.py output for the current tasks.db; walk of both pages in light and dark has 0 console errors
ShipOC Apps card: apps.json entry, mark, /keystone/ rewrite, measured memory, deployBuilttools/check_apps.py says schema ok; build_site.py renders a Keystone card; oc-apps.ajaykongala.online/keystone/ returns the betadoc
ShipRegister: port registry rows, HOME.md line, mirror repo ajay-453/keystoneBuiltport_registry.py list shows 8381 and 6802; tools/mirror_repos.sh keystone pushes and prints the commit count
Beyond v1Live sensor ingest (BACnet / Modbus gateway) replacing hand-entered readingsRoadmapa gateway process posts readings every 15 min from a real or simulated BMS (building management system) for 24 h and /utilities shows them with no manual entry
Beyond v1HVAC and lighting set-point advice from occupancy and weatherRoadmapfor a week of real readings the advice predicts next-day kWh within 15% and names one set-point change per property
Beyond v1Maintenance dues billing and UPI collection for residentsRoadmapa resident receives a monthly dues bill, pays by UPI in a sandbox, and the ledger shows paid with the reference
Beyond v1ESG report per property (energy, water, diesel per sq ft, year on year)RoadmapGET /properties/{id}/esg renders a one-page report whose figures match the readings table for the chosen year
Roadmap

Next, in the order customers ask for it.

Maintenance dues and UPI

Monthly dues bills per flat, UPI collection, a ledger the association treasurer can reconcile. The most requested feature for residential communities.

Live meters from the BMS

A small gateway reading the building management system over BACnet or Modbus, so readings arrive every 15 minutes instead of by hand.

HVAC and lighting advice

With live readings and occupancy, next-day energy forecasts and one concrete set-point change per property.

ESG report per property

Energy, water and diesel per square foot, year on year, in the format owners and tenants increasingly ask for.

Deployment

Runs where the building is.

On site

A Python 3.12 service with one SQLite file. Runs under pm2 (or systemd, or Docker) on the site office PC or a small server; residents' QR links point at it through your usual tunnel or domain.

  • No external services required; the assistant works without any AI key.
  • Add ANTHROPIC_API_KEY or OPENROUTER_API_KEY to switch triage and briefs to a model.
  • Backups: copy one file.

Hosted twin

The same code on Vercel behind the shared OC Apps access gate. Its database is rebuilt from the synthetic seed on every cold start, so a prospect can change anything and nothing sticks.

  • Environment knobs only: KEYSTONE_HOME=/desk, KEYSTONE_BASE_URL, SESSION_SECRET, FEED_TOKEN.
  • Moving off paper registers: every list exports to CSV today; CSV import is not built yet and is planned with the dues work.

Open the desk.

Sign in as a guest manager, clear the flags on the Today screen, report a problem from a phone as a resident, and watch it land on the technician board.