STL Documentation
Welcome to the documentation for Semantic Tension Language (STL) and its Python toolkit stl-parser.
STL is a calculable, universal standard for structuring knowledge through directional semantic relations. It introduces a tension-path model where knowledge flows directionally from source to target, carrying semantic magnitude and type information.
[Theory_Relativity] -> [Prediction_TimeDilation] ::mod(
rule="logical",
confidence=0.99,
source="doi:10.1002/andp.19053221004",
author="Einstein"
)
Unlike JSON or plain text, STL statements are traceable, verifiable, and inference-ready.
Where to Start
New to STL?
- Installation — Install
stl-parserin under a minute - Quickstart — Parse, build, and validate your first STL statements
- Key Concepts — Understand anchors, paths, modifiers, and the tension-path model
Learning STL
Step-by-step tutorials covering every capability:
| # | Tutorial | What You’ll Learn |
|---|---|---|
| 01 | Parsing | Parse STL text and files, inspect results |
| 02 | Building | Build statements programmatically |
| 03 | Schema Validation | Validate documents against domain schemas |
| 04 | LLM Pipeline | Clean and repair LLM-generated output |
| 05 | Querying | Query, filter, and select statements |
| 06 | Streaming I/O | Read and write STL streams |
| 07 | Diff & Patch | Compare and patch documents |
| 08 | CLI Tools | Command-line workflows |
Looking Something Up?
- API Reference — Complete function and class documentation
- CLI Reference — All 10 CLI commands with examples
- Modifier Reference — All 30+ modifier fields
- Error Codes — E001-E969, W001-W099 with fixes
- STL Syntax Card — One-page syntax quick reference
Solving a Specific Problem?
- Custom Schemas — Create domain-specific validation schemas
- LLM Integration — Use STL with ChatGPT, Claude, and other LLMs
- Knowledge Graph Pipeline — Build end-to-end knowledge graphs
- Event Logging — Use STL for structured event logging
- Confidence Decay — Manage knowledge freshness over time
Specifications
- STL Core Specification v1.0 — The formal language specification
- STL Core Specification Supplement — Extended features and semantics
Project
- Project Index — Module reference and architecture overview
- Schema Ecosystem — 6 domain-specific schemas + template
- GitHub Repository