How puneet-swarup/mantrana works
Mantrana is a Python framework for iterative, moderator-routed AI deliberation. A user supplies a problem to the runnable entry point; the council loop loads configuration, seeds a shared log, asks the moderator to select roles, invokes those agents, and returns a final synthesis. Role mandates and the moderator protocol are prompt-driven. The README also describes tool-agent and browser/multi-model plans, but the inspected runtime implements only a text-only tool-agent placeholder and fake client; those planned integrations are not shown as working subsystems.
Main entry points: orchestrator.py Council loop · config.py Config loader · main.py Runnable demo · agents.py Agent runtime
Components 15
Entry point
- Runnable demo
main.py
Council coordination
- Council loop
src/mantrana/orchestrator.py - Moderator router
src/mantrana/router.py - Shared log
src/mantrana/log.py
Roles and prompts
- Agent runtime
src/mantrana/agents.py - Role mandates
prompts/roles - Moderator protocol
prompts/moderator.md - Role catalog
prompts/role_catalog.md
Configuration and clients
- Config loader
src/mantrana/config.py - Council settings
config/council.yaml - Model bindings
config/models.yaml - Client contract
src/mantrana/clients/base.py - Fake client
src/mantrana/clients/fake.py
Other components
- Problem submitter
- Final synthesis
Connections 19
- Problem submitter → Runnable demo: submits problem
- Runnable demo → Config loader: loads settings
- Runnable demo → Fake client: creates clients
- Runnable demo → Council loop: starts council
- Council loop → Config loader: reads prompts
- Config loader → Council settings: loads YAML
- Config loader → Role mandates: reads mandates
- Config loader → Moderator protocol: reads protocol
- Config loader → Role catalog: reads catalog
- Council loop → Moderator router: parses and enforces
- Moderator router → Council settings: reads invariants
- Council loop → Shared log: updates log
- Council loop → Agent runtime: invokes roles
- Agent runtime → Shared log: reads context
- Agent runtime → Client contract: queries through
- Council loop → Client contract: queries moderator
- Fake client → Client contract: implements
- Model bindings → Config loader: documents bindings
- Council loop → Final synthesis: returns final