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

# Working with AI

> AI nodes and agents for intelligent automation

Leverage AI nodes and agents to build intelligent, adaptive automation.

## AI Nodes

AI nodes provide specific AI capabilities within flows:

### Text Generation

Generate content, summaries, and responses:

**Use Cases:**

* Content creation
* Email drafting
* Report generation
* Text summarization

**Example:**

```
Input: Product description
  → Generate Text (create marketing copy)
  → Output: Compelling product description
```

### Structured Outputs

Extract structured data from text:

**Use Cases:**

* Form filling
* Data extraction
* Classification
* Entity recognition

**Example:**

```
Input: Customer email
  → Generate Fields (extract: name, email, issue, priority)
  → Output: Structured ticket data
```

### Vision & Multimodal

Process images and visual content:

**Use Cases:**

* Image analysis
* OCR and text extraction
* Chart interpretation
* Visual QA

**Example:**

```
Input: Invoice image
  → Interpret Image (extract line items)
  → Output: Structured invoice data
```

### Categorization

Classify content into categories:

**Use Cases:**

* Content routing
* Sentiment analysis
* Priority assignment
* Topic classification

**Example:**

```
Input: Support ticket
  → Categorizer (classify: Technical, Billing, General)
  → Route to appropriate team
```

***

## Agents in Flows

Use agents as nodes within flows for intelligent processing:

### Agent Node

Execute agent reasoning within a flow:

**Use Cases:**

* Multi-step reasoning
* Dynamic decision making
* Tool orchestration
* Context-aware processing

**Example:**

```
Customer Request
  → Agent (analyze request, gather info, determine solution)
  → Execute Solution Flow
  → Return Result
```

**Configuration:**

* Agent instructions
* Available tools
* Model selection
* Timeout settings

### When to Use Agents vs AI Nodes

<Tabs>
  <Tab title="Use AI Nodes When">
    * Single, specific AI operation
    * Structured, predictable task
    * No reasoning required
    * Fast execution needed
    * Cost-sensitive
  </Tab>

  <Tab title="Use Agents When">
    * Multi-step reasoning needed
    * Dynamic decision making
    * Tool use required
    * Context-aware processing
    * Complex problem solving
  </Tab>
</Tabs>

***

## Common Patterns

### Content Generation Pipeline

```mermaid theme={null}
graph LR
    A[Topic Input] --> B[Research Agent]
    B --> C[Generate Text]
    C --> D[Review & Edit]
    D --> E[Publish]
```

**Use Case:** Automated content creation with research and generation

### Intelligent Data Processing

```mermaid theme={null}
graph LR
    A[Raw Data] --> B[Agent Analyze]
    B --> C[Extract Fields]
    C --> D[Categorize]
    D --> E[Route to System]
```

**Use Case:** Process unstructured data with AI understanding

### Multi-Agent Collaboration

```mermaid theme={null}
graph LR
    A[Complex Task] --> B[Coordinator Agent]
    B --> C[Research Agent]
    B --> D[Data Agent]
    B --> E[Writer Agent]
    C --> F[Synthesize Results]
    D --> F
    E --> F
```

**Use Case:** Orchestrate multiple specialized agents for complex tasks

***

## Model Selection

### By Task Complexity

**Simple Tasks (GPT-3.5, Mistral):**

* Classification
* Simple extraction
* Template filling
* Basic summarization

**Moderate Tasks (GPT-4o, Claude Sonnet):**

* Content generation
* Analysis
* Multi-step reasoning
* General-purpose agents

**Complex Tasks (GPT-4, Claude Opus):**

* Deep reasoning
* Creative problem solving
* Complex analysis
* Critical decisions

### By Cost/Performance

**High Volume, Low Complexity:**

* Use faster, cheaper models
* Batch processing
* Simple prompts
* Minimal context

**Low Volume, High Complexity:**

* Use premium models
* Rich context
* Detailed instructions
* Multiple iterations

***

## Best Practices

**Prompt Engineering:**

* Be specific and clear
* Provide examples
* Set output format
* Include constraints

**Model Selection:**

* Match model to task complexity
* Test different models
* Monitor quality vs cost
* Optimize based on results

**Error Handling:**

* Validate AI outputs
* Implement fallbacks
* Log failures
* Retry with adjustments

**Cost Management:**

* Use appropriate models
* Set token limits
* Cache results
* Monitor spending

<CardGroup cols={2}>
  <Card title="Working with Documents" icon="file" href="/platform/scenarios/working-with-documents">
    Document processing scenarios
  </Card>

  <Card title="Agents in Flows" icon="bot" href="/platform/scenarios/agents-in-flows">
    Using agents within flows
  </Card>
</CardGroup>
