Docs / Getting Started / Guides / Documentation Style Guide Documentation Style Guide How to write PraisonAI documentation pages β structure, components, diagrams, and writing rules
Every PraisonAI documentation page follows the same structure, component set, and visual language β this guide is both the reference and the example.
python from praisonaiagents import Agent
agent = Agent(
name="Research Agent",
instructions="Research and summarise topics clearly.",
)
agent.start("What is agentic AI?")
The user copies the opening example, runs the agent, then follows the page structure below.
Diagram
Documentation Creation Process
Read the SDK source before writing anything β documentation must reflect SDK ground truth, not assumptions.
Read SDK source Open and read the actual SDK implementation file in praisonaiagents/ before writing a single word of documentation.
python # Example: reading agent source before documenting
# praisonaiagents/agent/agent.py β read this first
from praisonaiagents import Agent
agent = Agent(
name="Research Agent",
instructions="Research and summarize topics"
)
agent.start("What is agentic AI?")
Extract all parameters Pull every parameter, type, default value, and description from the SDK source or config class.
python # praisonaiagents/config/feature_configs.py
@dataclass
class CachingConfig:
enabled: bool = True # Extract: enabled, bool, True
ttl: int = 3600 # Extract: ttl, int, 3600
backend: str = "memory" # Extract: backend, str, "memory"
Check existing docs Search docs/ for related pages before creating a new one β avoid duplication, ensure consistency.
Write the page Follow the Page Structure Template and every rule in this guide.
SDK-First Cycle
Never batch-update multiple pages without reading source for each.
Step Action READ Open the actual SDK source file UNDERSTAND Comprehend the implementation, APIs, and behaviour DOCUMENT Write documentation based on SDK truth REPEAT Move to the next feature and restart
File Locations
Content Type SDK Location Docs Location Feature configs praisonaiagents/config/feature_configs.pydocs/concepts/*.mdxAgent class praisonaiagents/agent/agent.pydocs/concepts/agents.mdxMCP integration praisonaiagents/mcp/mcp.pydocs/concepts/mcp.mdxSkills praisonaiagents/skills/docs/concepts/skills.mdxMemory praisonaiagents/memory/docs/concepts/memory.mdxKnowledge praisonaiagents/knowledge/docs/concepts/knowledge.mdx
Multi-SDK Reference
SDK Source Code Path Documentation Path Parity Tracker Python Repo root praisonaiagents/ (synced copy; upstream: praisonai-package/src/praisonai-agents/) docs/concepts/, docs/features/docs/features/DOCS_PARITY.mdTypeScript/JS praisonai-package/src/praisonai-ts/src/docs/js/docs/js/DOCS_PARITY.mdRust praisonai-package/src/praisonai-rust/praisonai/src/docs/rust/docs/rust/DOCS_PARITY.md
Note The Rust crate is at praisonai-rust/praisonai/src/, not praisonai-rust/src/. The src/praisonai-rust/src/** path does not exist and was previously wired into the parity workflows β see upstream PR #4689.
Note Two parity trackers, two questions.
PraisonAI uses two distinct parity systems β do not conflate them.
DOCS_PARITY.md (this repo, one per SDK) answers: “Does documentation exist for each SDK feature category?” Labels: β
Documented, β οΈ Stub, β Undocumented.PARITY.md (main PraisonAI repo, one per non-Python SDK) answers: “Does a matching exported symbol name exist in this SDK for each Python export?” Labels: β
exported, β³ missing.
PARITY.md counts exported symbol names , not behaviour. An β
exported cell means the name is present in the SDK’s public surface β it does not verify the capability is reachable, wired up, or behaves like its Python counterpart. Counts include barrel re-exports, so raw totals are not directly comparable across SDKs. For capabilities with a testable contract, rely on their conformance suite rather than the PARITY.md table.
TypeScript SDK Structure praisonai-ts/src/
βββ agents/ # Agent implementations
βββ tools/ # Tool definitions
βββ memory/ # Memory implementations
βββ mcp/ # MCP protocol support
βββ observability/ # Tracing integrations
βββ index.ts # Main exports
Rust SDK Structure praisonai-rust/praisonai/src/
βββ agents/ # Agent implementations and builders
βββ llm/ # LLM providers
βββ tools/ # Tool system
βββ memory/ # Memory stores
βββ mcp/ # MCP client
βββ parity/ # Parity-shim modules (config, telemetry, plugins, param_resolver)
βββ display/ # Display and callbacks
βββ planning/ # Planner and PlanStep
βββ session/ # Session
βββ streaming/ # Streaming metrics
βββ sandbox/ # Sandbox config
βββ embedding/ # Embedding config
βββ error.rs # Result/error helpers
βββ lib.rs # Main exports
Folder Placement Rules
Where a file lives determines who can change it β AI agents have write access to most folders but never docs/concepts/.
Folder Who Can Write Purpose docs/concepts/HUMAN ONLY Core architecture concepts docs/features/AI agents + humans Feature documentation, guides, integrations docs/tools/AI agents + humans Tool-specific documentation docs/guides/AI agents + humans How-to guides and tutorials docs/js/, docs/rust/Auto-generated ONLY Managed by parity system
AI Agent Behavioural Rules
Page Structure Template
Every documentation page follows this exact skeleton.
mdx ---
title: "Feature Name"
sidebarTitle: "Feature Name"
description: "One-line description of what this feature does"
icon: "icon-name"
---
{/* One sentence explaining the feature β what it does, not how */}
{/* Hero Mermaid diagram showing the concept visually */}
## Quick Start
<Steps>
<Step title="Simple Usage">
{/* Minimal code example β enable with True */}
</Step>
<Step title="With Configuration">
{/* Code example with config class */}
</Step>
</Steps>
---
## How It Works
{/* Sequence diagram or flow diagram */}
{/* Brief explanation table */}
---
## Configuration Options
{/* Link to auto-generated SDK reference β DO NOT duplicate SDK parameters here */}
<Card title="[Feature] API Reference" icon="code" href="/docs/sdk/typescript">
TypeScript configuration options
</Card>
---
## Common Patterns
{/* 2β3 practical usage patterns */}
---
## Best Practices
<AccordionGroup>
{/* 3β4 best practices as accordions */}
</AccordionGroup>
---
## Related
<CardGroup cols={2}>
{/* 2 related concept pages */}
</CardGroup>
Mermaid Diagram Standards
Every page starts with a hero Mermaid diagram using the standard colour scheme.
Colour Scheme
Colour Hex Use Dark Red #8B0000Agents, inputs, outputs, tasks Teal #189AB4Tools, processes, middleware Green #10B981Success, results, completion Amber #F59E0BWarnings, planners, intermediate steps Indigo #6366F1Configuration, settings, options White #fffText β always white on coloured backgrounds Grey #7C90A0Stroke/border colour
Diagram Types by Use Case
Use Case Diagram Type Feature overview graph LR β flow left-to-rightProcess flow graph TB β steps top-to-bottomInteractions sequenceDiagram β agent-user-system interactionsOptions/modes graph TB with subgraphs
Hero Diagram (rendered) Diagram
Hero Diagram (source) graph LR
subgraph "Feature Name"
A[π Input] --> B[π§ Process]
B --> C[β
Output]
end
classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
classDef process fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef output fill:#10B981,stroke:#7C90A0,color:#fff
class A input
class B process
class C output
Sequence Diagram (rendered) Diagram Feature Agent User Feature Agent User Request Process Result Response
Sequence Diagram (source) sequenceDiagram
participant User
participant Agent
participant Feature
User->>Agent: Request
Agent->>Feature: Process
Feature-->>Agent: Result
Agent-->>User: Response
Mintlify Components Usage
Every page must use `
,
, and
` β these are not optional.
Required Components
Component Purpose Required In `
| Sequential flows | Quick Start section | |
| Grouped content | Best Practices section | |
| Related links | Related section | |
| Multi-language examples | Code comparison | |
Note /
Warning /
Tip ` | Callouts | Context-dependent |
Component Syntax
Steps:
mdx <Steps>
<Step title="First Step">
Content here.
</Step>
<Step title="Second Step">
Content here.
</Step>
</Steps>
AccordionGroup:
mdx <AccordionGroup>
<Accordion title="Best Practice Title">
Content here.
</Accordion>
<Accordion title="Another Practice">
Content here.
</Accordion>
</AccordionGroup>
CardGroup:
mdx <CardGroup cols={2}>
<Card title="Card Title" icon="icon-name" href="/docs/sdk">
Card description.
</Card>
<Card title="Card Title" icon="icon-name" href="/docs/sdk">
Card description.
</Card>
</CardGroup>
Tabs:
mdx <Tabs>
<Tab title="Python">
```python
code here
```
</Tab>
<Tab title="TypeScript">
```typescript
code here
```
</Tab>
</Tabs>
Code Example Standards
Every example must run without modification β copy-paste success is the bar.
Code Quality Rules Run without modification (copy-paste success) Include ALL necessary imports Use realistic but simple data Be the shortest way to accomplish the task Show the feature being documented, not unrelated features
Import Patterns Use these exact imports β no complex sub-module paths:
python # Single agent
from praisonaiagents import Agent
# Agent with planning
from praisonaiagents import Agent, PlanningConfig
# Multi-agent
from praisonaiagents import Agent, Task, PraisonAIAgents
# MCP
from praisonaiagents import Agent
from praisonaiagents.mcp import MCP
# Workflows β use simple import, not sub-module
from praisonaiagents import when, parallel, loop
Simple Quick Start Example python from praisonaiagents import Agent
agent = Agent(
name="Research Agent",
instructions="Research and summarize topics",
feature=True
)
agent.start("What is agentic AI?")
Config Class Example python from praisonaiagents import Agent, PlanningConfig
agent = Agent(
name="Research Agent",
instructions="Research and summarize topics",
planning=PlanningConfig(
model="gpt-4o",
verbose=True
)
)
agent.start("Plan a research strategy for AI safety")
Configuration Table Format
Document every SDK option in this format:
markdown | Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option_name` | `type` | `default` | What it does |
Writing Style
Concise, active voice, direct β after reading a page, users should think “is it really this easy?”
Do / Don’t
Principle Do Don’t Concise “Planning breaks tasks into steps” “Planning is a feature that allows agents to break down complex tasks into smaller, more manageable steps” Active voice “Enable planning with planning=True“ “Planning can be enabled by setting the planning parameter to True” Direct “Use gpt-4o for planning” “It is recommended that you consider using gpt-4o for planning” Specific “Set timeout=60 for slow servers” “Increase the timeout if needed”
Section Introductions
Each section starts with exactly one sentence β no multi-sentence preamble.
β
Good: "Planning enables agents to think before acting."
β Bad: "Planning is a powerful feature that enables agents to think before acting.
It allows them to break down complex tasks into smaller steps."
Configuration Documentation Pattern
Features support multiple configuration levels β document each level the feature actually supports.
Precedence ladder: Instance > Config > Array > Dict > String > Bool > Default
python # Level 1: Bool (simplest)
agent = Agent(feature=True)
# Level 2: String
agent = Agent(feature="option_name")
# Level 3: Dict
agent = Agent(feature={"option": "value", "enabled": True})
# Level 4: Array
agent = Agent(feature=["option1", "option2"])
# Level 5: Config class
agent = Agent(feature=FeatureConfig(option="value"))
# Level 6: Instance (full control)
feature_instance = Feature(option="value")
agent = Agent(feature=feature_instance)
SDK Config Extraction
When reading feature_configs.py, extract every field:
python @dataclass
class FeatureConfig:
option1: str = "default" # Extract: option1, str, "default"
option2: bool = False # Extract: option2, bool, False
option3: Optional[int] = None # Extract: option3, int, None
Convert to documentation table:
Option Type Default Description option1str"default"Description from docstring option2boolFalseDescription from docstring option3intNoneDescription from docstring
Mintlify Frontmatter
All four fields are required on every page.
yaml ---
title: "Feature Name" # Display title
sidebarTitle: "Feature Name" # Sidebar title (usually same as title)
description: "One-line desc" # Meta description
icon: "icon-name" # Lucide icon name
---
Icon Selection
Feature Type Icon Planning list-checkReflection rotateSkills puzzle-pieceHooks webhookAutonomy robotOutput displayExecution playCaching databaseTemplates file-codeWeb globeMCP plugMemory brainKnowledge bookTools wrenchAgents user
Quality Checklist
Run through this before submitting any documentation page.
Structure [ ] Frontmatter complete (title, sidebarTitle, description, icon) [ ] Hero Mermaid diagram present [ ] Quick Start uses `
` component
[ ] Configuration Options table complete [ ] Best Practices uses `
`
[ ] Related section uses `
SDK Accuracy [ ] All config options documented [ ] Types match SDK exactly [ ] Defaults match SDK exactly [ ] Import paths are correct [ ] No undocumented features
Code Quality [ ] All examples run without modification [ ] All imports included [ ] Examples are minimal (shortest way to accomplish the task) [ ] No placeholder values like "your-key-here"
Diagrams [ ] Colour scheme matches standard (#8B0000, #189AB4, #10B981, #F59E0B, #6366F1) [ ] White text on coloured backgrounds (color:#fff) [ ] classDef declarations present [ ] Diagram explains the concept visually
Writing [ ] One-sentence section intros [ ] No forbidden phrases [ ] Active voice throughout [ ] Concise explanations
Complete Page Example
A full Caching page demonstrating every rule in this guide.
mdx ---
title: "Caching"
sidebarTitle: "Caching"
description: "Cache LLM responses to reduce costs and latency"
icon: "database"
---
Caching stores LLM responses to avoid redundant API calls, reducing costs and improving response times.
````mermaid
graph LR
subgraph "Caching Flow"
Request[π Request] --> Check{π Cache?}
Check -->|Hit| Return[β‘ Return]
Check -->|Miss| LLM[π€ LLM]
LLM --> Store[πΎ Store]
Store --> Return
end
classDef request fill:#6366F1,stroke:#7C90A0,color:#fff
classDef cache fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef result fill:#10B981,stroke:#7C90A0,color:#fff
class Request request
class Check,Store cache
class LLM,Return result
````
## Quick Start
<Steps>
<Step title="Enable Caching">
````python
from praisonaiagents import Agent
agent = Agent(
name="Research Agent",
instructions="Answer questions concisely",
cache=True
)
agent.start("What is machine learning?")
````
</Step>
<Step title="Configure Cache">
````python
from praisonaiagents import Agent, CachingConfig
agent = Agent(
name="Research Agent",
instructions="Answer questions concisely",
cache=CachingConfig(
ttl=3600,
backend="memory"
)
)
agent.start("What is machine learning?")
````
</Step>
</Steps>
---
## How It Works
````mermaid
sequenceDiagram
participant User
participant Agent
participant Cache
participant LLM
User->>Agent: Request
Agent->>Cache: Check cache
Cache-->>Agent: Miss
Agent->>LLM: Send prompt
LLM-->>Agent: Response
Agent->>Cache: Store response
Agent-->>User: Response
User->>Agent: Same request
Agent->>Cache: Check cache
Cache-->>Agent: Hit
Agent-->>User: Cached response
````
---
## Best Practices
<AccordionGroup>
<Accordion title="Set TTL based on data freshness">
Use short TTL (300s) for frequently changing data, longer TTL (3600s) for stable content.
</Accordion>
<Accordion title="Use disk backend for persistence">
Memory cache resets on restart β use `backend="disk"` to persist across sessions.
</Accordion>
</AccordionGroup>
---
## Related
<CardGroup cols={2}>
<Card title="Planning" icon="list-check" href="/docs/features/planning-mode">
Plan before executing to improve accuracy.
</Card>
<Card title="Memory" icon="brain" href="/docs/features/advanced-memory">
Store and retrieve long-term information.
</Card>
</CardGroup>
Related