Build a Lattice
What You’ll Build
A validated .lattice.yaml file that defines a workflow as a directed graph of nodes and edges. By the end, you’ll have a composable, FAIR-annotated lattice ready for execution or federation.
Prerequisites
- Lattice Composition — types, nodes, edges, composition patterns
- Ontology — the entity types that serve as lattice building blocks
- FAIR Metadata — the metadata envelope every lattice needs
Steps
Step 1: Define the Workflow
Sketch your workflow as nodes and data flow. Example — a data analysis pipeline:
Collect Data → Clean Data → Analyze → Visualize → Report
Each box becomes a node. Each arrow becomes an edge.
Step 2: Choose the Lattice Type
| If your workflow… | Choose | Execution Mode |
|---|---|---|
| Processes data through stages | pipeline | sequential |
| Makes decisions and loops | agent | hybrid |
| Retrieves and reasons over knowledge | context_graph | varies |
| Orchestrates multiple sub-processes | workflow | hybrid |
Our data analysis pipeline is a pipeline with sequential execution.
Step 3: Write the YAML
Create my_analysis.lattice.yaml:
lattice:
name: data_analysis
version: "1.0.0"
lattice_type: pipeline
description: "End-to-end data analysis from collection to report"
execution:
mode: sequential
runtime: local
tier: L1
nodes:
- id: collect_data
type: process
description: "Gather raw data from sources"
- id: clean_data
type: module
ref: "what/modules/module_data_cleaner"
description: "Remove duplicates, handle missing values"
- id: analyze
type: module
ref: "what/modules/module_statistical_analysis"
description: "Run statistical analysis on clean data"
- id: visualize
type: module
ref: "what/modules/module_chart_generator"
description: "Generate charts and figures"
- id: report
type: process
description: "Compile findings into a report"
edges:
- from: collect_data
to: clean_data
label: "raw data"
- from: clean_data
to: analyze
label: "clean dataset"
data_mapping:
clean_output: analysis_input
- from: analyze
to: visualize
label: "statistical results"
- from: visualize
to: report
label: "charts and figures"
fair:
license: "MIT"
keywords: [data-analysis, pipeline, statistics]
creators: ["Your Name"]
provenance: "Built for quarterly data reporting"
Key decisions:
- Node IDs are
snake_caseand descriptive (notnode_1,step_a) modulenodes haverefpointing to implementations;processnodes are human/agent steps- Edges use
data_mappingfor explicit field mapping - The
fairblock has at leastkeywordsandlicense
Step 4: Validate
Run the schema validator:
python what/lattices/tools/lattice_validate.py my_analysis.lattice.yaml
Fix any errors: missing required fields, invalid node references, disconnected nodes.
Step 5: Add Federation Metadata (Optional)
If you want to share this lattice with other projects:
federation:
shareable: true
source_instance: my_project
version_policy: minor
This enables the lattice to be imported and composed into other vaults. See the federation readiness checklist.
Step 6: Validate Again
Re-run validation after adding federation properties — the validator checks federation consistency too.
What You Learned
- Lattices are declarative graphs: nodes + edges + metadata (§5.1)
- Four types cover all workflow patterns
- FAIR metadata is required —
keywordsandlicenseminimum - Explicit
data_mappingon edges prevents implicit assumptions
Next Steps
- Run a Campaign — orchestrate multi-mission work
- Federate a Vault — share lattices across instances
- Federation Readiness — prepare for cross-instance sharing