Margarita - Programming language for Agents using Markdown-ish syntax logo

Margarita - Programming language for Agents using Markdown-ish syntax

Free
FreeFree tier
Type
Open Source

About Margarita - Programming language for Agents using Markdown-ish syntax

Margarita is a programming language for building deterministic AI agents using a Markdown-like syntax. It extends Markdown with variables, state management, and an effect system to create predictable workflows that integrate LLMs. Margarita gives developers complete control over context, allows composing prompts from reusable .mg files, and supports running Python functions locally to reduce token usage. It is open-source and designed for repeatable scripts that leverage LLM capabilities where needed.

Key Features

Deterministic scripting extension to Markdown
Variable substitution and state management with @state
Effect system including @effect run, @effect func, @effect context clear
Compose prompts from reusable .mg files with conditional logic and parameter passing
Run Python functions locally to reduce LLM token usage
Complete control over context window and token costs

Pros & Cons

Pros
  • Deterministic execution avoids LLM skipping steps or inventing properties
  • Full transparency and control over context, keeping costs low
  • Reusable prompt components inspired by React/JSX
  • Open-source and free to use
  • Integrates local Python functions to save tokens
Cons
  • Not suitable for fully dynamic, open-ended conversational agents
  • Learning curve for the custom Markdown extension syntax

Best For

Building custom agent loops with defined stepsSummarizing emails with categorized output and action itemsCreating repeatable scripts that combine deterministic logic with LLM capabilitiesRapidly prototyping tool-augmented workflows

FAQ

What is Margarita?
Margarita is a programming language for building deterministic AI agents using Markdown-like syntax. It introduces a scripting extension to Markdown that keeps agents predictable.
How does Margarita keep agents predictable?
Margarita uses a deterministic, script-like approach where workflows are defined in Markdown with variables, state, and effects, ensuring the LLM follows the defined steps consistently.
Can I compose prompts from multiple files?
Yes, Margarita supports composing prompts from reusable .mg files, allowing conditional logic, parameter passing, and looping similar to React components.
Is Margarita free?
Yes, Margarita is open-source and free to use.