AI Integration Guide
Build AI context and use intelligent features.
Grimoire is built for AI-assisted worldbuilding. This guide covers how to build context for AI assistants and use the intelligent features.
The Knowledge Context System
When you use AI tools with Grimoire, the AI needs to understand your campaign. The Knowledge Context system controls what information is available.
The Four Layers
- Layer 1 - Constitution: Core world truths that never change
- Layer 2 - Knowledge Graphs: Structural relationships (political, geographic)
- Layer 3 - Attention Filter: Entities marked for current relevance
- Layer 4 - Full Database: Complete campaign data
Why Layers Matter
AI context windows have limits. By organizing information into layers, Grimoire ensures the most relevant information is always available while keeping the full database searchable.
Building Your Constitution
The Constitution defines your world's fundamental truths.
What to Include
- World Name & Setting: "A dark fantasy world called Vaeloria"
- Core Themes: "Moral ambiguity, religious conflict, survival"
- Magic System: "Magic comes from blood sacrifice"
- Key History: "The Sundering split the world 1000 years ago"
- Current Situation: "Five kingdoms vie for control of the Throne"
Writing Tips
- Be concise: Each fact should be one clear sentence
- Focus on impact: Include things that affect play
- Update rarely: This is your foundation, not current events
- Use the Campaign Bible: Generate a formatted summary
Knowledge Graphs
Graphs show relationships between entities.
Built-in Graphs
Political Graph:
- Tracks faction relationships
- Shows alliances, rivalries, conflicts
- Helps AI understand power dynamics
Geographic Graph:
- Shows location containment (city > district > building)
- Tracks routes and connections
- Helps AI understand spatial relationships
Custom Entity Graphs
Create your own relationship maps:
- Go to Knowledge > Graphs
- Click "Create Graph"
- Choose which entity types to include
- Define relationship types (ally, enemy, controls, knows, etc.)
- Add entities and connect them
The Attention System
Not every entity needs to be in AI context. The attention system marks what's currently relevant.
Marking Attention
- Open any entity
- Click the "eye" icon to toggle attention
- Entities with attention are included in AI context
When to Use Attention
Mark these with attention:
- NPCs the party is currently interacting with
- Locations they're in or heading to
- Active quests
- Recently discovered information
Remove attention from:
- Completed quests
- NPCs they've left behind
- Locations they've moved past
Session Window
The Session Window automatically includes:
- Recent sessions (configurable, default 5)
- All entities referenced in those sessions
- This creates "rolling" context that follows the campaign
Claude Desktop Setup
See the MCP Integration Guide for detailed setup instructions.
Quick Start
- Install Node.js from nodejs.org
- Run:
npm install -g mcp-remote - Get your MCP token from Campaign Settings > MCP Configuration
- Configure Claude Desktop (Settings > Developer > Edit Config)
Available MCP Tools
Once connected, Claude has access to these tools:
Reading Your Campaign
search_campaign- Find anything by keywordget_entity- Get full details of an entitylist_entities- Browse entities by categoryget_constitution- Get world foundationsget_knowledge_graph- Get relationship dataget_wiki_page- Read wiki content
Modifying Content (GM only)
create_entity- Add new entriesupdate_entity- Make changesdelete_entity- Remove entriesadd_relationship- Link things togethercreate_wiki_page- Add wiki pagescreate_wiki_block- Add wiki content
Example Prompts
World Building
- "Create 5 NPCs for the Thieves' Guild faction"
- "Generate a backstory for Millbrook that connects to the Sundering"
- "What factions would be interested in the artifact the party found?"
Session Prep
- "Help me plan an encounter at the Broken Crown tavern"
- "What loose threads from recent sessions should I address?"
- "Create a side quest involving the Merchant's Guild"
During Play
- "What does Lord Blackwood know about the Sundering?"
- "Who in the city might have information about the missing shipments?"
- "Generate a random encounter appropriate for the Darkwood Forest"
Best Practices
- Keep Constitution current: Update it when major world changes happen
- Use attention wisely: More attention = more context = better AI
- Create graphs early: Relationship data powers intelligent queries
- Reference sessions: The more you log, the smarter queries become
- Trust visibility: AI respects DM Secret - players can't query it