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

# Using AI agents

> Learn how to integrate and interact with AI agents in your FlowX.AI applications.

Once you've built or configured an AI agent, there are multiple ways to use it in your applications. This guide covers the different integration patterns available.

## Integration options

<CardGroup cols={2}>
  <Card title="Chat interface" icon="comments" href="./chat-interface">
    Add conversational AI to your apps with the Chat component
  </Card>

  <Card title="BPMN integration" icon="diagram-project" href="./bpmn-integration">
    Trigger agents from workflow nodes
  </Card>

  <Card title="REST API" icon="code" href="/5.9/docs/api/process-api">
    Call agents programmatically via API
  </Card>

  <Card title="Custom Agent Node" icon="robot" href="/5.9/docs/platform-deep-dive/integrations/custom-agent-node">
    Use agents within Integration Designer workflows
  </Card>
</CardGroup>

## Choosing an integration method

| Method                | Best for                                             | User interaction        |
| --------------------- | ---------------------------------------------------- | ----------------------- |
| **Chat interface**    | Conversational experiences, Q\&A, guided assistance  | Direct user interaction |
| **BPMN integration**  | Automated processing, document handling, decisions   | Background processing   |
| **REST API**          | External systems, custom frontends, batch processing | Programmatic access     |
| **Custom Agent Node** | Complex integrations, multi-step workflows           | Workflow orchestration  |

## Common patterns

### Pattern 1: Conversational assistant

Add a chat interface to help users complete complex tasks with AI guidance.

```
User opens app → Chat component loads → User asks questions →
Agent responds → User completes task with guidance
```

**Use cases:** Customer support, employee helpdesk, guided form completion

### Pattern 2: Document processing

Automatically process documents submitted through your application.

```
User uploads document → BPMN triggers agent → Agent extracts data →
Data validated → Process continues with extracted data
```

**Use cases:** Loan applications, claims processing, onboarding

### Pattern 3: Decision support

Provide AI-powered recommendations within business processes.

```
Process reaches decision point → Agent analyzes data →
Recommendation generated → Human reviews and approves/rejects
```

**Use cases:** Credit decisions, risk assessment, fraud detection

### Pattern 4: Content generation

Generate documents, reports, or communications automatically.

```
Process collects data → Agent generates content →
Content reviewed → Document sent/stored
```

**Use cases:** Reports, notifications, contracts, summaries

## Session management

AI agents maintain conversation context through sessions:

| Concept         | Description                                  |
| --------------- | -------------------------------------------- |
| **Session**     | A conversation thread between user and agent |
| **Context**     | Data and history available to the agent      |
| **Persistence** | Sessions can be saved and resumed            |
| **Isolation**   | Each user/process has separate sessions      |

<Info>
  Sessions are automatically managed when using the Chat component. For BPMN and API integrations, you control session lifecycle explicitly.
</Info>

## Data flow

When using agents, data flows through several stages:

<Steps>
  <Step title="Input preparation">
    User input, documents, or process data is formatted for the agent
  </Step>

  <Step title="Agent processing">
    The agent processes input using configured workflows and AI models
  </Step>

  <Step title="Response generation">
    Agent produces output: text, structured data, or actions
  </Step>

  <Step title="Result handling">
    Output is displayed to user, stored, or used to continue the process
  </Step>
</Steps>

## Knowledge bases

Agents can access knowledge bases for context-aware responses:

* **Custom knowledge bases** - Your uploaded documents and data
* **External sources** - Connected via MCP integrations

<Card title="Knowledge Base integration" icon="database" href="/5.9/docs/platform-deep-dive/integrations/knowledge-base-integration/knowledge-base-overview">
  Learn how to connect knowledge bases to your agents
</Card>

## Best practices

<AccordionGroup>
  <Accordion title="Start with clear use cases" icon="bullseye">
    Define specific tasks for your agent rather than general-purpose capabilities. Focused agents perform better.
  </Accordion>

  <Accordion title="Provide sufficient context" icon="info">
    Include relevant process data when calling agents. More context leads to better responses.
  </Accordion>

  <Accordion title="Handle errors gracefully" icon="triangle-exclamation">
    Always include fallback paths for when agents fail or return low-confidence results.
  </Accordion>

  <Accordion title="Monitor and iterate" icon="chart-line">
    Track agent performance and user feedback. Continuously improve prompts and workflows.
  </Accordion>
</AccordionGroup>

## Related resources

<CardGroup cols={2}>
  <Card title="Chat interface" icon="comments" href="./chat-interface">
    Conversational AI integration
  </Card>

  <Card title="BPMN integration" icon="diagram-project" href="./bpmn-integration">
    Workflow-based agent usage
  </Card>

  <Card title="Agent Builder" icon="robot" href="../agent-builder/overview">
    Create custom agents
  </Card>

  <Card title="Config-time agents" icon="pencil-ruler" href="../pre-built-agents/overview">
    Design-time AI assistants
  </Card>
</CardGroup>
