llamacloud-extract
Skill0 starsChanged 5 months agoMITView on GitHub
This skill should be used when the user wants to "extract structured data from a document", "design/validate an extraction schema", write a "Pydantic/JSON/Zod extract schema", configure "LlamaExtract options/citations", or "pull typed fields from PDFs". Owns LlamaExtract v2 schema design and configuration judgment; defers raw text/markdown parsing, RAG/retrieval, and account/key/region setup to sibling skills.
In this repository12 other files it gives its agents.
- liteparseSkill
- llamacloud-classifySkill
- llamacloud-indexSkill
- llamacloud-parseSkill
- llamacloud-self-hostingSkill
- llamacloud-sheetsSkill
- llamacloudSkill
- llamacloud-splitSkill
- llamaindex-cookbooksSkill
- llamaindex-deploySkill
- llamaindex-frameworkSkill
- llamaindex-workflowsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 58
Keep nesting to ~3–4 levels.
- Distinctive: line 119
Look up exact, stale-prone details live (package name, class/method signatures, parameter and enum values, the current caps, page-range …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LlamaCloud Extract (v2)
LlamaExtract turns unstructured documents (PDFs, images, text) into typed output that conforms to a schema you define. Use it when the goal is schema-conformant data for a database, dashboard, spreadsheet, or downstream model — not document text for a human or a RAG pipeline.
Is Extract the right tool?
- Yes — you know the fields you want and need them typed and validated: invoice fields, contract terms, resume attributes, table rows as records.
- No, you want raw text/markdown of the document → use
llamacloud-parse. - No, you want to search/answer questions over many documents (retrieval,
RAG) → use
llamacloud-index. - Account, API key, or region setup is not covered here → core
llamacloud.
Extract is built on parsing, but its contract is schema conformance and data quality, which is why schema design is where most of the work and most of the wins are.
Version posture
Extract v2 is the primary, GA path — design all new work against it. The
/v1/ extract API is legacy and exists only as a migration reference; never make
it the default. If you encounter v1 code, treat porting it to v2 as the goal.
Workflow
- Confirm Extract fits (above). If the user really wants raw text or retrieval, hand off to the sibling skill.
- Design the schema first. This dominates output quality. Apply the durable
rules in
references/schema-design.md: object root, shallow nesting, strong field names, descriptions that carry format/examples, optional booleans and integers, prune auto-generated fields, start minimal and iterate. - Choose how the schema is applied. Pick the extraction target by document
shape (per-document / per-page / per-row), a tier by complexity and stakes,
and decide on system prompt, page range, and citations. See
references/options-and-tiers.md. - Run, inspect, refine. Turn citations on while tuning; fix misses by sharpening field descriptions before touching the tier.
- Validate the result against your typed model in code and post-process anything the schema can't enforce (defaults, formats).
Schema design (the core skill)
Author the schema as a typed model in your language — Pydantic in Python, Zod in TypeScript — or hand-write JSON Schema; all compile to JSON Schema for the API. Key durable rules:
- Root is an object; wrap repeating entities in a field (arrays can't be the root).
- Keep nesting to ~3–4 levels; flatten rather than mirror the page layout.
- Names become JSON keys — choose stable, query-friendly ones.
- Descriptions guide the model — encode format and examples there.
- JSON Schema
default/formatare not enforced — encode them in descriptions or post-process. - Make booleans and integers optional so "absent" isn't confused with
false/0.
Full rules, the optional-field syntaxes, caps, and the split-and-merge strategy
for oversized schemas are in references/schema-design.md.
Configuration (target, tier, options)
- Target by document shape: one record per document, per page, or per table row. A mismatched target is a top failure mode for repeating entities.
- Tier by complexity/stakes: the agentic default fits most documents; drop to cost-effective only after verifying accuracy; reserve the top tier for dense, high-stakes layouts.
- System prompt for global rules (disambiguation, conventions); keep field-level guidance in descriptions.
- Page range to scope large documents.
- Citations / reasoning / confidence for auditability and for diagnosing wrong extractions — the best debugging tool — at some latency cost.
Decision tables and the tuning loop are in references/options-and-tiers.md.
Minimal examples (illustrative — verify signatures live)
Python (confirm the current package name via the MCP — it has shifted between releases):
from pydantic import BaseModel
from typing import Optional
class Invoice(BaseModel):
invoice_number: str # field name = JSON key
total_amount: float
paid: Optional[bool] = None # optional so absent != False
# Submit `Invoice` as the schema to an extraction agent, then validate the
# returned dict back through Invoice(**result) and post-process.TypeScript (Zod):
import { z } from "zod";
const Invoice = z.object({
invoice_number: z.string(),
total_amount: z.number(),
paid: z.boolean().nullable(), // optional/absent-safe
});These show shape, not the current API surface. Confirm the exact package name, agent/client classes, and method/parameter names via MCP (below) — the SDK package name has shifted between releases, so do not assert it from memory.
Fetching facts
Look up exact, stale-prone details live (package name, class/method signatures, parameter and enum values, the current caps, page-range syntax, pricing):
mcp__plugin_llamacloud_docs__search_docs— concept/BM25 search.mcp__plugin_llamacloud_docs__read_doc— read a known doc page.mcp__plugin_llamacloud_docs__grep_docs— exact symbol/regex search.- Fallback: append
index.mdto anyhttps://developers.llamaindex.ai/...page URL and WebFetch it.
Anchor docs for this pillar:
https://developers.llamaindex.ai/llamaparse/extract/https://developers.llamaindex.ai/llamaparse/extract/guides/schema_design/https://developers.llamaindex.ai/llamaparse/extract/guides/options/
For exact, current SDK signatures, prefer the MCP over any snippet in this skill.
Boundaries
- Raw text / markdown extraction →
llamacloud-parse. - Retrieval / RAG over documents →
llamacloud-index. - API keys, regions, account setup → core
llamacloud.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

