Skip to content

Check Lore Consistency Stream

POST
/api/agents/lorekeeper/check-consistency/stream

Stream lore consistency check via NDJSON for progressive UI updates.

LorekeeperConsistencyCheckRequest

Comprehensive lore consistency check request.

Validates lore consistency across documents with full context support. Accepts document content with optional IDs, paths, and metadata for maximum flexibility and comprehensive analysis.

Fields: documents: List of DocumentContent objects to check (REQUIRED, min 1) project_type: Project type for lore rules (OPTIONAL, default: “worldbuilding”) check_depth: Analysis depth level (OPTIONAL, default: “moderate”) include_suggestions: Include fix suggestions (OPTIONAL, default: True) compare_against_canon: Compare against specific canon (OPTIONAL) cross_reference: Check consistency across all docs (OPTIONAL, default: True)

JSON Example: { “documents”: [ { “content”: “Arasai fought alongside Erebos…”, “document_id”: “doc_123”, “title”: “Chapter 1” } ], “project_type”: “worldbuilding”, “check_depth”: “deep”, “include_suggestions”: true, “cross_reference”: true }

Used By: - POST /api/agents/lorekeeper/check-consistency - Lore consistency validation UI - Document validation workflows

object
documents
required
Documents

Documents to check with full context

Array<object>
>= 1 items
DocumentContent

Complete document context for lore consistency checking.

Provides rich document context including content, identifiers, and metadata. Supports flexible usage: content-only for ad-hoc analysis OR complete context with IDs, paths, and metadata for tracked documents.

Fields: content: Document content to analyze (REQUIRED) document_id: Source document ID from database (OPTIONAL) path: File path or document location (OPTIONAL) title: Document title for reporting (OPTIONAL) document_type: Type of document (OPTIONAL) project: Project/world the document belongs to (OPTIONAL)

JSON Example: { “content”: “Arasai wielded the Sword of Fate…”, “document_id”: “doc_123”, “path”: “documents/chapter_01.md”, “title”: “Chapter 1: The Beginning”, “document_type”: “story”, “project”: “my_project” }

Used By: - LoreKeeper consistency checking - Document analysis workflows - Cross-reference validation

object
content
required
Content

Document content to analyze for lore consistency

string
documentId
Any of:
string
path
Any of:
string
title
Any of:
string
documentType
Any of:
string
project
Any of:
string
projectType
Projecttype

Project type for lore rules (worldbuilding, custom, generic)

string
default: worldbuilding
checkDepth
Checkdepth

Analysis depth: minor, moderate, strict, deep. Legacy name kept for back-compat — new clients should send strictness on the unified off | low | medium | high scale instead. When both are sent, strictness wins.

string
default: moderate
strictness
Any of:
string
Allowed values: off low medium high
includeSuggestions
Includesuggestions

Include fix suggestions for inconsistencies

boolean
default: true
compareAgainstCanon
Any of:
string
crossReference
Crossreference

Check consistency across all provided documents

boolean
default: true
scopeKind
Scopekind

M8: which scope to run the DE Lorekeeper handler against. document (default) matches the pre-M8 behavior; the other kinds let callers trigger broader scans without splitting the request.

string
default: document
Allowed values: project document scene chapter manuscript

Successful Response

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object