All Docs
FeaturesAgentOS Scope OutUpdated March 11, 2026

Data Model

Data Model

ScopeOut's database is structured around a four-table pipeline that carries a discovered product from a raw directory URL through to a fully scored, AI-analysed dossier.

Pipeline Overview

Directory URL
     │
     ▼
discovered_products   ← root entity, one row per product URL
     │
     ├──▶ product_scrape_data   ← raw scraped content (1:1)
     │
     ├──▶ product_scores        ← computed opportunity scores (1:1)
     │
     └──▶ product_dossiers      ← AI-generated strategic output (1:1)

Each of the three child tables is in a 1:1 relationship with discovered_products and is cascade deleted when the parent row is removed.


discovered_products

The root entity table. A row is inserted here as soon as a product URL is found in a supplier directory crawl.

Key Columns

ColumnTypeNotes
idtext (PK)UUID
nametextProduct name
urltextUnique product URL
source_directorytextThe directory it was found in (e.g. kerfuffle.com)
categorytextProduct category tag
descriptiontextShort description from the directory listing
statusenumLifecycle state (see below)
created_at / updated_attimestampAuto-managed

Status Lifecycle

discovered
    │
    ▼
scraping ──▶ scraped
                │
                ▼
            scoring ──▶ scored
                            │
                            ▼
                   generating_dossier ──▶ complete
                            │
                            └──▶ error  (any stage)

Indexes

  • status
  • source_directory
  • category

product_scrape_data

Populated by the scraper once a product page has been fetched and parsed.

Key Columns

ColumnTypeNotes
product_idtext (FK)References discovered_products.id
ratingnumeric(3,2)Average star rating
review_countintegerTotal number of reviews
reviews_jsonJSONBArray of review objects (see below)
pricing_tierenumfree | freemium | paid | enterprise | unknown
features_jsonJSONBString array of listed features
raw_htmltextFull page HTML for reprocessing

reviews_json Shape

[
  {
    author: string;
    rating: number;
    text: string;
    date: string;
    sentiment: string; // e.g. "positive" | "negative" | "neutral"
  }
]

Indexes

  • product_id
  • pricing_tier

product_scores

Stores the four-dimension opportunity scores computed for each product, plus a composite rank used to drive the dashboard.

Key Columns

ColumnTypeRangeDescription
product_idtext (FK)References discovered_products.id
replicabilityinteger0–100How buildable the product is with the internal stack
market_demandinteger0–100Review volume and sentiment signal
revenue_potentialinteger0–100Pricing tier and addressable market estimate
competitive_gapinteger0–100Insight derived from negative review patterns
compositeinteger0–100Weighted overall opportunity score
scoring_notesJSONBRationale per dimension

scoring_notes Shape

{
  replicability?: string;
  market_demand?: string;
  revenue_potential?: string;
  competitive_gap?: string;
}

Indexes

  • composite — primary sort key for the ranked dashboard

product_dossiers

AI-generated strategic output, created for products that clear the scoring threshold.

Key Columns

ColumnTypeNotes
product_idtext (FK)References discovered_products.id
mission_statementtextAuto-drafted one-paragraph product mission
feature_listJSONBPrioritised feature array (see below)
weakness_analysistextCompetitor weakness narrative from negative review data
generated_attimestampWhen the dossier was generated

feature_list Shape

[
  {
    name: string;
    description: string;
    priority: "must-have" | "should-have" | "nice-to-have";
  }
]

TypeScript Types

All four tables expose Drizzle-inferred types for safe query authoring:

import {
  // discovered_products
  DiscoveredProduct,
  NewDiscoveredProduct,

  // product_scrape_data
  ProductScrapeData,
  NewProductScrapeData,

  // product_scores
  ProductScores,
  NewProductScores,

  // product_dossiers
  ProductDossier,
  NewProductDossier,

  // Hydrated join across all four tables
  FullProduct,
} from "@/db/schema";

FullProduct is a convenience union type for queries that join all four tables into a single hydrated result object.