Modules
BEAM-native Programmatic Tool Calling (PTC) library.
Text chunking utilities for RLM preprocessing.
Manages context, memory, and tools for program execution.
Loads environment variables from .env files.
Interactive trace tree widget for Livebook.
Behaviour and convenience API for LLM adapters.
Default model registry with built-in aliases for common LLM providers.
Behaviour and unified interface for model resolution.
Built-in LLM adapter using req_llm.
Execute PTC programs written in Lisp DSL (Clojure subset).
AST node types for PTC-Lisp
Validates and desugars RawAST into CoreAST.
Conditional analysis for if, if-not, when, when-not, if-let,
when-let, if-some, when-some, when-first, cond, case, and condp forms.
Definition analysis for def, defonce, and defn forms.
Iteration analysis for doseq and for comprehensions.
Pattern analysis and destructuring for let bindings and function parameters.
Predicate analysis for where clauses and predicate combinators.
Analyzer for short function syntax (#()).
Validates PTC-Lisp programs against Babashka/Clojure.
Core, validated AST for PTC-Lisp.
Convert Core AST (the analyzed/desugared representation) back to PTC-Lisp source strings.
Static analysis to extract data keys accessed by a PTC-Lisp program.
Builds the initial environment with builtins for PTC-Lisp.
Evaluates CoreAST into values.
Function application dispatch for Lisp evaluation.
Evaluation context for the Lisp interpreter.
Shared helper functions for Lisp evaluation.
Pattern matching for let bindings in Lisp evaluation.
Where predicates and comparison helpers for Lisp evaluation.
Exception used to signal execution errors during Lisp evaluation.
Format PTC-Lisp values for human/LLM display.
Serialize PTC-Lisp AST to source code string.
Language specification compositions for PTC-Lisp.
NimbleParsec-based parser for PTC-Lisp.
Helper functions for parser reductions
Single source of truth for PTC-Lisp function metadata.
Built-in functions for PTC-Lisp.
Dispatch helper for calling Lisp functions from Collection operations.
Collection operations for PTC-Lisp runtime.
Predicate and collection normalization helpers for collection operations.
Selection operations for PTC-Lisp collections: filter, remove, find, some, every?, not_any?, take_while, drop_while.
Transformation operations for PTC-Lisp collections: map, mapv, mapcat, keep, map_indexed, pluck.
Flexible key access helpers for PTC-Lisp runtime.
Simulated Java interop for PTC-Lisp.
Map operations for PTC-Lisp runtime.
Arithmetic operations for PTC-Lisp runtime.
Type predicates, numeric predicates, and logic operations for PTC-Lisp runtime.
Minimal, safe Regex support for PTC-Lisp. Uses Erlang's :re directly with match limits for ReDoS protection.
Unified handling for IEEE 754 special values (Infinity, NaN) in PTC-Lisp.
String manipulation and parsing operations for PTC-Lisp runtime.
Validates PTC-Lisp specification against implementation.
Counts unique user-defined symbols and keywords in a parsed Lisp AST.
Raised by Lisp runtime functions when arguments have the wrong type.
Statistical comparison functions for benchmark results.
Extracts per-turn interaction quality metrics from SubAgent execution results.
Standalone Mustache template parser and expander.
Compile-time utilities for loading prompt templates from files.
Centralized prompt loading for PtcRunner.
Executes programs in isolated BEAM processes with resource limits.
Declarative schema module that defines all DSL operations.
Result of executing a PTC program or SubAgent mission.
Agentic loop for LLM-driven PTC-Lisp execution.
Pure functions for resolving builtin tool families into tool maps.
Chaining functions for SubAgent pipelines.
A compiled SubAgent with pre-derived PTC-Lisp logic.
Compilation logic for SubAgents.
Behaviour for message history compression strategies.
Default compression strategy that coalesces all context into a single USER message.
Debug helpers for visualizing SubAgent execution.
Struct and type definitions for SubAgent configuration.
Extracts JSON from LLM responses, handling common formatting quirks.
Normalizes map keys from hyphens to underscores at the tool boundary.
LLM resolution and invocation for SubAgents.
LLM-powered tools for classification, evaluation, and judgment.
Core agentic loop that manages LLM↔tool cycles.
Budget checking, callback handling, and fallback recovery for SubAgent execution.
Shared JSON response handling for text mode variants.
LLM retry logic with configurable backoff strategies.
Telemetry, tracing, and usage metrics for SubAgent execution.
Response parsing and validation for LLM responses.
Return type validation for SubAgent execution.
Typed state struct for the SubAgent execution loop.
Final step assembly for SubAgent execution.
Unified execution loop for text output mode.
Tool preparation and wrapping for SubAgent execution.
Turn feedback formatting for SubAgent execution.
Renders namespaces for the USER message (REPL with Prelude model).
Renders the data/ namespace section.
Renders tool call history and println output.
Renders available tools for the USER message namespace section.
Converts Elixir values to human-readable type labels.
Renders the user/ namespace section (LLM-defined functions and values).
Renders a markdown checklist from plan steps and summaries.
Template string expansion with placeholder validation.
Sigils for SubAgent templates.
Signature parsing and validation for SubAgents.
Coerce values to expected types with warning generation.
NimbleParsec-based parser for signature strings.
Helper functions for signature parser AST building.
Renders signatures back to string representation.
Resolve paths against parsed signature types.
Validates data against signature type specifications.
Wraps a SubAgent as a callable tool for parent agents.
System prompt generation for SubAgent LLM interactions.
Expected output section generation for SubAgent prompts.
Telemetry event emission for SubAgent execution.
Converts Tool structs to OpenAI-format JSON Schema tool definitions.
Extract signature and description from Elixir function @spec and @doc.
Validates SubAgent options at construction time.
Exception raised by SubAgent.run!/2 and SubAgent.then!/2 when execution fails.
Represents a template with extracted placeholders.
Normalized tool definition for PTC-Lisp and SubAgent.
Exception raised when a tool execution fails.
Centralizes process dictionary access for tracing context.
Captures SubAgent execution events to JSONL files for offline analysis.
Offline analysis of trace log files.
GenServer that collects trace events and writes them to a JSONL file.
Builds v2 flat event envelopes for trace logging.
Telemetry handler that captures SubAgent events for trace logging.
Immutable trace recorder for SubAgent execution.
Text-based timeline visualization for execution traces.
Captures a single LLM interaction cycle in a SubAgent execution.
Mix Tasks
Run the parallel workers (LLM-orchestrated map-reduce) example.
Generates markdown reports comparing PTC-Lisp builtins against Clojure and Java namespaces.
Generates documentation from priv/functions.exs
Installs Babashka for Clojure validation.
Starts an interactive REPL for testing PTC-Lisp expressions.
Runs .clj files through both PTC-Lisp and Babashka/Clojure, comparing results.
Regenerates the spec checksums file for drift detection.
Validates PTC-Lisp specification against implementation.