Masar
Masar is a world model service for AI agents. It provides three capabilities that LLMs lack: structured planning, fast verification, and experience-based memory.
Why Masar?
LLMs are good at generating text and code. They are bad at knowing what to generate, in what order, and whether the result is correct. An LLM asked to build a complex schema will over-engineer, under-build, or generate things in the wrong order.
Masar solves this by acting as System 2 for your agent:
- Planning: "Here are 14 instructions across 7 dependency levels. Execute them in order."
- Verification: "This result has a 94% chance of being valid. Predicted errors: none."
- Memory: "You've handled 15 similar tasks before. The pattern that worked: check the KB first."
Three API Surfaces
Planning API
Given a partial result and a goal, produces dependency-ordered instructions:
plan = client.plan(current=partial, goal=target)
# Returns: 14 instructions across 7 levels
# Level 1: Add structure
# Level 2: Add states and events
# Level 3: Add transitions
# Level 4-7: Effects, UI, wiring, pages
Verification API
Predicts validity and error categories without running the full compiler:
check = client.verify(schema=result)
# Returns: { valid: true, probability: 0.94, errors: [] }
Memory API
Stores, recalls, compresses, and forgets agent experiences:
# Store
client.memory.store(episode=completed, domain="helpdesk")
# Recall
similar = client.memory.recall(context="database timeout", domain="helpdesk")
# Returns: matched pattern, 5 similar past episodes, common resolution
Next Steps
- Quickstart - Install and make your first API call
- API Reference - Full endpoint documentation
- Agent Integration Guide - Wire Masar into your LLM agent