Skip to content
M
MANTRA

Documentation

Set up once, your AI assistant automatically understands your team's architecture rules.

How MANTRA Works

MANTRA is a constitutional memory for your AI assistant. Once connected, your AI assistant will automatically understand your architecture rules, coding standards, and technical decisions — without you having to re-explain every session.

Without MANTRA

AI assistant starts from zero every session. Doesn't know your team's rules. May suggest things that contradict existing decisions.

With MANTRA

AI assistant instantly knows all architecture decisions, constraints, and standards. Automatically aligns suggestions with your rules.

You don't need to memorize tool names

AI assistants (Claude Code, Cursor, Windsurf) automatically know when to use MANTRA's 40+ MCP tools. When you ask "how does authentication work in this project?", the AI automatically retrieves relevant decisions. When you write code, the AI automatically checks compliance. You just work as usual — MANTRA works behind the scenes.

Setup (one time only)

1. Connect MANTRA to Your AI Assistant

Add this configuration to your AI assistant. After this, AI automatically has access to all your team's architecture decisions.

claude_desktop_config.json / .cursor/mcp.json
{
  "mcpServers": {
    "mantra": {
      "command": "npx",
      "args": ["-y", "@anthropic/mantra-mcp-server"],
      "env": {
        "MANTRA_API_URL": "https://api-mantra.arsaka.io",
        "MANTRA_API_KEY": "your-api-key-here"
      }
    }
  }
}

How to get an API key: Login to the MANTRA dashboard → Settings → API Keys → Create New Key.

Claude Code
claude_desktop_config.json
Cursor
.cursor/mcp.json
Windsurf
.windsurf/mcp.json
Fill the memory

2. Record Your Architecture Decisions

This is the core of MANTRA: record your team's technical rules and decisions. Use the web dashboard, or just ask your AI assistant to create them.

Example conversation with AI assistant:

U
"Record an architecture decision: all database tables must use RLS for multi-tenancy. This applies to the entire backend."
AI
"I'll create an ARCH domain decision with scope backend/* and blast_radius high. Here's what I'm recording: ..."
AI automatically uses mantra_create_decision
What happens behind the scenes (you don't need to write this)
mantra_create_decision({
  domain: "ARCH",
  aspect: "A06",
  statement: "Use PostgreSQL with RLS for multi-tenant data isolation",
  rationale: "RLS provides row-level security without app-level filtering",
  scope_path: "backend/*",
  blast_radius: "high",
  constraints: [
    "All tables MUST have tenant_id column",
    "RLS policies MUST be enabled on every tenant table"
  ]
})

4 Decision Domains

  • INT — Vision, goals, and strategic direction
  • ARCH — Technical structure and patterns
  • CTL — Standards and policies
  • EVO — Migration and system evolution

Decision Code

Every decision gets a unique code:

ARCH-A06-001-v1.0.0

Domain — Aspect — Sequence — Version

Quality control

3. Every Decision is Validated in 3 Stages

This process is automatic — you only need to approve at the final stage.

1

Schema Validation

AUTOMATIC

System automatically ensures correct format: required fields present, valid domain, structured constraints. On failure, the decision is rejected automatically.

2

AI Quality Check

AUTOMATIC

AI checks for duplication, conflicts with other decisions, and writing quality. Results are improvement suggestions, not rejections.

3

Human Approval

YOU APPROVE

You (or a designated team member) review and approve. AI cannot approve — this is a fundamental MANTRA principle. Architecture decisions must always come from humans.

After setup

4. AI Assistant Works Automatically for You

Once decisions are recorded, you don't need to do anything special. Your AI assistant automatically uses MANTRA as you work.

Automatically retrieves relevant decisions

When you ask about a topic, AI automatically searches and displays applicable architecture decisions.

You: "How should I implement authentication in the new service?"

AI: Automatically retrieves decision ARCH-A08-001 about JWT + RLS, then answers according to established rules.

Automatically checks code compliance

When AI writes or reviews code, it automatically checks whether the code complies with recorded constraints.

You: "Review this PR before merge."

AI: Automatically runs review from 3 perspectives (security, architecture, compliance) against all applicable decisions.

Automatically warns about conflicts

If you plan something that contradicts an existing decision, AI immediately informs you.

You: "Let's switch all APIs to GraphQL."

AI: Automatically detects conflict with decision ARCH-A07-002 that established a REST-only policy, and explains the contradiction.

Automatically generates documents and IDE rules

Ask AI to create documentation or IDE configurations from existing decisions.

You: "Generate a Tech Spec for the backend architecture."

AI: Automatically retrieves all ARCH domain decisions, compiles a complete Tech Spec with constraints and dependencies.

Web dashboard

5. Manage via Dashboard

Besides AI assistant, you can also manage decisions from the web dashboard with visual features.

Decision List & Detail

View all decisions, filter by domain, search, and see full details including constraints and history.

Approval Queue

Review and approve decisions awaiting Gate 3 validation. Approve or reject with comments.

Analytics & Projections

Decision evolution timeline, knowledge graph, tech stack analysis, and blast radius mapping.

Team & Settings

Manage team members, API keys, choose industry template, and configure organization.

Document Generator

Generate PRD, Tech Spec, ADR, Security Spec, and 10 other document types directly from dashboard.

Violation Tracker

View detected constraint violations, track resolution, and monitor compliance score.

Output

What MANTRA Can Generate

From recorded decisions, MANTRA can produce various outputs:

14 Document Types

PRDTech SpecAPI SpecSecurity SpecTest PlanADRExec SummaryUser ManualFeature SpecThreat ModelDeploy GuideRunbookFAQChangelog

9 IDE Rule Formats

Export decisions as rules for AI assistants in other IDEs:

.cursorrulesCLAUDE.mdCopilotWindsurfAiderClineAGENTS.mdUniversalCustom

Export & Backup

All decisions can be exported anytime in JSON, Markdown, ADR format, or SQL dump. Your data is always yours.

Configuration

Industry Templates

MANTRA adapts terminology and examples based on your industry. Choose when creating an organization.

Software Engineering
API design, database, infrastructure, security
Healthcare
Clinical protocols, medical devices, compliance
Government
Policy governance, regulatory, inter-agency
Finance
Financial regulation, risk management, audit
Education
Curriculum decisions, institutional policy
Manufacturing
Process governance, quality standards
Research
Methodology, peer review, reproducibility
NGO
Program governance, donor compliance
Startup
Rapid decisions, pivot tracking, MVP scope
Corporate Law
Legal policy, compliance frameworks

Ready to try?

5-minute setup. Your AI assistant instantly understands your team's rules.