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

# AI agents overview

> Async AI agents for code research, medical necessity, and denial resolution

RCIntel has three AI agents. They are not a separate product — they are async jobs on the same API key as the rest of the knowledge layer. Use them when a lookup is not enough and you need researched coding, necessity, or appeal guidance.

## Agent types

| Agent                 | Endpoint                            | Purpose                                      |
| --------------------- | ----------------------------------- | -------------------------------------------- |
| **Code Research**     | `POST /v1/agents/code-research`     | Research CPT, HCPCS, and ICD-10 codes        |
| **Medical Necessity** | `POST /v1/agents/medical-necessity` | Validate medical necessity for procedures    |
| **Denial Resolution** | `POST /v1/agents/denial-resolution` | Resolve claim denials with appeal strategies |

For cited policy text, 340B access, prior auth, and fee schedules, use the REST lookups — not agents. See [Which API to use](/docs/api-map).

## How it works

Agent endpoints are asynchronous. When you submit a job:

1. **Submit** — `POST` to the agent endpoint with your query
2. **Accept** — API returns `202 Accepted` with a `job_id`
3. **Poll** — `GET /v1/agents/jobs/{job_id}` until `status` is `completed` or `failed`, or pass `callback_url` + `callback_secret` on submit ([Agent callbacks](/docs/webhooks))
4. **Result** — The completed job includes the agent's structured output
5. **Trace** — `GET /v1/agents/jobs/{job_id}/trace` for the full reasoning trace

```bash theme={null}
# Submit
curl -X POST https://api-dev.rcintell.com/v1/agents/code-research \
  -H "X-API-Key: kp_test_..." \
  -H "Content-Type: application/json" \
  -d '{"query": "What CPT for total knee replacement?", "ccn": "170001"}'

# Returns: {"job_id": "abc-123", "status": "pending", ...}

# Poll
curl https://api-dev.rcintell.com/v1/agents/jobs/abc-123 \
  -H "X-API-Key: kp_test_..."

# Returns: {"job_id": "abc-123", "status": "completed", "result": {...}, ...}
```

## Knowledge enrichment

When you include a `ccn` in your agent request, the agent automatically receives the full L1-L6 knowledge context for that facility. This means the agent knows:

* The facility's location and GPCI values
* The applicable payment system and billing form
* Payer-specific rules and filing deadlines
* Expected payment for the procedure
