Custom packs

Phase 2 — Cloven Mind ships canonical packs (crypto live; ai, markets Phase 1.5). Custom packs land in Phase 2 alongside the Cloven Agent product. This page describes the planned interface so you can build for it now.

A custom pack lets you define your own vertical without writing TypeScript. You declare sources, a compact prompt, a brief prompt, and a JSON-schema-shaped state. Cloven ingests, compacts, briefs, and exposes the pack via the same MCP / REST / SDK surface as the canonical packs — but scoped to your account only.

When to build a custom pack

  • Your agent reads a private signal source (internal Kafka topic, partner webhook, paid market-data feed) that no canonical pack covers.
  • You need a vertical Cloven hasn't shipped — supply chain intel, security CVEs, satellite imagery summaries, niche industry-news aggregation.
  • You want pack-shaped citations and freshness contracts on top of a source you already operate, without writing the orchestration yourself.

If your need is already covered by crypto / ai / markets, use the canonical pack — it's cheaper and Cloven maintains the source connectors.

Pack definition (YAML)

Stored in pack_subscriptions.custom_config as YAML. Edit via /console/packs/custom/<id> (Phase 2 UI):

id: my_supply_chain
name: My Supply Chain Intel
version: 1.0.0
description: |
  Continuous monitoring of our partner shipping feeds and weather alerts
  along high-priority lanes.
 
sources:
  - id: shipping_feed
    type: webhook                          # webhook | rss | scrape | http
    url: https://my.api.com/feed
    cadence_seconds: 600
 
  - id: weather
    type: http
    url: https://api.openweathermap.org/data/2.5/onecall
    api_key_env: OPENWEATHER_KEY
    cadence_seconds: 1800
    query:
      lat: 36.16
      lon: -86.78
 
  - id: port_status
    type: rss
    url: https://www.portstrategy.com/news/rss
    cadence_seconds: 3600
 
compact_prompt: |
  Given the shipping feed, weather data, and port-status news, produce a
  structured state matching the schema below. Flag any shipment whose ETA
  intersects a severe weather window. Never invent data — if a source is
  stale, set source_status[id] = 'stale' and omit dependent fields.
 
brief_prompt: |
  Write a 6-paragraph brief: (1) TL;DR, (2) shipments at risk with ETAs,
  (3) weather alerts on active lanes, (4) port disruptions, (5) anomalies
  versus last 24h, (6) explicit unknowns. Cite [N] for each numeric claim.
 
state_schema:
  type: object
  properties:
    shipments_at_risk:
      type: array
      items:
        type: object
        properties:
          tracking_id: { type: string }
          eta: { type: string, format: date-time }
          risk_reason: { type: string }
          source_ref: { type: integer }
    weather_alerts:
      type: array
      items:
        type: object
        properties:
          location: { type: string }
          severity: { enum: [low, medium, high, severe] }
          window: { type: string }
          source_ref: { type: integer }
    port_disruptions:
      type: array
    source_status:
      type: object
      additionalProperties: { enum: [ok, stale, error] }

Source types

TypeBehavior
webhookCloven exposes a one-time-signed URL; you POST data to it whenever you have a signal. Cadence-less.
httpCloven polls a URL on cadence_seconds. Optional query, headers, api_key_env.
rssCloven polls an RSS/Atom feed on cadence_seconds. Each item becomes a RawSignal.
scrapeCloven scrapes a public URL with a CSS-selector-shaped extractor. Cadence-based. Slow lane.

Every source must declare an id (used in source_ref), a publicUrl (used in citations), and either cadence_seconds or be webhook-driven.

Compact + brief prompts

You write the prompts. The compactor LLM (Groq llama-3.1-8b) receives the raw signals + your compact prompt + the JSON-schema → emits a JSON state. The briefer LLM (Groq llama-3.3-70b) receives the state + your brief prompt → emits the narrated brief.

Both prompts are wrapped in Cloven's anti-fabrication system message: "Never invent data. If a source is missing, flag source_status[id] = 'error' and omit dependent fields. Every numeric claim cites [N]."

You can override the wrapping for Pro+ tiers via the custom_brief_prompt column — useful if you have a strong house style (legal-formal, internal jargon, specific markdown structure).

State schema

Schema is JSON Schema (draft-2020-12). Cloven converts it to Zod at registration time and runs it as a strict validator on every compactor output. Output that fails validation → retry once with the validator error inlined into the prompt → on second failure, serve the previous state with source_status: error flag.

source_ref integers in the state must match the order of sources[] declared above. Citation resolution (/v1/cite?ref=N) reads from that same list.

Cost model

Custom packs are priced at:

per-call cost = base op price + source-cost-passthrough

Source cost passthrough = the metered cost of upstream HTTP requests on your account's behalf. Cloven does not mark up source costs; you pay our actual upstream bill, prorated to your call.

Custom packs are Team+ tier only (Phase 2). Each Team account can deploy up to 3 custom packs; Enterprise is unlimited.

Surface coverage

A registered custom pack appears in:

  • cloven.fresh, cloven.brief, cloven.search, cloven.snapshot, cloven.subscribe, cloven.cite — all standard tools work against pack: "my_supply_chain".
  • The MCP resources/list surfaces cloven://pack/my_supply_chain/schema and /sources to clients with the pack subscribed.
  • The console's pack dashboard shows source health, pulse cadence, recent pulses, and a "Try it" widget.

The pack does not appear in other accounts' registries. Custom packs are private to the account that registered them.

Trace + Phase 3 implications

Custom-pack traces are captured into the standard traces table. Operators can opt the custom-pack traces in or out of Phase 3 Commons (default: out — custom packs are usually internal data and shouldn't leak). Opting in earns the operator the standard 20% revshare on Phase 3 trace sales.

Roadmap

Custom packs ship in Phase 2 alongside the Cloven Agent product. The YAML interface above is the current draft — expect minor field renames before launch. Subscribe to the Cloven changelog for the exact shipping form.