Agent protocols · Open-source language

SUTRA

A small deterministic language for agent-to-agent intent, negotiation, and commitments with auditable state transitions.

Problem

Natural language is expressive but ambiguous, while raw JSON carries structure without domain semantics. Agent coordination needs a compact layer between the two.

System

A Python lexer, parser, AST, evaluator, and transaction state model implement eight semantic primitives, with local and HTTP-based agent communication paths.

Proof

  • Defines a compact grammar and eight documented primitives.
  • Includes parser, evaluator, runtime state, and network transport code.
  • Provides local and networked buyer/seller demonstrations.

Architecture

  1. ExpressAn agent writes intent using a small semantic vocabulary.
  2. ParseThe lexer and parser produce a structured syntax tree.
  3. EvaluateRules apply deterministically against current agent state.
  4. CommitAccepted transitions update auditable transactional state.

Decisions

  • Keep the language declarative and intentionally non-general-purpose.
  • Make identical input and state produce identical output.
  • Isolate mutations within message-level transactions.

Tradeoffs and limitations

  • A formal language reduces ambiguity but requires agents and developers to learn its vocabulary.
  • The constrained grammar cannot represent every conversational workflow.

Technologies

  • Python
  • Lexer and parser
  • AST evaluation
  • HTTP transport