# agencyenterprise/jev-recipes architecture

> Architecture diagram of the GitHub repository agencyenterprise/jev-recipes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agencyenterprise/jev-recipes
- Repository: https://github.com/agencyenterprise/jev-recipes

## Overview

jev-recipes is a TypeScript library of typed AI decision recipes, with a CLI, framework adapters, searchable recipe catalog, and evaluation tools. The main workflow is an application or agent supplying structured input to a recipe; the recipe builds a decision request, calls Jev through TypeSafe (or an injected client), validates the response, and returns a structured result. The graph emphasizes that runtime path and documented evaluation/catalog capabilities. Some connections are based on README documentation or SOURCE INDEX references rather than complete source excerpts.

Main entry points: [`recipes`](https://github.com/agencyenterprise/jev-recipes/tree/main/recipes) (Decision recipes), [`evaluation/engine.ts`](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/engine.ts) (Evaluation engine), [`src/client.ts`](https://github.com/agencyenterprise/jev-recipes/blob/main/src/client.ts) (Jev client), [`cli/index.ts`](https://github.com/agencyenterprise/jev-recipes/blob/main/cli/index.ts) (Recipe CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Decision runtime"]
  node_choice["Choice decisions<br/>[decisions.ts]"]
  node_labels["Label decisions<br/>[labels.ts]"]
  node_fanout["Multi-check decisions<br/>[fanout.ts]"]
  node_client["Jev client<br/>[client.ts]"]
  node_schemas["Shared schemas<br/>[schema.ts]"]
end

subgraph group_recipes["Recipe library"]
  node_recipe["Decision recipes"]
end

subgraph group_interfaces["User interfaces"]
  node_aiadapter["Vercel AI adapter<br/>[index.ts]"]
  node_langadapter["LangChain adapter<br/>[index.ts]"]
  node_cli["Recipe CLI<br/>[index.ts]"]
end

subgraph group_catalog["Recipe catalog"]
  node_catalog["Catalog search<br/>[search.ts]"]
  node_catalogapi["Catalog API<br/>[index.ts]"]
  node_loader["Recipe loader<br/>[runner.ts]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluation["Evaluation engine<br/>[engine.ts]"]
  node_comparison["Result comparison<br/>[comparison.ts]"]
  node_decisions["Evaluation metrics<br/>[decisions.ts]"]
  node_evalschema["Evaluation schemas<br/>[schema.ts]"]
  node_evalcli["Evaluation CLI<br/>[evaluation.ts]"]
  node_archives["Evaluation archives<br/>[archive.ts]"]
  node_reports["Evaluation reports<br/>[report.ts]"]
end

node_app(("Calling application"))
node_typesafe{{"TypeSafe API"}}

node_app -->|"calls"| node_recipe
node_recipe -->|"evaluates choices"| node_choice
node_recipe -->|"evaluates labels"| node_labels
node_recipe -->|"runs checks"| node_fanout
node_choice -->|"requests decision"| node_client
node_labels -->|"requests labels"| node_client
node_fanout -->|"requests decisions"| node_client
node_client -->|"calls API"| node_typesafe
node_recipe -->|"validates results"| node_schemas
node_aiadapter -->|"exposes tools"| node_recipe
node_langadapter -->|"adapts recipes"| node_recipe
node_cli -->|"lists and describes"| node_catalogapi
node_cli -->|"loads and runs"| node_loader
node_loader -->|"loads recipe"| node_recipe
node_catalogapi -->|"searches recipes"| node_catalog
node_app -->|"evaluates cases"| node_evaluation
node_evaluation -->|"runs recipe"| node_recipe
node_evaluation -->|"checks expected results"| node_comparison
node_evaluation -->|"measures confidence"| node_decisions
node_evaluation -->|"uses case schemas"| node_evalschema
node_evalcli -->|"runs evaluation"| node_evaluation
node_evaluation -.->|"retains responses"| node_archives
node_evaluation -.->|"produces reports"| node_reports

click node_recipe "https://github.com/agencyenterprise/jev-recipes/tree/main/recipes"
click node_choice "https://github.com/agencyenterprise/jev-recipes/blob/main/src/decisions.ts"
click node_labels "https://github.com/agencyenterprise/jev-recipes/blob/main/src/labels.ts"
click node_fanout "https://github.com/agencyenterprise/jev-recipes/blob/main/src/fanout.ts"
click node_client "https://github.com/agencyenterprise/jev-recipes/blob/main/src/client.ts"
click node_schemas "https://github.com/agencyenterprise/jev-recipes/blob/main/src/schema.ts"
click node_aiadapter "https://github.com/agencyenterprise/jev-recipes/blob/main/adapters/ai-sdk/index.ts"
click node_langadapter "https://github.com/agencyenterprise/jev-recipes/blob/main/adapters/langchain/index.ts"
click node_cli "https://github.com/agencyenterprise/jev-recipes/blob/main/cli/index.ts"
click node_catalog "https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/search.ts"
click node_catalogapi "https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/index.ts"
click node_loader "https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/runner.ts"
click node_evaluation "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/engine.ts"
click node_comparison "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/comparison.ts"
click node_decisions "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/decisions.ts"
click node_evalschema "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/schema.ts"
click node_evalcli "https://github.com/agencyenterprise/jev-recipes/blob/main/cli/evaluation.ts"
click node_archives "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/archive.ts"
click node_reports "https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/report.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_choice,node_labels,node_fanout,node_client,node_schemas toneBlue
class node_recipe toneAmber
class node_aiadapter,node_langadapter,node_cli,node_typesafe toneMint
class node_catalog,node_catalogapi,node_loader toneRose
class node_evaluation,node_comparison,node_decisions,node_evalschema,node_evalcli,node_archives,node_reports,node_app toneIndigo
```

## Components

### Decision runtime

- [Choice decisions](https://github.com/agencyenterprise/jev-recipes/blob/main/src/decisions.ts): `src/decisions.ts`
- [Label decisions](https://github.com/agencyenterprise/jev-recipes/blob/main/src/labels.ts): `src/labels.ts`
- [Multi-check decisions](https://github.com/agencyenterprise/jev-recipes/blob/main/src/fanout.ts): `src/fanout.ts`
- [Jev client](https://github.com/agencyenterprise/jev-recipes/blob/main/src/client.ts): `src/client.ts`
- [Shared schemas](https://github.com/agencyenterprise/jev-recipes/blob/main/src/schema.ts): `src/schema.ts`

### Recipe library

- [Decision recipes](https://github.com/agencyenterprise/jev-recipes/tree/main/recipes): `recipes`

### User interfaces

- [Vercel AI adapter](https://github.com/agencyenterprise/jev-recipes/blob/main/adapters/ai-sdk/index.ts): `adapters/ai-sdk/index.ts`
- [LangChain adapter](https://github.com/agencyenterprise/jev-recipes/blob/main/adapters/langchain/index.ts): `adapters/langchain/index.ts`
- [Recipe CLI](https://github.com/agencyenterprise/jev-recipes/blob/main/cli/index.ts): `cli/index.ts`

### Recipe catalog

- [Catalog search](https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/search.ts): `catalog/search.ts`
- [Catalog API](https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/index.ts): `catalog/index.ts`
- [Recipe loader](https://github.com/agencyenterprise/jev-recipes/blob/main/catalog/runner.ts): `catalog/runner.ts`

### Evaluation

- [Evaluation engine](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/engine.ts): `evaluation/engine.ts`
- [Result comparison](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/comparison.ts): `evaluation/comparison.ts`
- [Evaluation metrics](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/decisions.ts): `evaluation/decisions.ts`
- [Evaluation schemas](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/schema.ts): `evaluation/schema.ts`
- [Evaluation CLI](https://github.com/agencyenterprise/jev-recipes/blob/main/cli/evaluation.ts): `cli/evaluation.ts`
- [Evaluation archives](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/archive.ts): `evaluation/archive.ts`
- [Evaluation reports](https://github.com/agencyenterprise/jev-recipes/blob/main/evaluation/report.ts): `evaluation/report.ts`

### Other components

- **Calling application**
- **TypeSafe API**

## Connections

- Calling application → Decision recipes: calls (evidence: `README.md`)
- Decision recipes → Choice decisions: evaluates choices (evidence: `recipes/appeal-grounds-kind/index.ts`)
- Decision recipes → Label decisions: evaluates labels (evidence: `recipes/defect-report-facets/index.ts`)
- Decision recipes → Multi-check decisions: runs checks (evidence: `recipes/tool-call-gate/index.ts`)
- Choice decisions → Jev client: requests decision (evidence: `src/decisions.ts`)
- Label decisions → Jev client: requests labels (evidence: `src/labels.ts`)
- Multi-check decisions → Jev client: requests decisions (evidence: `src/fanout.ts`)
- Jev client → TypeSafe API: calls API (evidence: `src/client.ts`)
- Decision recipes → Shared schemas: validates results (evidence: `recipes/tool-call-gate/index.ts`)
- Vercel AI adapter → Decision recipes: exposes tools (evidence: `adapters/ai-sdk/index.ts`)
- LangChain adapter → Decision recipes: adapts recipes (evidence: `adapters/langchain/index.ts`)
- Recipe CLI → Catalog API: lists and describes (evidence: `cli/index.ts`)
- Recipe CLI → Recipe loader: loads and runs (evidence: `cli/index.ts`)
- Recipe loader → Decision recipes: loads recipe (evidence: `catalog/runner.ts`)
- Catalog API → Catalog search: searches recipes (evidence: `catalog/index.ts`)
- Calling application → Evaluation engine: evaluates cases (evidence: `README.md`)
- Evaluation engine → Decision recipes: runs recipe (evidence: `evaluation/engine.ts`)
- Evaluation engine → Result comparison: checks expected results (evidence: `evaluation/engine.ts`)
- Evaluation engine → Evaluation metrics: measures confidence (evidence: `evaluation/engine.ts`)
- Evaluation engine → Evaluation schemas: uses case schemas (evidence: `evaluation/engine.ts`)
- Evaluation CLI → Evaluation engine: runs evaluation (evidence: `cli/evaluation.ts`)
- Evaluation engine → Evaluation archives: retains responses (evidence: `README.md`)
- Evaluation engine → Evaluation reports: produces reports (evidence: `README.md`)
