Skip to Content

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:

  1. You upload your game files (dialogue scripts, data files, configs)
  2. An AI agent reads through them and identifies lore content
  3. You review the extractions and approve what to keep
  4. Approved extractions become Lore Documents, ready for NPC interactions

Supported File Formats

The scanner accepts 12 common game development file formats:

FormatExtensionDescription
Ink.inkInk narrative scripting
Yarn Spinner.yarnYarn Spinner dialogue files
Unity Assets.assetUnity ScriptableObjects
JSON.jsonJSON data files
CSV.csvTabular data (e.g., item tables, NPC databases)
XML.xmlXML data files
C#.csC# scripts (embedded lore in comments/strings)
Twine.twTwine story files
Twee.tweeTwine Twee format
Markdown.mdMarkdown files
Text.txtPlain text files
Markdown.markdownMarkdown 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

LimitValue
Max files per scan100
Max file size2 MB
Max total upload size50 MB
Job expiry24 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:

  • DashboardIntelligence > 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

Last updated on