AI Tool
Apply LLM Logic to columns
The AI Tool lets you apply LLM reasoning to dynamically generate or transform data within your Phacet columns.
It interprets natural language instructions to automate tasks such as:
- Extracting structured data: Pull specific fields from contracts, invoices, or regulatory documents.
- Classifying and tagging content: Categorize customer emails, GDPR requests, or investment memos automatically.
- Generating tailored content: Create concise product descriptions, summaries, or reports from longer texts.
- Matching and validating data: Automatically compare invoice line items against contract prices, highlighting matches or discrepancies clearly.
AI Tool and column types
The AI Tool works with Text, Single Select, Multi Select, and JSON columns, automatically adapting its output format to match your column settings.
- Single Select / Multi Select: AI identifies tags from your predefined list.
- Text: AI generates free-form or structured text.
- JSON: AI outputs structured JSON adhering to your defined JSON schema. Include detailed descriptions in the schema for clearer results
Use Other Columns as Context
The AI Tool can take any other column in the same row as input for its reasoning. To do so, reference the column using the @
symbol followed by the column name
This allows the AI to dynamically use row-specific data when generating outputs.
Example
Categorize the request in @request_text as one of the predefined GDPR types
#request_text being the title of a column
The AI Tool will only take the value of the specified column as an input. If additional context or data type specificity is needed, you can add a short description directly in the prompt to help the model interpret it more accurately.
Example
You are an expert GDPR administrator in charge of categorizing incoming client requests. The user request email can be found in @request\_text, I want you to categorize is as one of the predefined GDPR request category.
How to Set Up the AI Tool
To use the AI Tool, you first need to configure it at the column level.
The steps below guide you through setting it up depending on your output format.
Step 1 – Add a Column
- Click on “+ Add Column”
- Choose the desired Column Type — Text, JSON, Single Select, or Multi Select
- Under Tool, select AI (LLM)
Each column type determines the format the AI Tool will generate:
- For Text, it will return freeform or guided text
- For Single Select / Multi Select, it will automatically map the output to the available options
- For JSON, it will return a structured object matching the defined schema
Step 2 – Write Instructions
In the Instructions field, describe clearly what the AI Tool should do. Reference other columns content to give context.
Examples prompts by column type:
Single Select:
Categorize this incoming GDPR request (@RequestText) by type of request.
The AI Tool will automatically select an option amongst the list available in the Column parameters
Text:
Write a product article description based on the product reference in @ProductText.
Follow these guidelines: focus on key features, stay under 500 characters, and use an engaging tone.
JSON
Extract the company name, contract amount, and expiration date from @ContractDocument, structured according to the JSON Schema.
For JSON, the JSON schema is automatically passed to the model. There's no need to include format instructions in your prompt — focus instead on clarifying the extraction objective. For more on this, see the JSON Column article.
Step 3 – Generate Values
Once your prompt is written:
- Click Generate Values
- The tool will apply the instructions row by row using the referenced data
Tip : You can always adjust your prompt and regenerate to iterate on the output quality.
Matching Data with the AI Tool
You can leverage the AI Tool to automatically match or reconcile data across columns or external references.
How Matching Works:
- Use the AI tool to compare values dynamically between columns.
- The AI evaluates similarity, identifies discrepancies, and classifies outcomes clearly.
Example Prompt for Matching
To match invoice data with negotiated contract terms:
text
Compare billed prices in @InvoiceData with negotiated prices listed in @ContractPricing.
For each line item, return "Match" if prices align or "Mismatch" if discrepancies exist, along with a short explanation for mismatches.
Recommended Matching Workflow
- Set clear matching criteria: Clearly specify what constitutes a "Match" or "Mismatch" in your instructions.
- Limit complexity at first: Start matching with smaller datasets or simpler prompts, refine accuracy, then scale.
- Structure clear outputs: Prefer JSON columns to clearly display matched results and discrepancy reasons.
Practical Use Cases:
- Invoice reconciliation: Ensure invoices match contracted pricing terms.
- Transaction matching: Verify transactions against account statements.
- Data validation: Check imported data against reference datasets.
Tactical Tips
- Iterative prompting:
- Start testing your prompt on a limited number of rows. Refine instructions and validate accuracy before scaling up to more volume.
- This approach will allow you to optimize credit usage while testing your prompt accuracy.
- Credit management:
- Combine multiple data fields into a single AI prompt if possible, as fewer requests generally consume fewer credits.
- By using JSON as an output, you can then retrieve individual data by using simple Python functions (see how here)
Advanced Prompt Engineering
Using ChatGPT to Improve Your Prompts
If you're unsure how to phrase your instructions, you can use ChatGPT as a sparring partner to improve prompt clarity and structure.
This approach, called reverse prompting, helps you design instructions that get more consistent and accurate results from the AI Tool.
Ask ChatGPT to play the role of a prompt engineer
Example
You are a prompt engineer specialized in document extraction for business operations.
I want to extract structured data from invoice files in an AI Agent tool.
The input is an invoice PDF, referenced in @InvoiceFile. The expected output is a JSON object with the following fields: invoice_number, date, vendor_name, line_items (with product, quantity, price). Help me write a clear prompt I can use in the AI Tool.
Example template to use in ChatGPT
You are a [ROLE] specialized in [DOMAIN]. I’m building a prompt to be used in an AI tool that generates structured data from row-level content in a workspace.
Your task: create a precise, reliable prompt that will guide the AI to perform the following task.
Here’s the context:
- **Input Data**: @[INPUT_COLUMN] (this contains [describe content briefly])
- **Goal**: [TASK_DESCRIPTION]
- **Expected Output Format**: [OUTPUT_FORMAT]
- **Additional Requirements**: [FIELD_1], [FIELD_2], [GUIDELINES] (optional)
- **Constraints to Avoid**: [WARNING_1], [WARNING_2] (optional)
Please output a prompt that:
- Is written in natural language
- Includes all key instructions
- Uses references like `@ColumnName` where needed
Optimal Prompt Structure:
Follow this structure for clear, effective prompting:
- Goal: Clearly define the task.
- Return Format: Explicitly state the desired output structure.
- Warnings: Mention critical instructions or common pitfalls.
- Context Dump: Provide additional relevant context to guide AI responses accurately.
Applying this structured approach improves accuracy and reduces the need for iterative prompting.
AI Tool or Python Tool — which one should you use?
Depending on your objective, one tool may be more suitable than the other.
Use the AI Tool when you want to apply language based reasoning :
- Extract, summarize, or rewrite content using natural language
- Automatically categorize inputs based on semantic understanding
- Generate structured data (like JSON) from freeform text or documents
Use the Python Tool when you need:
- Strict, rule-based logic that must be repeatable
- Custom calculations or comparisons between values
- Full control over formatting, conditions, or validation logic
Tip: You can also combine both tools in your workflow — for instance, extract structured data with AI, and then refine or validate the results using Python code in a secondary column.
Learn how to use the Python tool effectively by reading the Python Tool Guide
Updated 18 days ago