AgentVault Vault Processing
Instructions
- •
Vault structure
- •Treat the uploaded vault as a zip containing folders of
.mdfiles. - •Ignore
.obsidianand other hidden/system directories. - •Work against a per-request temp directory, not the original zip.
- •Treat the uploaded vault as a zip containing folders of
- •
Markdown handling
- •For each markdown file:
- •Read the file content as UTF-8.
- •Detect and parse YAML frontmatter using
PyYAML.- •If frontmatter is missing, create a minimal one with at least
titleandtagskeys.
- •If frontmatter is missing, create a minimal one with at least
- •Optionally, use
markdown-it-pyormistuneto understand headings and sections before rewriting.
- •For each markdown file:
- •
Entity extraction with spaCy
- •Load the
en_core_web_smmodel once at startup or in a shared context. - •For each note body (excluding frontmatter):
- •Run
doc = nlp(text)and collectdoc.ents(e.g., names, organizations, dates). - •Store relevant entities either in frontmatter fields (e.g.,
entities,people,places) or in a separate data structure used to buildentities.md.
- •Run
- •Load the
- •
LLM-powered rewriting via OpenRouter
- •Use OpenRouter with models like
anthropic/claude-3.5-sonnetto rewrite notes. - •Prompt guidelines:
- •Preserve meaning, code blocks, and links exactly.
- •Improve structure with clear headings, lists, and sections.
- •Make the note more explicit and self-contained for AI agents.
- •Implement batching or concurrency (e.g., with
asyncio) while respecting rate limits and timeouts.
- •Use OpenRouter with models like
- •
Global artifacts
- •After processing all notes:
- •Create an
index.mdthat lists all notes by title and relative path, optionally grouped or tagged. - •Create an
entities.mdsummarizing entities across the vault; group them by type (people, organizations, etc.).
- •Create an
- •After processing all notes:
- •
Output
- •Write all transformed notes and global index files into a new directory, mirroring the original structure.
- •The backend will zip this directory to produce the cleaned vault for download.
Examples
- •Example tasks this skill should handle
- •Given an unzipped vault directory, produce a list of all
.mdfiles to process. - •For a given markdown file, show how to:
- •Parse YAML frontmatter.
- •Extract entities with spaCy.
- •Prepare a prompt and call the OpenRouter API to rewrite the body.
- •Given a collection of processed notes, outline how to build
index.mdandentities.md.
- •Given an unzipped vault directory, produce a list of all