Seed Data
This page documents the RRC oil & gas vertical — the first entity schema installed on AEGIS. Entity types are runtime DB-backed and tenant-configurable; RRC is simply the first set.
AEGIS provides multiple seed scripts that populate the database and knowledge graph with sample data for development and demos. This page documents each seed script, what it creates, and how to run it. The entities these scripts write (wells, leases, operators, …) are the oil & gas set — a second installed vertical would ship its own seed data against its own runtime entity_type_definitions.
Seed Scripts Overview
| Script | Location | Populates | Run Method |
|---|---|---|---|
| Knowledge Graph Seed | services/knowledge-graph-service/src/knowledge_graph/seed.py | Apache AGE graph (wells, leases, operators, etc.) | curl -X POST http://localhost:8003/seed |
| Checklist Template Seed | services/orchestration-engine/src/orchestration/seed_checklists.py | checklist_templates table | poetry run python -m orchestration.seed_checklists |
| Rule Version Seed | services/orchestration-engine/src/orchestration/seed_rules.py | rule_versions table | poetry run python -m orchestration.seed_rules |
| Demo Data Seed | services/orchestration-engine/src/orchestration/seed_demo_data.py | compliance_status, filing_checklists, chart data | poetry run python -m orchestration.seed_demo_data |
| Conversation Seed | services/orchestration-engine/src/orchestration/seed_conversations.py | conversations and conversation_messages tables | poetry run python -m orchestration.seed_conversations |
| EPA OOOOb Well Properties | services/orchestration-engine/src/orchestration/seed_oooob.py | OOOOb properties on Well vertices (via KG write-through) | poetry run python -m orchestration.seed_oooob |
Seed choreography: after a knowledge-graph full-wipe reseed, run the
flaring-monitor authorization seeder and then seed_oooob — the KG seed no
longer creates fa- vertices, and OOOOb well properties live only on the
Well vertices this seeder stamps. Seeding OOOOb properties does NOT change
the compliance matrix by itself; the epa_oooob column appears only after a
tenant assessment runs (which recomputes all domains).
Running All Seeds
After starting infrastructure with docker compose up -d and ensuring all services are running:
# 1. Seed the knowledge graph (requires KG service running on port 8003)
curl -X POST http://localhost:8003/seed
# 2. Seed checklists, rules, and demo data
cd services/orchestration-engine
poetry run python -m orchestration.seed_checklists
poetry run python -m orchestration.seed_rules
poetry run python -m orchestration.seed_demo_dataAll seed scripts are idempotent — they check for existing records before inserting and will update if the record already exists. They are safe to re-run.
Seed Identity (R42e)
Since R42e, seeds write real identities that satisfy the platform’s uuid FKs to users(id) — no more free-text sentinel strings:
| Seeded data | Identity written |
|---|---|
| Skill definitions (agent-config seed) | Owned by the earliest active admin, looked up at runtime — if no active admin exists yet, the ownership stamp is skipped fail-closed |
| Prompt templates/versions (agent-config seed) | Authored by system@aegis.local (the nil UUID 00000000-0000-0000-0000-000000000000) |
Demo data (seed_demo_data) | Tagged demo-seed@aegis.local (…deed5eed) — the seeder deletes-then-recreates only rows carrying this id |
Demo conversations (seed_conversations) | Owned by system@aegis.local |
The system users themselves are seeded by core migration 031_identity_normalization.sql and re-converged by auth-service on every boot — see the schema page.
Knowledge Graph Seed
Endpoint: POST http://localhost:8003/seed
File: services/knowledge-graph-service/src/knowledge_graph/seed.py
Creates a realistic Permian Basin scenario in the tenant’s per-tenant Apache AGE graph (tenant_<hex>_oilgas; the dev tenant’s is tenant_00000000000000000000000000000001_oilgas). This is the most comprehensive seed script, building the full entity topology.
Entities Created
| Entity Type | Count | Examples |
|---|---|---|
| Operators | 2 | Permian Basin Energy LLC, Basin Midstream Partners |
| Fields | 3 | Spraberry (Trend Area), Delaware Basin, Goldsmith |
| Formations | 2 | Wolfcamp A, Bone Spring |
| Leases | 5 | Mitchell Ranch, Jones Unit, Davis Ranch, Howard Unit, Delaware Basin Unit |
| Regulations | 2 | Rule 37 (Spacing), Rule 32 (Flaring) |
| Permits | 1 | W-1 permit for Mitchell Ranch 1H |
| Flaring Authorizations | 2 | Mitchell Ranch (expiring), Howard Unit (expiring ~30d) |
| Wells | 12 | Across 4 wellpads (Pad A-D) with full Form PR data |
| Wellpads | 4 | Pad A (Spraberry, 4 wells), Pad B (Spraberry, 3 wells), Pad C (Delaware, 3 wells), Pad D (Goldsmith, 2 wells) |
| Facilities | 4 | Tank battery, compressor, separator, CPF |
| Pipeline Routes | 3 | Including cross-field connector |
| Infrastructure Projects | 2 | Gathering system, processing plant |
Relationships Created
The seed data connects entities with edges including:
OPERATED_BY— wells, leases, facilities to operatorsLOCATED_IN— wells to leases and fieldsLOCATED_ON— wells to wellpadsCOMPLETED_IN— wells to formationsGOVERNED_BY— wells to regulationsOFFSET_TO— bidirectional between nearby wellsFLARES_AT— authorizations to wells/leasesPRODUCES_TO— wells to facilitiesFEEDS_INTO— facilities to pipeline routesCONNECTS_TO— infrastructure projects to leases
Demo Scenarios
The seed data supports three demo scenarios:
- Compliance blast radius: Mitchell Ranch 1H -> Pad A -> Tank Battery -> Gathering Line
- Infrastructure failure: Delaware Basin Compressor -> 3 wells, third-party operator
- Planning surface: Howard R-32 expiring -> Howard Connector -> Spraberry system
Well Production Data
Every well includes full Form PR production data with 12 months of history:
{
"production_oil_bbls": 5100.0,
"production_gas_mcf": 10800.0,
"production_casinghead_mcf": 420.0,
"production_condensate_bbls": 85.0,
"production_water_bbls": 2400.0,
"gas_sold_mcf": 9200.0,
"gas_used_on_lease_mcf": 380.0,
"gas_flared_mcf": 1100.0,
"gas_vented_mcf": 120.0,
"producing_days": 30,
"allocation_method": "test",
"form_pr_period": "2026-02",
"production_history_12m": [
{"period": "2026-02", "oil_bbls": 5100, "gas_mcf": 10800, ...},
{"period": "2026-01", "oil_bbls": 5300, "gas_mcf": 11200, ...},
...
]
}Skill Registry Seed — retired
The legacy seed_skills.py script and the skills / skill_artifacts / agents tier
registry it populated are retired (R41 B0). Nothing in the runtime read them.
Skills, routers, rules, personas, and agent definitions now live in the
agent-config-service (skill_definitions and related tables), seeded through that
service. See the agent-config-service docs.
Checklist Template Seed
Command: poetry run python -m orchestration.seed_checklists (from services/orchestration-engine/)
File: services/orchestration-engine/src/orchestration/seed_checklists.py
Creates one checklist template per discovered pack. The template content (items,
min_required_items) lives in the pack manifests
(services/orchestration-engine/src/orchestration/packs/<name>/manifest.yaml, R41 B2) —
the seeder just discovers packs and upserts, so adding or removing a pack changes the
seed set with zero seeder edits.
Templates Seeded
| Domain | Items | Description |
|---|---|---|
rule_37 | 11 items | Rule 37 spacing exception filing checklist |
rule_32 | 10 items | Rule 32 flaring exception filing checklist |
form_pr | 8 items | Monthly Form PR production report checklist |
flaring_monitor | 6 items | Flaring compliance monitoring checklist |
Checklist Item Structure
Each item defines:
index— Order within the checklistname— Human-readable item nameitem_type—data,document,form,artifacts, orvalidationcompletion_method—auto(agent-only) orhybrid(agent + human)agent_can— What the agent is capable of doing for this itemuser_must— What the human user is responsible forrequired_for_submission— Whether this item blocks filing submission
Example Rule 37 checklist items:
| # | Name | Type | Method | Required |
|---|---|---|---|---|
| 0 | Exception Type Determination | data | hybrid | Yes |
| 1 | Field Rule Lookup | data | hybrid | Yes |
| 2 | Offset Well Identification | data | hybrid | Yes |
| 3 | Affected Party Service List | data | hybrid | Yes |
| 4 | Waiver Collection Status | artifacts | hybrid | No |
| 5 | Form W-1 Population | form | hybrid | Yes |
| 6 | Certified Plat | artifacts | hybrid | No |
| 7 | Good-Cause Statement | document | hybrid | Yes |
| 8 | Supporting Technical Exhibits | document | hybrid | No |
| 9 | Fee Calculation | data | auto | Yes |
| 10 | Filing Readiness Check | validation | hybrid | Yes |
Rule Version Seed
Command: poetry run python -m orchestration.seed_rules (from services/orchestration-engine/)
File: services/orchestration-engine/src/orchestration/seed_rules.py
Populates the rule_versions table with statewide and field-specific rules.
Rules Seeded
| Identifier | Type | Domain | Description |
|---|---|---|---|
SWR_37 | statewide | spacing | Statewide Rule 37 — Spacing (467 ft well-to-well, 1,200 ft lease line, 40-acre default) |
SWR_32 | statewide | flaring | Statewide Rule 32 — Gas Flaring and Venting (180-day max, R-32 authorization) |
SWR_38 | statewide | density | Statewide Rule 38 — Well Density (40-acre oil, 640-acre gas) |
form_pr_deadline | statewide | reporting | Form PR Monthly Production Reporting (due 15th of each month) |
Spraberry_Trend_Area_spacing | field_specific | spacing | Spraberry field rules — 1,320 ft between wells (vs 1,200 statewide) |
Spraberry_Trend_Area_density | field_specific | density | Spraberry field rules — 40-acre proration, 50/50 allocation |
Each rule version includes structured rule_data as JSONB with the actual regulatory parameters (distances, thresholds, deadlines, etc.).
Demo Data Seed
Command: poetry run python -m orchestration.seed_demo_data (from services/orchestration-engine/)
File: services/orchestration-engine/src/orchestration/seed_demo_data.py
Seeds realistic compliance data for a 15-minute demo walkthrough.
What Gets Seeded
- 25 wells with Permian Basin API numbers and compliance status distribution: 60% green (compliant), 25% amber (action needed), 15% red (overdue).
- Compliance status records in the
compliance_statustable for 4 domains per well (Rule 37, Rule 32, Form PR, Flaring). - Pre-built Rule 37 checklist at ~40% completion for Mitchell Ranch 1H.
- Flare events with burn rate data for the flaring dashboard.
- Chart-ready historical data for compliance trends and deadline distributions.
Compliance Distribution
The demo data creates a realistic distribution of compliance statuses:
| Status | Target % | Description |
|---|---|---|
| Compliant | 60% | No action needed |
| Action Needed | 25% | Upcoming deadlines or warnings |
| Overdue | 15% | Missed deadlines or violations |
The demo data seed should be run after the knowledge graph seed and the checklist template seed, as it references entities and templates created by those scripts.