L4 Tutorials
Task-oriented guides to help you accomplish specific goals with L4. Each tutorial is self-contained and focused on a particular use case or audience.
Getting Started
New to L4? Start here:
- Your First L4 File - Create and run a simple L4 program
- Encoding Legislation - Turn legal text into L4
- Wedding Vows - Fun intro to regulative rules
- Common Patterns - Quick reference patterns
Natural Language Functions
Write functions that read like legal prose:
Audience: All L4 users
Prerequisites: Basic function syntax
Deployment and Legalese Cloud
Export your L4 rules as live REST API endpoints:
- Exporting Rules for Deployment - Mark rules with
@export, deploy from VS Code, and call them via REST or WebMCP - OpenAI- and Anthropic-Compatible AI APIs - Chat with a deployment's rules from any OpenAI or Anthropic client (
legalese-comply-4) - MCP Server - Expose deployed rules as Model Context Protocol tools
- WebMCP Embed Script - One embed tag so your website serves its own rules
- RESTful OpenAPI Specification - Generate clients and call rules as plain REST
Audience: L4 authors ready to share their rules Prerequisites: Basic L4 knowledge
LLM Integration
Working with AI and language models in L4:
- Composing L4 with AI - Draft L4 from prose using Legalese AI
- LLM Getting Started - Basics of LLM integration
- Legislative Ingestion - LLM-assisted encoding
Audience: Developers, AI/ML practitioners
Prerequisites: Basic L4 knowledge
Tutorial Ideas
See Tutorial Suggestions for a list of planned tutorials and ideas for new content. Contributions welcome!