Tag & Category
Tags are global labels. The category-color theming layer on the frontend keys off the tag slug.
Schema
tags
| Column | Type | Notes |
|---|---|---|
id | UUID | PK |
name | text | Display name (e.g. "Voice") |
slug | text, unique | URL-safe form (e.g. voice) |
createdAt | timestamptz |
agent_tags
| Column | Type |
|---|---|
agentId | UUID FK → agents |
tagId | UUID FK → tags |
Composite PK (agentId, tagId).
Endpoints
| Verb | Path | Guard |
|---|---|---|
| GET | /tags | public |
| POST | /tags | platform_admin |
| DELETE | /tags/:id | platform_admin |
Tag-agent associations are managed via POST /agents/:id with tagIds[].
Frontend behavior
- Filter chips —
BrowseAgents.tsxderives the set of available tags fromuseTags()and renders one chip per tag with a count. - Active filter —
?tag=<slug>in the URL. Selecting a chip updates the query string. - Search — combines with the SearchContext text filter.
- Color theme —
themeFor(tag.slug)fromsrc/data/categoryThemes.tsreturns the hex / Tailwind gradient. If the slug isn't in the map, default teal is used.
Adding a new category
If your new agent's primary tag isn't already in categoryThemes:
POST /tagsto create the tag.- Edit
fleapo-marketplace/src/data/categoryThemes.tsto add the slug with hex + gradient. - Attach the tag to your agent via
tagIds.
See Track C for the exact shape.
Tag vs primary category
There's no explicit "primary tag" column. The frontend treats agent.tags[0] as the visual category when rendering the card. Order your tagIds[] accordingly when creating the agent.