guile implementation of llm-md
- Scheme 98.5%
- Makefile 1.5%
LLM-MD Guile Implementation
A Guile Scheme implementation of LLM-MD (Large Language Model Markdown), a domain-specific language for defining, executing, and version-controlling conversations between AI agents.
Requirements
- GNU Guile 3.0+
- guile-json (for JSON parsing)
Installation
# Install dependencies on Debian/Ubuntu
sudo apt install guile-3.0 guile-json
# Or on Fedora
sudo dnf install guile30 guile-json
# Make the CLI executable
chmod +x bin/llm-md
Usage
# Run an LLM-MD file
./bin/llm-md run examples/simple.md
# Parse and display AST
./bin/llm-md parse examples/simple.md
# Interactive REPL
./bin/llm-md repl
Project Structure
llm-md-guile/
├── bin/
│ └── llm-md # CLI entry point
├── src/
│ ├── parser/
│ │ ├── lexer.scm # Lexical analysis
│ │ ├── parser.scm # Grammar parsing
│ │ └── ast.scm # AST definitions
│ ├── interpreter/
│ │ ├── eval.scm # Main evaluation
│ │ ├── env.scm # Environment/state
│ │ ├── commands.scm # Command processing
│ │ ├── agents.scm # Agent system
│ │ └── chains.scm # Agent chain evaluation
│ ├── llms/
│ │ ├── api.scm # Provider API
│ │ └── providers.scm # Built-in providers
│ └── tools/
│ └── builtins.scm # Built-in tools
├── tests/
├── examples/
└── agents/
Language Features
- Agent Chains: Sequential (
>>>), fan-out (>>=), fan-in (=>>), loops (!>>) - Variables: Scoped variables with
@namesyntax - Commands: Shell commands, tool invocations, control flow
- TOML Context: Configuration via
### context >>>blocks
License
Apache License 2.0 - See LICENSE for details.