|
2 | 2 | sidebar_label: Overview |
3 | 3 | sidebar_position: 1 |
4 | 4 | title: AI Documents |
5 | | -description: Document upload, text extraction, embedding, and RAG capabilities for AI Chat Interactions and AI Profiles. |
| 5 | +description: Document upload, text extraction, embedding, and RAG capabilities for AI Chat Interactions, AI Profiles, and AI Chat Sessions. |
6 | 6 | --- |
7 | 7 |
|
8 | 8 | | | | |
@@ -34,6 +34,7 @@ The base feature (`CrestApps.OrchardCore.AI.Documents`) provides the shared infr |
34 | 34 | |---------|-----|-------------| |
35 | 35 | | **AI Documents for Chat Interactions** | `CrestApps.OrchardCore.AI.Documents.ChatInteractions` | Provides document upload and Retrieval-Augmented Generation (RAG) support for AI Chat Interactions. | |
36 | 36 | | **AI Documents for Profiles** | `CrestApps.OrchardCore.AI.Documents.Profiles` | Provides document upload and Retrieval-Augmented Generation (RAG) support for AI Profiles. | |
| 37 | +| **AI Documents for Chat Sessions** | `CrestApps.OrchardCore.AI.Documents.ChatSessions` | Provides document upload and RAG support for AI Chat Sessions and AI Chat Widgets. | |
37 | 38 |
|
38 | 39 | ## AI Documents for Chat Interactions |
39 | 40 |
|
@@ -70,13 +71,6 @@ The orchestrator supports various document-related operations: |
70 | 71 | - **Content Transformation** — Provides content for reformatting or conversion |
71 | 72 | - **General Reference** — Provides context when asking general questions that reference documents |
72 | 73 |
|
73 | | -### API Endpoints |
74 | | - |
75 | | -| Endpoint | Method | Description | |
76 | | -|----------|--------|-------------| |
77 | | -| `/ai/chat-interactions/upload-document` | POST | Upload one or more documents to a chat interaction | |
78 | | -| `/ai/chat-interactions/remove-document` | POST | Remove a document from a chat interaction | |
79 | | - |
80 | 74 | ### Getting Started |
81 | 75 |
|
82 | 76 | 1. **Set up an indexing provider**: Enable Elasticsearch or Azure AI Search in the Orchard Core admin. |
@@ -142,6 +136,56 @@ There are no separate API endpoints for profile document management — everythi |
142 | 136 | 3. Use the **Documents** tab to upload text-based documents. |
143 | 137 | 4. Configure the **Top N Results** setting to control how many matching chunks are included as context. |
144 | 138 |
|
| 139 | +## AI Documents for Chat Sessions |
| 140 | + |
| 141 | +| | | |
| 142 | +| --- | --- | |
| 143 | +| **Feature Name** | AI Documents for Chat Sessions | |
| 144 | +| **Feature ID** | `CrestApps.OrchardCore.AI.Documents.ChatSessions` | |
| 145 | + |
| 146 | +Provides document upload and Retrieval-Augmented Generation (RAG) support directly within AI Chat Sessions and AI Chat Widgets (both admin and frontend). |
| 147 | + |
| 148 | +When enabled, users can attach documents to any chat session via drag-and-drop or file browser. Documents are indexed using the same shared infrastructure (text extraction, chunking, embedding, and vector search) used by Chat Interactions and Profiles. |
| 149 | + |
| 150 | +Unlike profile documents (which persist across all sessions), chat session documents are **scoped to the individual session** — similar to chat interaction documents. |
| 151 | + |
| 152 | +### Key Capabilities |
| 153 | + |
| 154 | +- **Document Upload**: Drag-and-drop or browse to attach files directly in the chat input area |
| 155 | +- **Visual Attach Button**: A persistent "Attach files" button appears above the chat input when enabled |
| 156 | +- **Document Pills**: Attached documents are shown as compact pill badges with remove (X) buttons |
| 157 | +- **Drag-and-Drop Highlight**: The input area highlights when files are dragged over it |
| 158 | +- **Text Extraction & Embedding**: Uploaded documents are automatically extracted, chunked, and embedded for vector search |
| 159 | +- **RAG Integration**: Relevant chunks are retrieved and used as context for AI responses |
| 160 | +- **Per-Profile Opt-In**: Each AI Profile has an **Allow Documents & Attachments** checkbox (unchecked by default) to control whether document upload is available |
| 161 | + |
| 162 | +### Per-Profile Opt-In |
| 163 | + |
| 164 | +Because document processing is resource-intensive, document upload is **not enabled by default** even when the feature is active. Administrators must explicitly opt in for each AI Profile: |
| 165 | + |
| 166 | +1. Navigate to **Artificial Intelligence > AI Profiles** and edit a profile. |
| 167 | +2. In the **Documents** section, check **Allow Documents & Attachments**. |
| 168 | +3. Save the profile. |
| 169 | + |
| 170 | +For **AI Chat Widget** content items, the same checkbox appears on the widget editor under the AI profile part settings. |
| 171 | + |
| 172 | +### Supported UIs |
| 173 | + |
| 174 | +| UI | Where | Notes | |
| 175 | +|----|-------|-------| |
| 176 | +| **AI Chat Session** | Admin > Artificial Intelligence > AI Chat | Full session page | |
| 177 | +| **AI Chat Admin Widget** | Floating admin widget | Compact chat widget on admin pages | |
| 178 | +| **AI Chat Widget** | Frontend content widget | Public-facing chat widget | |
| 179 | + |
| 180 | +### Getting Started |
| 181 | + |
| 182 | +1. **Set up an indexing provider**: Enable Elasticsearch or Azure AI Search in the Orchard Core admin. |
| 183 | +2. **Create an index**: Navigate to **Search > Indexing** and create a new index (e.g., "ChatDocuments"). |
| 184 | +3. **Configure settings**: Navigate to **Settings > Chat Interaction** and select your new index. |
| 185 | +4. **Enable the feature**: Enable `AI Documents for Chat Sessions` in the admin dashboard. |
| 186 | +5. **Opt in per profile**: Edit the desired AI Profile and check **Allow Documents & Attachments**. |
| 187 | +6. Open a chat session — the attach button and drag-and-drop zone are now available. |
| 188 | + |
145 | 189 | ## Supported Document Formats |
146 | 190 |
|
147 | 191 | | Format | Extension | Notes | |
|
0 commit comments