> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/platform-resources/skill-library/ai-skills/entity-recognition.md).

# Entity Recognition

**Entity Recognition** extracts predefined or custom entities from raw text using a configured recognizer. It turns a sentence a person typed into values a workflow can act on — names, dates, contact details, account numbers.

## How it works

* **Input resolution** — takes an `input` string. `$input` (the previous skill's output) and `$secret` can be used to construct that text or to supply credentials for the recognizer.
* **Processing** — sends the raw string and the selected `entityRecognizerId` to the backend recognizer, which applies:
  * **Standard entity patterns** — SSN, Phone Number, Email, Time, Date, Full Name, Zip Code, Address.
  * **Custom regex rules**, if configured on the recognizer.
* **Execution** — blocking. Waits for recognition to complete.
* **Response** — success returns a `result` array of matched entity strings; failure returns an error object and a status code.

## Worked example: extracting details from a free-text query

A customer types: *"My name is John Doe, and my email is <john.doe@example.com>; I need assistance with loan #L12345."* The workflow needs the name, the email, and the loan number.

**The problem.** Pulling specific values out of unstructured text by hand is tedious and error-prone — and customers don't write in your schema.

**The approach.** Point an Entity Recognition skill at the query text (`$input.customerQuery`), and let the recognizer do it.

* **Standard entities** cover the name and the email out of the box.
* **Custom regex** covers `#L12345`. Add a pattern to the recognizer with a name, the expression, and any flags — `i` for case-insensitive. The loan-number format is yours, so the rule has to be too.

**Configuration:**

```json
{
  "entityRecognizerId": "a6412cdc-664c-4795-b652-cd3d93659da3",
  "input": "John Doe works at Acme Corp in New York. His contact no is +91 9876543210.",
  "name": "Entity Recognition Test",
  "description": "This is a test of the Entity Recognition Skill"
}
```

**Output:**

```json
{
  "result": ["John Doe", "Acme Corp", "New York", "+91 9876543210"],
  "error": null,
  "statusCode": 200
}
```

<figure><img src="/files/hzxyQYnEJL9rNDUpBKR6" alt="" width="563"><figcaption><p>Entity Recognition processing flow</p></figcaption></figure>

## Configuration reference

| Field                | Type   | Required | Description                           |
| -------------------- | ------ | -------- | ------------------------------------- |
| `entityRecognizerId` | string | ✅        | The recognizer model to use.          |
| `input`              | string | ✅        | Raw text to scan for entities.        |
| `name`               | string | —        | Display name for this skill instance. |
| `description`        | string | —        | Description of this skill's purpose.  |

**Supported entities (default recognizer):** SSN, Phone Number, Email, Time, Date, Full Name, Zip Code, Address.

**Custom regex.** Add patterns to the recognizer's configuration for domain-specific extractions — tax IDs, application numbers. Each takes a name, a pattern, and flags.

## Output

The output port (`entityRecognitionResult`) always conforms to:

| Field        | Type           | Always | Description                            |
| ------------ | -------------- | ------ | -------------------------------------- |
| `result`     | string\[]      | ✅      | Matched entity strings from the input. |
| `error`      | object \| null | —      | Error object if recognition failed.    |
| `statusCode` | number         | ✅      | HTTP-like status code.                 |

**Failure — invalid `entityRecognizerId`:**

```json
{
  "result": null,
  "error": { "message": "Missing or invalid config, entityRecognizerId not provided" },
  "statusCode": 400
}
```

## Errors

| Code  | Message                          | Cause                                         |
| ----- | -------------------------------- | --------------------------------------------- |
| `400` | Missing or invalid config        | `entityRecognizerId` not provided or invalid. |
| `422` | Input text is empty or malformed | `input` is blank or not a valid string.       |
| `500` | Internal server error            | Unexpected recognizer failure.                |

## Security

* **Recognizer access tokens** — if `entityRecognizerId` points to an external or secured service, use `$secret` to inject credentials.
* **Log redaction** — logs redact raw input text and detected entity values.
* **Review your regex.** Custom patterns should be checked for [ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) vulnerabilities, which can degrade performance or take the service down. A regex you wrote in a hurry is running against text a stranger typed.
* **Extracted entities are often PII.** They're redacted in logs, but downstream skills receive them in the clear — mask with [PII Guard](/platform-resources/skill-library/ai-skills/pii-guard.md), encrypt, or store securely as your policy requires.

## Testing in isolation

* **Path** — `/skill-runtime/workflows/nodes/EntityRecognition/execute`
* **Method** — `POST`
* **Body:**

```json
{
  "config": { "entityRecognizerId": "your-recognizer-id", "input": "Text to scan for entities." },
  "input": {}
}
```

***

To add this skill to an agent, see [Adding a Skill to the Agent](/agent-builder/build/adding-a-skill-to-the-agent.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.uptiq.ai/platform-resources/skill-library/ai-skills/entity-recognition.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
