# Cortex AI Functions

Snowflake Cortex AI Functions skills bundle for text, image, & document analytics.

## Taxonomy

The `cortex-ai-functions` skills exosystem consists of a main problem-to-solution router for intention detections (either atomic function(s) or custom workflow(s)), elevated high-level refs/ with curated functions docs, and nested purpose-built workflows with their own decomposed refs/ for clarifying nuances.

```
cortex-ai-functions/
├── SKILL.md                          # Main routing skill
├── README.md                         # For humans.. ;)
├── references/                       # AI Functions docs & tips
│   ├── ai-classify.md
│   ├── ai-complete.md
│   ├── ai-extract.md
│   ├── ai-filter.md
│   ├── ai-parse-doc.md
│   └── ai-summ-agg.md
└── document-intelligence/            # Document intelligence workflows
    ├── SKILL.md                      # Document intelligence routing skill
    ├── README.md
    └── references/
        ├── document_classification.md
        ├── extraction.md
        ├── parsing.md
        ├── pipeline.md
        └── visual-analysis.md
```

### Functions (atomic)

| Function | Category | Input | Output | Use Case |
|----------|----------|-------|--------|----------|
| **AI_CLASSIFY** | Classification | text/image | label(s) | Categorize, tag, route tickets, sentiment |
| **AI_FILTER** | Filtering | text/image | boolean | Yes/no conditions, semantic joins |
| **AI_EXTRACT** | Extraction | text/file | JSON object | Structured fields from documents |
| **AI_PARSE_DOCUMENT** | Parsing | file | markdown/text | Full document OCR, layout preservation |
| **AI_AGG** | Aggregation | text column | summary | Custom multi-row aggregation |
| **AI_SUMMARIZE_AGG** | Aggregation | text column | summary | General-purpose summarization |
| **AI_COMPLETE** | Generation | prompt/image | text/JSON | Custom LLM tasks, vision analysis |

### Workflows -- nested sub-skills

| Workflow | Description | Route |
|----------|-------------|-------|
| Document Classification | Classify/categorize/triage documents by type | `document-intelligence/references/document_classification.md` |
| Extraction | Structured field and table extraction using AI_EXTRACT | `document-intelligence/references/extraction.md` |
| Parsing | Full text extraction and OCR using AI_PARSE_DOCUMENT | `document-intelligence/references/parsing.md` |
| Visual Analysis | Chart, diagram, and blueprint analysis using AI_COMPLETE vision | `document-intelligence/references/visual-analysis.md` |
