# AI Access Image

The Assess Image stage uses AI to generate a summary or description of an image. It helps you understand the content or context of the image — such as what’s visible, the type of document, or key elements

<img src="https://531923687-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnhvnNmu6p9CSODwQTjgf%2Fuploads%2F4k6rOuPl7Cj1GWvUk1yY%2F0.png?alt=media" alt="" width="563">

### **AI Assess Image**

**What is the Assess Image Stage?**

The Assess Image stage enables AI-powered image analysis within a workflow. It can:

* Detect objects
* Classify images
* Evaluate image content or quality
* Identify patterns or document types

**Important:**\
The Assess Image stage can only be used under a For Each stage, as it requires record-level context for accessing image fields.

**Why Use Assess Image Under For Each?**

When you have a list of image records (e.g., invoices, ID cards, documents) and need to analyze each image individually, place the Assess Image stage inside a For Each loop to:

* Loop through each record
* Access image fields (e.g., ${ForEachRepository:Image})
* Run AI analysis on each image
* Store the output for further processing

**Step-by-Step Configuration**

**Step 1: For Each Stage**

* **Source:** Select the repository that contains the image records (e.g., *Candidate Documents*).
* This will loop through each record in the repository.
* Fields from each record will be available using ${ForEachRepository:FieldName} syntax.

**Step 2: Add Assess Image Stage Inside For Each**

* **Field Selection:** Choose an attachment/image field from the For Each Repository Record (e.g., *ID Proof Image*).
* **Prompt:** Write a clear instruction to guide AI.

**Prompt Examples:**

* “Summarize what is visible in this image.”
* “Identify the type of document shown (e.g., ID card, invoice, receipt).”
* “Describe the background and objects in this image.”
* “Is this image a selfie with a document? Provide reasoning.”
* “Check if the image contains any official seal or stamp.”
* “Verify whether this Aadhaar card is front or back side.”
* “Check if the uploaded Aadhaar card contains a visible Aadhaar number.”

**Output Variable:** Store the AI result in a variable (e.g., Variable:AnalyseText).

**Step 3: Add Next Steps After Image Analysis**

You can now act based on the output:

* Add a Condition stage to evaluate the AI response.\
  Example:\
  Check if ${Variable:AnalyseText} contains "Government of India"
* Add an Update Record stage to store the analysis back into the repository.

**Output Example**

* Input Image: An uploaded Aadhaar card scan
* Prompt: “Verify whether this Aadhaar card is front or back side.”
* Output Variable: CardSideInfo


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aiflo.app/ai-stages/ai-access-image.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
