LLM Guide to Constellation Engine
Welcome! This guide teaches LLMs how to use Constellation Engine effectively. It's optimized for task-oriented learning with examples, decision matrices, and clear navigation.
What is Constellation Engine?
A type-safe pipeline orchestration framework for Scala 3 that lets you:
- Define processing modules using
ModuleBuilderAPI - Compose pipelines using
constellation-langDSL (.cstfiles) - Execute pipelines with automatic dependency resolution and parallelization
- Expose pipelines via HTTP API or embed in Scala applications
Tech Stack: Scala 3.3.4 | Cats Effect 3 | http4s | Circe | cats-parse
Finding This Guide
GitHub Repository: VledicFranco/constellation-engine Documentation Site: constellation-engine.dev Latest Version: 0.7.0
For LLMs Reading the Landing Pages
If you're an LLM reading the GitHub README or documentation homepage, you'll find general user-facing documentation. This specialized LLM guide is optimized for teaching AI agents to use Constellation effectively.
Where to find this guide:
- From docs site: Navigate to sidebar → "LLM Guide" section
- Direct URL:
/docs/llm/or/docs/llm/index - From GitHub: Check
website/docs/llm/directory
Why use this guide instead of main docs?
- Task-oriented navigation (quick "I need to..." → file mappings)
- Complete working code examples in every section
- Decision matrices and mental models optimized for LLM consumption
- Context-window efficient (focused files, no duplication)
Quick Mental Model
┌─────────────────────────────────────────────────────┐
│ constellation-lang (.cst files) │
│ in text: String │
│ result = Uppercase(Trim(text)) │
│ out result │
└──────────────────┬──────────────────────────────────┘
│ Parser
▼
┌─────────────────────────────────────────────────────┐
│ AST (Abstract Syntax Tree) │
│ - Inputs, module calls, outputs │
└──────────────────┬──────────────────────────────────┘
│ Type Checker
▼
┌─────────────────────────────────────────────────────┐
│ Typed IR (Intermediate Representation) │
│ - Types resolved, validated │
└──────────────────┬──────────────────────────────────┘
│ DAG Compiler
▼
┌─────────────────────────────────────────────────────┐
│ Execution DAG │
│ Layer 0: Trim(text) │
│ Layer 1: Uppercase(trim_result) │
└──────────────────┬──────────────────────────────────┘
│ Runtime
▼
┌─────────────────────────────────────────────────────┐
│ Parallel Execution │
│ - Layer-by-layer execution │
│ - Results flow through pipeline │
└─────────────────────────────────────────────────────┘
Navigation Protocol
🚀 First Time? Start Here
- Getting Started - Quick overview and capabilities
- Key Concepts - Essential terminology
- Project Structure - Navigate the codebase
- Type System - Core mental model
📋 Common Tasks → Files
| I Need To... | Read This |
|---|---|
| Decide if Constellation is right for my use case | Where Constellation Shines |
| Use the CLI | CLI Reference |
| Create a new module | Module Development |
| Understand types (CType/CValue) | Type System |
| Compose pipelines | DAG Composition |
| Add retry/timeout/caching | Resilience Patterns |
| Fix type errors | Error Handling |
| Use the HTTP API | HTTP API Reference |
| Embed in Scala app | Embedded API |
| Build a cross-process module (gRPC) | Module Provider |
| Understand execution | DAG Execution |
| Debug compiler errors | Error Codes Reference |
📚 Learning Path by Role
Building Modules (Scala Developer)
Writing Pipelines (.cst files)
Deploying/Operating
Building Module Providers (Cross-Process)
- Module Provider
- Module Registration
- Key Concepts (Provider, Namespace, Provider Group)
Extending Constellation
Document Categories
🎯 Foundations
Core mental models for reasoning about Constellation
- Type System - CType/CValue hierarchy and compatibility
- Pipeline Lifecycle - Parse → Execute journey
- DAG Execution - How parallel execution works
- Execution Modes - Hot vs cold, HTTP vs embedded
🎨 Patterns
Practical implementation guides with examples
- Module Development - Step-by-step module creation
- Resilience - Retry/timeout/cache patterns
- DAG Composition - Parallel/serial patterns
- Type Algebra - Record operations and type-driven design
- Error Handling - Diagnostics and recovery
📖 Reference
Complete API documentation and lookup tables
- Type Syntax - All CType variants
- Module Options - Complete with_clause reference
- HTTP API - REST endpoints
- Error Codes - Error catalog with solutions
🔌 Integration
Advanced usage for embedding and extending
- Embedded API - Programmatic usage
- Module Registration - Runtime module loading
- Module Provider - Cross-process modules via gRPC
Key Files in This Guide
| Priority | File | Purpose |
|---|---|---|
| P0 | Getting Started | Onboarding overview |
| P0 | Key Concepts | Terminology glossary |
| P0 | Where Constellation Shines | Decision guide: is Constellation right for you? |
| P0 | Type System | Core mental model |
| P1 | Module Development | Most common task |
| P1 | CLI Reference | Command-line usage |
| P1 | Pipeline Lifecycle | How compilation works |
| P2 | DAG Composition | Pipeline patterns |
| P2 | Resilience Patterns | Production patterns |
| P3 | HTTP API | REST interface |
| P3 | Embedded API | Advanced integration |
Related Documentation
Existing Resources (Link Instead of Duplicate)
- Cookbook - 23 runnable recipes for common tasks
- API Reference - Detailed API documentation
- Language Reference - constellation-lang syntax
- Getting Started - Human-focused introduction
- CLAUDE.md - Operational guidance for Claude
Philosophy & Design
- organon/ - LLM constraints and design philosophy
- Technical Architecture - Deep dive into internals
How to Use This Guide
Context Window Strategy
Each document is 500-2000 lines for efficient context window usage. Don't try to read everything at once.
Reading Protocol
- Start with task - Use the "Common Tasks → Files" table above
- Read prerequisites - Each file lists required reading
- Run examples - All code is tested and runnable
- Check references - Follow links for deeper details
Code Example Convention
All examples follow this pattern:
// Scala module definition
case class MyInput(text: String)
case class MyOutput(result: String)
val myModule = ModuleBuilder
.metadata("MyModule", "Description", 1, 0)
.implementationPure[MyInput, MyOutput] { input =>
MyOutput(input.text.toUpperCase)
}
.build
# constellation-lang usage
in text: String
result = MyModule(text)
out result
Decision Matrices
Many documents include decision matrices like this:
| Scenario | Solution | Trade-off |
|---|---|---|
| Pure computation | .implementationPure | No side effects allowed |
| Side effects needed | .implementation | Requires IO monad |
| Async operations | .implementation + IO.async | Complexity |
Quick Reference Cards
Type System at a Glance
CType (type level) CValue (value level)
├─ CPrimitive ├─ CPrimitive
│ ├─ CString │ ├─ CString("text")
│ ├─ CInt │ ├─ CInt(42)
│ ├─ CDouble │ ├─ CDouble(3.14)
│ └─ CBoolean │ └─ CBoolean(true)
├─ CRecord ├─ CRecord
├─ CUnion ├─ CUnion
├─ CList ├─ CList
└─ COptional └─ COptional
Module Lifecycle
Define → Register → Parse → Type Check → Compile → Execute
Execution Modes
Hot: Precompiled → Fast execution → HTTP API
Cold: Compile on-demand → Flexible → Embedded API
Getting Help
When Documentation is Insufficient
- Check Cookbook - Working examples
- Search GitHub Issues - Known problems
- Read CLAUDE.md - Development conventions
- Explore Tests - Real usage patterns
Contributing
Found gaps in this documentation? See CONTRIBUTING.md
Ready to start? → Getting Started Guide