Lore Scanner
Automatically extract lore from your game’s existing data files.
Overview
Most games already have lore scattered across dialogue scripts, data files, and configuration. The Lore Scanner uses AI to discover and structure this content into Lore Documents — no manual rewriting needed.
What it does:
- You upload your game files (dialogue scripts, data files, configs)
- An AI agent reads through them and identifies lore content
- You review the extractions and approve what to keep
- Approved extractions become Lore Documents, ready for NPC interactions
Supported File Formats
The scanner accepts 12 common game development file formats:
| Format | Extension | Description |
|---|---|---|
| Ink | .ink | Ink narrative scripting |
| Yarn Spinner | .yarn | Yarn Spinner dialogue files |
| Unity Assets | .asset | Unity ScriptableObjects |
| JSON | .json | JSON data files |
| CSV | .csv | Tabular data (e.g., item tables, NPC databases) |
| XML | .xml | XML data files |
| C# | .cs | C# scripts (embedded lore in comments/strings) |
| Twine | .tw | Twine story files |
| Twee | .twee | Twine Twee format |
| Markdown | .md | Markdown files |
| Text | .txt | Plain text files |
| Markdown | .markdown | Markdown variant |
How It Works
1. Estimate Cost
Before uploading, send file metadata to get a cost estimate:
curl -X POST https://loremind.peekgames.dev/api/loremind/v1/scanner/estimate \
-H "Authorization: Bearer sk_editor_your_key" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "filename": "story.ink", "sizeBytes": 45000 },
{ "filename": "npcs.json", "sizeBytes": 12000 }
]
}'2. Upload Files
Upload your game files for scanning:
curl -X POST https://loremind.peekgames.dev/api/loremind/v1/scanner/submit \
-H "Authorization: Bearer sk_editor_your_key" \
-F "files=@story.ink" \
-F "files=@npcs.json" \
-F "userContext=A fantasy RPG set in the kingdom of Eldrath"The scanner returns a jobId and begins processing in the background.
3. Poll for Results
Check the job status until processing completes:
curl https://loremind.peekgames.dev/api/loremind/v1/scanner/jobs/job_abc123 \
-H "Authorization: Bearer sk_editor_your_key"When status is COMPLETED, the response includes extracted lore items with titles, tags, confidence scores, and content previews.
4. Review and Commit
Approve the extractions you want to keep. Each approved extraction becomes a Lore Document:
curl -X POST https://loremind.peekgames.dev/api/loremind/v1/scanner/commit \
-H "Authorization: Bearer sk_editor_your_key" \
-H "Content-Type: application/json" \
-d '{
"jobId": "job_abc123",
"extractionIds": ["ext_1", "ext_2", "ext_5"]
}'Committed documents are automatically processed through the embedding pipeline and become available for NPC interactions.
Re-scanning (True-Up)
When your game files change, use the rescan endpoint to identify what’s different:
curl -X POST https://loremind.peekgames.dev/api/loremind/v1/scanner/rescan \
-H "Authorization: Bearer sk_editor_your_key" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "filename": "story.ink", "contentHash": "sha256_of_current_file" },
{ "filename": "npcs.json", "contentHash": "sha256_of_current_file" },
{ "filename": "new_quest.ink", "contentHash": "sha256_of_new_file" }
]
}'The response tells you which files are changed, added, deleted, or unchanged compared to the last scan. You can then re-submit only the changed and added files.
Limits
| Limit | Value |
|---|---|
| Max files per scan | 100 |
| Max file size | 2 MB |
| Max total upload size | 50 MB |
| Job expiry | 24 hours |
Jobs expire after 24 hours. After expiry, reserved credits are refunded and scan results are no longer available for commit.
Credit Costs
The Lore Scanner is more expensive per-operation than manual document upload because it uses an AI agent to read, interpret, and extract lore from raw game files.
Cost factors:
- Total file size — Larger files require more AI processing
- File count — Each file is analyzed individually
- Content complexity — Dense narrative files may produce more extractions
Use the /scanner/estimate endpoint to get a cost estimate before uploading.
Access
The scanner is accessible from:
- Dashboard — Intelligence > Scanner for visual upload and review
- Editor API Key — All 6 scanner endpoints accept
sk_editor_*keys for Unity Editor integration - Dashboard session — All endpoints also accept dashboard session auth
See the API Reference for complete endpoint documentation.
Next Steps
- API Reference — Full endpoint documentation with request/response schemas
- Lore Documents — How extracted lore is stored and used
- Credits & Billing — Scanner cost details