> ## Documentation Index
> Fetch the complete documentation index at: https://docs.file.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Extraction prompts

> Best practices for writing effective prompts to extract structured data in fileAI

### **1. Be Explicit and Specific**

* Instead of "Extract important details", use "Extract the invoice\_number, total\_amount, and due\_date from the text."

### **2. Match Field Names Exactly**

* Use field names as defined in your schema, e.g., customer\_name, not name or client.

### **3. Use Clear Instructions**

* Example: "Extract the delivery\_status\_enum as one of: shipped, pending, delayed."

### **4. Set Expectations for Format**

* For dates: "Extract received\_date in the format YYYY-MM-DDTHH:MM:SSZ."
* For yes/no: "Is the payment confirmed? Respond with true or false."

### **5. Provide Context When Necessary**

* If the field is ambiguous, clarify in the prompt
* Example:"Extract the contract\_date\_time (the date the contract was signed, not created)."

### **6. Use Examples (if supported)**

* If your system supports few-shot prompting, include examples of expected input/output.
