Structured Extraction
Use this skill when a task depends on facts contained in uploaded documents or other files and those facts must be extracted before analysis.
Workflow
- Read the
## Current attachmentssection in the system prompt. It gives each original filename plus its preprocessed Markdown and original-file paths. - For each source, call
document_conversion_api_extractdocumentdirectly withrun_pythononly when the preprocessed Markdown is missing or a fresh extraction is explicitly needed. Pass the original path asfile_path. - In that Python call, serialize the complete result to
/home/user/work/<source-name>.jsoninstead of printing it. For example:
import json
result = document_conversion_api_extractdocument(
file_path="/home/user/attachments/<attachment-id>/original/<source-file>"
)
with open("/home/user/work/<source-file>.json", "w") as extracted:
extracted.write(json.dumps(result, ensure_ascii=False, indent=2))
print("Saved extraction to /home/user/work/<source-file>.json")
- Prefer reading or searching the preprocessed
/home/user/attachments/<attachment-id>/content.mdwithread_fileorrun_bashcommands such asgrep; it remains available across later turns. Work files also persist without appearing as generated files in the conversation. - Preserve the source filename and every available location marker when reporting evidence. Keep extraction separate from interpretation.
- If conversion fails or a format is unsupported, report the exact failure and do not substitute guessed content.
Xberg supports many document families, including PDF, Word and other office documents, spreadsheets, presentations, ebooks, email, archives, HTML/XML, structured text, images with OCR, and audio or video transcription. Let the conversion response determine whether a particular file is supported.
Quality checks
- Every extracted claim has a source filename and location when available.
- Tables retain their headers and row or column meaning.
- Empty, unreadable, or missing content is marked as unavailable.
- Extraction and interpretation remain separate.