Free cookie consent management tool by TermsFeed

AI Skills Best Practices & Recipes

On This Page

Overview

With Appian, AI provides practical value for your business processes. AI helps companies make decisions, save and spend money, serve customers, and scale business operations. To help you reach this value faster, we've assembled guidance to help you get started effectively.

This page provides best practices for using AI in Appian, as well as recipes to help guide specific implementations.

Best practices

Tip:  See DocCenter prompt engineering best practices for detailed guidance on extraction-specific techniques.

Write an effective prompt

In the context of AI, a prompt is how we communicate with the large language model (LLM) about what we want it to do. A well crafted prompt can help you communicate with the model more effectively, and reduce the amount of time you spend tweaking or troubleshooting.

Crafting a good prompt can improve:

  • precision and relevance of the model output.
  • efficiency by getting the desired response in one question.
  • safety by excluding undesired output.
  • customization with our own relevant data.

If you're looking to build a prompt from scratch, you might want to consider the following aspects:

  • Define your use case: What do you want the model to do? This is your use case. It can also be helpful to think of edge cases. Essentially, what do you want the model to not do? Writing these requirements and expectations in your prompt helps the model understand its purpose.
  • Tell the model what input to expect (defining the input data): If the prompt will always include content for a certain type or format, it may be helpful to tell the model this in the prompt. For example, "I want you to summarize this email text and provide a suggested response."
  • Tell the model what output you want (defining the output data): LLMs are not deterministic, so it is possible that the model won't always return data in the structure you specify. However, you can be specific about what you want the model to return. For example, you can tell the model you want the response to be in JSON, HTML, a bulleted list, or any other format. You can also tell the model to include its response between tags, to help keep the answer more focused.
  • Gather examples: You'll want to provide examples to help the model produce the answers you're looking for. Examples help provide the model with context, so it will produce output that's more specific to your request.
  • Consider length, tone, and audience: Another thing to consider when specifying the output is how it will be used and who will see it. Does it need to be a certain length, perhaps 3 paragraphs? Should it be written for a certain audience, such as customers? If you help define the context for the model, you'll get results that are more in-line with what you need.
  • Remember AI actions: The model can process a set number of AI actions, or units of analysis. The model will process your prompt and the input data. Keep this in mind when you craft the prompt, because the longer the prompt is, the smaller the input can be.

Tip:  Put the most important part of your prompt (such as output format or a specific question to answer) at the end of your prompt so the model is clear on what your ultimate request is. This guideline works with techniques like asking the model to "think step by step" - the model can reason through the problem first, then apply your final output requirements.

Prompt formatting tips

As you work with generative AI skills, you may notice that formatting your prompt in certain ways helps generate more accurate or consistent responses. If you're experimenting with writing a prompt, here are a few suggestions to try.

Each guideline is applied to an example prompt for this scenario: You work at NexGen, a distribution company that runs order fulfillment centers. You use Appian to automate order submission workflows across several teams with the Order Fulfillment (OF) app. You're building an AI skill to extract information from contracts.

Use XML tags

Like other pieces of code or programs, AI models are highly structured and logical. You can make your prompt easier for the model to interpret by structuring it with XML tags. For example, you can surround parts of the prompt with tags to show the model what elements are found there:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <Task> 
  You need to find contract agreement entities from the input information.

  <Context> 
  Here are the entities you need to return:
  contractorName (Contractor Name):
  contractorAddress (Contractor Address):
  contractorContractSigner (Contractor Contract Signer):
  clientName (Client Name):
  clientAddress (Client Address):
  clientContract Signer (Client Contract Signer):
  effectiveDate (Effective Date):
  servicesProvided (Services Provided): 
  fees (Fees - only the currency & numerical value): 
  paymentTerms (Payment Terms): 
  severabilityClauseExists (Severability Clause exists, yes or no):
  </Context>
  </Task>

  <Instructions>
  1) Your output will be json format
  2) Only output the entities listed in the context section
  </Instructions>

Assign roles

Remember that the AI model only has the context you provide it. So if you want the response to be appropriate for a certain person, or use the expertise of a certain profession, you could include that in the prompt. You could add the following to the top of the prompt:

1
2
3
  <Role> 
  You are an expert at sifting through large amounts of information and finding the entities of interest.
  </Role>

Prefill the model's response

Prefilling is a technique used to tell the model how its response should start. This is especially useful when prompting the model to return a certain structure, like JSON. When prompting the model for a JSON list, add Assistant: [{ and when prompting for a single JSON object, add Assistant: {. These formats are in addition to the description you provide in plain language. If we apply this guidance to the prompt above, it might look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  <Task> 
  You need to find contract agreement entities from the input information.

  <Context> 
  Here are the entities you need to return:
  contractorName (Contractor Name):
  contractorAddress (Contractor Address):
  contractorContractSigner (Contractor Contract Signer):
  clientName (Client Name):
  clientAddress (Client Address):
  clientContract Signer (Client Contract Signer):
  effectiveDate (Effective Date):
  servicesProvided (Services Provided): 
  fees (Fees - only the currency & numerical value): 
  paymentTerms (Payment Terms): 
  severabilityClauseExists (Severability Clause exists, yes or no):
  </Context>
  </Task>

  <Instructions>
  1) Your output will be json format
  2) Only output the entities listed in the context section
  </Instructions>

  Assistant: {

Ask the model to show its thinking

If your prompt is returning unexpected results, you can try to identify the issue by instructing the model to show how it arrived at that result. You can add an instruction such as "Tell me step-by-step how you arrive at the answer." The output should include detailed steps about the logic the model used, which can help you determine the point at which it starts to stray from the response you're seeking. You can then update the prompt to help clarify that part.

Ask the model to cite its sources

If you see any results that you aren't confident are correct, you might find it useful to ask the model to cite the sources (such as a page number or paragraph number) it used to generate the response.

Understand AI actions

Every time an Appian AI feature executes—whether it's an AI agent completing a multi-step task, an AI skill extracting data, or smart search indexing a document—it consumes a certain number of AI actions.

An AI action is the unit of measure used to track and charge for the execution of Appian's AI features within your applications. Appian uses this simple, flexible, and predictable consumption-based model for using all of Appian's AI features.

You can monitor per-execution AI Action consumption in the AI usage log and view aggregate consumption on the MyAppian Adoption tab. To estimate AI Action usage before deployment, see Estimating AI Action Usage.

Choose a document extraction method

When you extract data from documents, you can choose from different AI skills based on your document structure and extraction goals. Each AI skill is designed to handle specific scenarios and can be used individually or together for more accurate results.

This section explains the difference between Appian's two main document processing options and provides patterns to help you decide which is best for your use case.

Tip:  Get started with document extraction quickly and easily with DocCenter!

  • Advanced IDP Skill is a high-precision document recognition engine. It excels at identifying the text, layout, and visual elements in a document.
  • Generative AI Skill is a reasoning engine. It excels at understanding the context of the text to answer questions and extract information.

When you create a document extraction model in DocCenter you can combine these AI skills by selecting the Advanced Layout option.

How Advanced IDP and Generative AI skills differ

Think of the Advanced IDP Tools skill as the tool that reads the document and the Generative AI skill as the tool that understands it.

When you send a document directly to a generative AI skill as a Text only document type, Appian performs a standard optical character recognition (OCR) step to read the text. For more complex documents, you can use the Advanced IDP skill first to perform a more detailed reading of the document's structure and content, then send that detailed map to the Generative AI skill for a more accurate analysis.

The table below summarizes the key differences.

Feature Advanced IDP skill (The "Reader") Generative AI skill (The "Thinker")
Primary Job To perform high-precision OCR, converting a document image into structured text and layout data. To understand, reason about, and generate content based on text input.
Strengths Positional Awareness: Knows the exact coordinates of every word. Required for highlighting extracted data, detecting signatures, and extracting data from fixed forms. Contextual Understanding: Can interpret nuanced language, infer meaning, and follow complex instructions to extract data from unstructured paragraphs.
Output A structured map of located text, tables, and form elements with confidence scores. New, generated text, typically in a structured JSON format as requested in the prompt.

Choosing the right pattern for document extraction

Your document's complexity and your business needs determine the best way to configure document extraction. This section describes three common patterns.

Use only Generative AI skill

This approach is best for simple, text-heavy documents where the visual layout is not important. By passing the document directly to the Execute Generative AI Skill smart service, you can choose between two document processing modes:

  • Text only: Use this mode when your document contains only text content. This mode uses built-in OCR to retrieve the text and supports up to 100 pages.
  • Visual elements & text: Use this mode when your document contains visual elements like checkboxes, charts, images, or handwritten annotations that you need to extract. For Claude 4+ and Nova 2 Lite models, this mode also supports up to 100 pages.

Choose the mode based on your document's content type, not page count. If your document has visual elements you need to extract, use "Visual elements & text" mode. If it's text-only, use "Text only" mode for faster processing.

Use this pattern for documents like:

  • Emails
  • Transcripts
  • Simple letters

Use only Advanced IDP Tools skill

For some use cases, you don't need the Generative AI skill's reasoning capabilities. The Advanced IDP Tools skill is effective on its own for tasks that depend on a document's structure. To use this pattern, create an Advanced IDP Tools AI Skill and call it using the Advanced IDP Tools smart service in a process model.

Use this pattern to:

  • Index documents for search: Use the Text tool to extract all content from a set of documents and write it to a database field that is enabled for smart search.
  • Verify signatures or checkboxes: Use the Signatures or Checkboxes tool to confirm if a document is signed or which options are selected.
  • Extract from fixed forms: For highly structured documents that never change like certain government forms.
  • Leverage Confidence Scores: Use the confidence scores returned by the AI skill to support automated decisions, such as straight-through processing, when the score exceeds a defined threshold.

Use Advanced IDP Tools skill with Generative AI skill

This is the most robust pattern, designed for complex or semi-structured documents where you need both high-precision OCR and intelligent reasoning. To use this pattern, select Advanced Layout when you configure your document extraction model in AI Document Center.

Use this pattern for documents like:

  • Invoices with varying formats
  • Complex contracts
  • Utility bills
How it works

When you use the Advanced Layout option, the extraction process happens in two steps:

  1. Advanced IDP Tools skill scans the document to create a detailed, structured map of all its content, including checkboxes, tables, and signatures. Appian then automatically formats this map into a clearly structured phrase that AI can understand more easily.
  2. Generative AI skill receives the formatted text from the first step. Your prompt then guides the model to reason over this high-quality text to find and extract the data you need.
Highlighting extracted data

When you enable the Bounding option in a document extraction model, Appian uses the x- and y-coordinate data from the Advanced IDP Tools skill. This allows you to show users exactly where on the page each piece of data was found on the reconciliation task interface.

AI action usage consideration

This combined pattern provides the highest accuracy but also uses more AI actions than other patterns. Converting the detailed structural data from the Advanced IDP Tools skill into a formatted text string can result in a large input for the generative AI skill. However, the improved accuracy often outweighs the additional AI action cost.

Note:  If you're using plug-ins to convert documents from one format to another, refer to that plug-in's documentation in its AppMarket listing for more information.

Recipes

Feedback