Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .seo/briefs/composite-primary-key-ai-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Composite Primary Keys for AI-Agent Datasets

## Selection

- Target: `composite primary key`
- Type: definition / implementation decision guide
- Live US metrics checked 2026-08-06: volume 590, KD 0, informational intent
- SERP shape: AI Overview/PAA plus definition and implementation tutorials; primary documentation
from PostgreSQL, Django, and Rails is prominent.
- Product-led fit: Rowset exposes one stable index column for MCP/REST by-index operations, so users
with multi-field source identity need a deterministic adapter rather than generic SQL advice.

## Information gain

The top results explain native database composite keys. This piece adds the SCOPE identity contract:
Scope, Components, Ownership, Percent-encode, and Evolution. It shows how to preserve a durable
identity tuple as one reversible Rowset index without claiming native multi-column key support.

## Table stakes and gap

Table stakes: definition, uniqueness/non-null behavior, examples, when composite identity fits,
tradeoffs with surrogate IDs, implementation example, and FAQ.

Gap: deterministic construction at an agent tool boundary, delimiter-collision prevention,
component authority, encoding-version migration, retry behavior, and Rowset relationship semantics.

## Entity map

Composite primary key, primary key, business key, surrogate key, unique constraint, non-null,
multi-column key, index column, deterministic encoding, percent-encoding, UTF-8, component order,
normalization, tenant/workspace scope, idempotency, relationship, foreign key, MCP, REST, `rowset_id`.

Questions: What is a composite primary key? Can a primary key contain multiple columns? When should
you use a composite key? Is it better than a surrogate key? How should an agent encode a composite
identity when an API accepts one index value?

## Verified claim ledger

| Claim | Source | Tier / date | Verification |
|---|---|---|---|
| PostgreSQL primary keys may span multiple columns; the group must be unique and non-null. | https://www.postgresql.org/docs/current/ddl-constraints.html | primary, checked 2026-08-06 | verified primary |
| Django supports `CompositePrimaryKey`, while current docs list migration and relationship limitations. | https://docs.djangoproject.com/en/6.0/topics/composite-primary-key/ | primary, checked 2026-08-06 | verified primary; release introduction cross-checked at https://www.djangoproject.com/weblog/2025/apr/02/django-52-released/ |
| Percent-encoding represents data characters that would otherwise conflict with URI syntax. | https://www.rfc-editor.org/rfc/rfc3986 | primary, January 2005 | verified primary |
| RFC 8785 defines invariant JSON serialization for repeatable cryptographic operations. | https://www.rfc-editor.org/rfc/rfc8785 | primary, June 2020 | verified primary |
| Rowset accepts one explicit `index_column`, generates `rowset_id` when omitted, and supports by-index operations. | `apps/pages/content/docs/dataset-api.md`; `TECH.md` | product source, checked 2026-08-06 | verified in docs and implementation |
| Rowset relationships store target dataset index values. | `apps/pages/content/docs/link-datasets.md`; `apps/pages/content/docs/dataset-api.md` | product source, checked 2026-08-06 | verified in two repo docs |
| The SCOPE contract and `ck1` encoding are this article's proposed framework, not a Rowset protocol guarantee. | article methodology | original analysis, 2026-08-06 | clearly framed as recommendation |

## Side checks

- AI SEO: direct definition first; self-contained answer blocks; current primary sources; explicit
entities; visible date through frontmatter; FAQ; renderer-supported `BlogPosting` schema.
- Product-led SEO: solves exact Rowset lookup, retry, and relationship work; links to the Dataset
API, schema design, identity migration, idempotency, relationships, quickstart, and pricing;
states that Rowset does not expose native multi-column SQL keys.
4 changes: 2 additions & 2 deletions .seo/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"content_ledger_dataset_key": "9ae7d0d3-1138-43a0-b3b8-aa05fac12a96",
"research_briefs_dataset_key": "3a004cfa-0a7e-4c3a-a517-caca902f38d6",
"schema_version": 1,
"last_sync_at": "2026-08-04"
"last_sync_at": "2026-08-06"
},
"created_at": "2026-07-04",
"updated_at": "2026-08-04",
"updated_at": "2026-08-06",
"notes": [
"Initialized from latest origin/main after fast-forwarding from c11f1de to 2d9389b.",
"Refreshed from current origin/main b93e5d6 with GSC, Plausible, PostHog, DataForSEO, Exa, Firecrawl, Jina, and live HTTP checks on 2026-07-15.",
Expand Down
4 changes: 3 additions & 1 deletion .seo/content-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
| 2026-08-02 | MCP OAuth vs API Keys: Choose the Right Auth | comparison / decision guide | `/blog/mcp-oauth-vs-api-keys` | MCP OAuth | 390 | 9 | MCP setup, agent access, MCP vs REST, safe sharing, pricing | #392 |
| 2026-08-03 | AI Agent Structured Output: Validate Before You Store | how-to / operational decision guide | `/blog/ai-agent-structured-output` | AI agent structured output | unmeasured | n/a | schema design, data entry, idempotent updates, MCP, Dataset API, pricing | #396 |
| 2026-08-04 | Migrate an AI-Agent Dataset to a Business Key | how-to / operational decision guide | `/blog/migrate-agent-dataset-business-key` | business key database | 10 | n/a | index-column guide, rowset_id vs business keys, schema design, row operations, idempotent updates, MCP, pricing | #397 |
| 2026-08-06 | Composite Primary Keys for AI-Agent Datasets | definition / implementation decision guide | `/blog/composite-primary-key-ai-agents` | composite primary key | 590 | 0 | index-column guide, business-key migration, Dataset API, schema design, idempotency, relationships, pricing, quickstart | #399 |

---

Expand Down Expand Up @@ -73,14 +74,15 @@
| 25 | MCP security best practices | security guide | MCP security best practices | 110 | 27 | commercial | 14 | Defer: KD is above the current authority band and the broad topic would overlap existing safe-sharing, approval, audit, and authentication content. |
| 26 | AI agent structured output | how-to / operational decision guide | AI agent structured output | unmeasured | n/a | implementation / informational | shipped (19) | Selected 2026-08-03 after live SERP research. Product-led angle: a shape -> meaning -> write contract that connects provider schema output to staged, retry-safe Rowset rows without treating valid JSON as proof of correctness. |
| 27 | Migrate an AI-agent dataset to a business key | how-to / operational decision guide | business key database | 10 | n/a | commercial / implementation | shipped (18) | Selected 2026-08-04 from the coverage map's highest-priority open product-native gap. Differentiated with a map -> mirror -> verify -> cut over -> retire identity migration contract. |
| 28 | Composite primary keys for AI-agent datasets | definition / implementation decision guide | composite primary key | 590 | 0 | informational / implementation | shipped (20) | Selected from the highest-priority open product-native coverage gap. Differentiated with a Scope -> Components -> Ownership -> Percent-encode -> Evolution identity contract for single-index agent tools. |

---

## Coverage Map

| Cluster / theme | Pieces shipped | Gaps still open |
|---|---|---|
| Agent-managed datasets | `/blog/agent-managed-datasets`, `/blog/choose-index-column-agent-rows`, `/blog/structure-dataset-instructions-ai-agents`, `/blog/rowset-id-vs-business-keys`, `/blog/relationship-modeling-agent-datasets`, `/blog/ai-agent-memory-vs-state`, `/blog/idempotent-ai-agent-updates`, `/blog/share-ai-agent-data-safely`, `/blog/human-in-the-loop-ai-agents`, `/blog/ai-agent-audit-trail`, `/blog/database-for-ai-agents`, `/blog/ai-data-cleaning-agent`, `/blog/ai-agent-crm`, `/blog/ai-agent-task-management`, `/blog/ai-agent-inventory-management`, `/blog/ai-customer-feedback-analysis`, `/blog/ai-ready-data`, `/blog/ai-agent-data-entry`, `/blog/ai-data-collection`, `/blog/migrate-agent-dataset-business-key` | Composite-key and cross-system identity patterns |
| Agent-managed datasets | `/blog/agent-managed-datasets`, `/blog/choose-index-column-agent-rows`, `/blog/structure-dataset-instructions-ai-agents`, `/blog/rowset-id-vs-business-keys`, `/blog/relationship-modeling-agent-datasets`, `/blog/ai-agent-memory-vs-state`, `/blog/idempotent-ai-agent-updates`, `/blog/share-ai-agent-data-safely`, `/blog/human-in-the-loop-ai-agents`, `/blog/ai-agent-audit-trail`, `/blog/database-for-ai-agents`, `/blog/ai-data-cleaning-agent`, `/blog/ai-agent-crm`, `/blog/ai-agent-task-management`, `/blog/ai-agent-inventory-management`, `/blog/ai-customer-feedback-analysis`, `/blog/ai-ready-data`, `/blog/ai-agent-data-entry`, `/blog/ai-data-collection`, `/blog/migrate-agent-dataset-business-key`, `/blog/composite-primary-key-ai-agents` | Cross-system identity patterns beyond composite keys |
| MCP and Dataset API | `/blog/mcp-vs-rest-ai-agents`, `/blog/connect-ai-agent-to-dataset-api`, `/blog/relationship-modeling-agent-datasets`, `/blog/ai-agent-inventory-management`, `/blog/ai-agent-data-entry`, `/blog/mcp-oauth-vs-api-keys`, `/blog/ai-agent-structured-output` | More REST/MCP setup examples with concrete datasets |
| Spreadsheet/database alternatives | `/blog/airtable-alternatives`, `/blog/google-sheets-alternatives`, `/blog/baserow-alternatives`, `/blog/nocodb-alternatives`, `/blog/spreadsheet-database-for-ai-agents`, `/vs/airtable`, `/vs/google-sheets` | Migration examples for specific human-to-agent workflows |

Expand Down
1 change: 1 addition & 0 deletions .seo/link-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
| `/blog/mcp-oauth-vs-api-keys` | https://rowset.lvtd.dev/blog/mcp-oauth-vs-api-keys | MCP OAuth vs API Keys: Choose the Right Auth | MCP OAuth vs API keys, MCP authorization decision guide, provisioned API key for agents, delegated MCP access, agent authentication delegation test |
| `/blog/ai-agent-structured-output` | https://rowset.lvtd.dev/blog/ai-agent-structured-output | AI Agent Structured Output: Validate Before You Store | AI agent structured output, structured output validation for agents, shape meaning write contract, JSON Schema to durable rows, validated agent output workflow |
| `/blog/migrate-agent-dataset-business-key` | https://rowset.lvtd.dev/blog/migrate-agent-dataset-business-key | Migrate an AI-Agent Dataset to a Business Key | business-key migration for agent datasets, migrate generated row identity, agent dataset index migration, map mirror verify cutover retire, move from rowset_id to a business key |
| `/blog/composite-primary-key-ai-agents` | https://rowset.lvtd.dev/blog/composite-primary-key-ai-agents | Composite Primary Keys for AI-Agent Datasets | composite identity, deterministic row index, multi-field business key, SCOPE identity contract |

## Shipped SEO Sprint Pages

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ deployment or release cut date.
**Fixed** for any bug fixes.
**Security** in case of vulnerabilities.

## 2026-08-06

### Added
- Added a composite-primary-key guide for agent-managed datasets with a deterministic SCOPE
identity contract, collision-safe component encoding, retry guidance, and Rowset examples.

## 2026-08-04

### Added
Expand Down
5 changes: 5 additions & 0 deletions apps/pages/content/blog/choose-index-column-agent-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ Use this checklist before creating an agent-managed dataset.
If a candidate fails any of those tests, it can still be a useful column. It
just should not be the index.

Sometimes no single field is unique, but a stable tuple is. The guide to
[composite primary keys for AI-agent datasets](/blog/composite-primary-key-ai-agents) shows how to
keep those component fields and derive one deterministic index for a single-index MCP or REST
surface.

## Good index columns by workflow

The right index depends on the job the dataset is doing.
Expand Down
Loading
Loading