|
| 1 | +--- |
| 2 | +title: SharePoint Embedded copilots Advanced Topics |
| 3 | +description: Learn how the semantic index powers Retrieval-Augmented Generation (RAG) to provide accurate, context-aware AI responses in SharePoint Embedded copilots. |
| 4 | +ms.date: 3/03/2025 |
| 5 | +ms.localizationpriority: high |
| 6 | +--- |
| 7 | + |
| 8 | +# SharePoint Embedded copilot Advanced Topics Overview |
| 9 | + |
| 10 | +This advanced guide covers how the semantic index powers Retrieval-Augmented Generation (RAG) to provide accurate, context-aware AI responses. We’ll explore how these concepts work together to ensure your copilot retrieves relevant information from your data and returns grounded answers. |
| 11 | + |
| 12 | +## Advanced Topics |
| 13 | + |
| 14 | +### Semantic index |
| 15 | + |
| 16 | +[Learn more about semantic index for Microsoft 365 Copilot here](/microsoftsearch/semantic-index-for-copilot) |
| 17 | + |
| 18 | +The semantic index allows for quick and accurate searches based on data similarity. This means it can find the most relevant information not just by exact matches, but also by understanding the context and meaning. |
| 19 | + |
| 20 | +### RAG ( Retrieval-Augmented Generation ) |
| 21 | + |
| 22 | +RAG relies on having relevant source materials stored in a repository, which can be queried at runtime, data is retrieved from the index and is used to augment the prompt sent to the large language model (LLM): |
| 23 | + |
| 24 | +- Treat data sources as knowledge without having to train your model |
| 25 | +- Uses search (retrieval) results as additional context in your prompt |
| 26 | +- Generates the output using the prompt and the supplied context |
| 27 | + |
| 28 | +The LLM uses the data to inform and construct the response. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +### Grounding |
| 33 | + |
| 34 | +Grounding in the context of SPE copilot refers to the process of providing input sources to the large language model (LLM) related to the user's prompt. This helps improve the specificity of the prompt and ensures that the responses are relevant and actionable to the user's specific task. The data the copilot is grounded on will be on the contents of the container type in the copilot application. Behind the scenes SPE copilot uses M365 Copilot, [learn more about it's architecture here](/copilot/microsoft-365/microsoft-365-copilot-architecture) |
| 35 | + |
| 36 | +### Scoping your copilot to specific content |
| 37 | + |
| 38 | +SharePoint Embedded (SPE) copilot has the ability to restrict the data sources it has access to, below are provided types, and this [example](https://github.com/microsoft/SharePoint-Embedded-Samples/blob/main/Samples/spe-typescript-react-azurefunction/react-client/src/providers/ChatController.ts#L15) shows how to configure the SDK |
| 39 | + |
| 40 | +```typescript |
| 41 | +export type IDataSourcesProps = |
| 42 | + | IFileDataSource |
| 43 | + | IFolderDataSource |
| 44 | + | IDocumentLibraryDataSource |
| 45 | + | ISiteDataSource |
| 46 | + | IWorkingSetDataSource |
| 47 | + | IMeetingDataSource; |
| 48 | + |
| 49 | +export enum DataSourceType { |
| 50 | + File = 'File', |
| 51 | + Folder = 'Folder', |
| 52 | + DocumentLibrary = 'DocumentLibrary', |
| 53 | + Site = 'Site', |
| 54 | + WorkingSet = 'WorkingSet', |
| 55 | + Meeting = 'Meeting' |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +#### Supported document types for scoping |
| 60 | + |
| 61 | +[Reference - File Formats Support By copilot](https://support.microsoft.com/topic/file-formats-supported-by-copilot-1afb9a70-2232-4753-85c2-602c422af3a8) |
| 62 | + |
| 63 | +**Documents**: PDF, DOCX, XLSX, PPTX |
| 64 | + |
| 65 | +**Text-based Files**: RTF, TXT, CSV, LOG, INI, CONFIG |
| 66 | + |
| 67 | +**Audio**: WAV |
| 68 | + |
| 69 | +**Programming Languages**: PY, JS, JSX, JAVA, PHP, CS, C, CPP, CXX, H, HPP, M, COFFEE, DART, LUA, PL, PM, RB, RS, SWIFT, GO, KT, KTS, R, SCALA, T, TS, TSX |
| 70 | + |
| 71 | +**Shell Scripts**: BASH, SH, ZSH |
| 72 | + |
| 73 | +**Markup and Documentation**: HTML, CSS, MD, RMD, TEX, LATEX |
| 74 | + |
| 75 | +**Database Languages**: SQL |
| 76 | + |
| 77 | +**Data Serialization Formats**: IPYNB, JSON, TOML, YAML, YML |
| 78 | + |
| 79 | +##### Language/Locale |
| 80 | + |
| 81 | +The copilot iframe dynamically loads localization settings to ensure that the chat interface is displayed in the appropriate language. These settings are derived from SharePoint, which provides a comprehensive set of localization options. |
| 82 | + |
| 83 | +When the copilot iframe is initialized, it retrieves the current localization settings from SharePoint. These settings dictate the language and regional preferences for the chat interface, ensuring that all UI elements, messages, and interactions are presented in the user's preferred language. This seamless integration with SharePoint's localization framework allows copilot to provide a consistent an |
| 84 | + |
| 85 | +You can have this localized by setting your language options in the SharePoint account settings: [Change your personal language and region settings - Microsoft Support](https://support.microsoft.com/en-us/office/change-your-personal-language-and-region-settings-caa1fccc-bcdb-42f3-9e5b-45957647ffd7) note, if your M365 setting is different from your Sharepoint account langauge settings it will take precedence, you can change your M365 language settings here: [Change your display language in Microsoft 365](https://support.microsoft.com/en-us/topic/change-your-display-language-and-time-zone-in-microsoft-365-for-business-6f238bff-5252-441e-b32b-655d5d85d15b) |
| 86 | + |
| 87 | +An additional locale option can be passed in through the `ChatLaunchConfig` to further set the language the copilot will respond in: |
| 88 | + |
| 89 | +```typescript |
| 90 | + const [chatConfig] = React.useState<ChatLaunchConfig>({ |
| 91 | + header: ChatController.instance.header, |
| 92 | + theme: ChatController.instance.theme, |
| 93 | + zeroQueryPrompts: ChatController.instance.zeroQueryPrompts, |
| 94 | + suggestedPrompts: ChatController.instance.suggestedPrompts, |
| 95 | + instruction: ChatController.instance.pirateMetaPrompt, |
| 96 | + locale: "en", |
| 97 | + }); |
| 98 | +``` |
| 99 | + |
| 100 | +###### Locale Options |
| 101 | + |
| 102 | +Here are some examples of locale options you can use: |
| 103 | + |
| 104 | +| Locale Code | Common Name | |
| 105 | +|--------------|------------------------------------------| |
| 106 | +| af | Afrikaans | |
| 107 | +| en-gb | English (UK) | |
| 108 | +| he | Hebrew | |
| 109 | +| kok | Konkani | |
| 110 | +| nn-no | Norwegian (Nynorsk) | |
| 111 | +| sr-latn-rs | Serbian (Latin, Serbia) | |
| 112 | +| am-et | Amharic | |
| 113 | +| es | Spanish | |
| 114 | +| hi | Hindi | |
| 115 | +| lb-lu | Luxembourgish | |
| 116 | +| or-in | Odia (India) | |
| 117 | +| sv | Swedish | |
| 118 | +| ar | Arabic | |
| 119 | +| es-mx | Spanish (Mexico) | |
| 120 | +| hr | Croatian | |
| 121 | +| lo | Lao | |
| 122 | +| pa | Punjabi | |
| 123 | +| ta | Tamil | |
| 124 | +| as-in | Assamese | |
| 125 | +| et | Estonian | |
| 126 | +| hu | Hungarian | |
| 127 | +| lt | Lithuanian | |
| 128 | +| pl | Polish | |
| 129 | +| te | Telugu | |
| 130 | +| az-latn-az | Azerbaijani (Latin, Azerbaijan) | |
| 131 | +| eu | Basque | |
| 132 | +| hy | Armenian | |
| 133 | +| lv | Latvian | |
| 134 | +| pt-br | Portuguese (Brazil) | |
| 135 | +| th | Thai | |
| 136 | +| bg | Bulgarian | |
| 137 | +| fa | Persian | |
| 138 | +| id | Indonesian | |
| 139 | +| mi-nz | Maori (New Zealand) | |
| 140 | +| pt-pt | Portuguese (Portugal) | |
| 141 | +| tr | Turkish | |
| 142 | +| bs-latn-ba | Bosnian (Latin, Bosnia and Herzegovina) | |
| 143 | +| fi | Finnish | |
| 144 | +| is | Icelandic | |
| 145 | +| mk | Macedonian | |
| 146 | +| quz-pe | Quechua (Peru) | |
| 147 | +| tt | Tatar | |
| 148 | +| ca-es-valencia | Catalan (Valencian) | |
| 149 | +| fil-ph | Filipino (Philippines) | |
| 150 | +| it | Italian | |
| 151 | +| ml | Malayalam | |
| 152 | +| ro | Romanian | |
| 153 | +| ug | Uyghur | |
| 154 | +| ca | Catalan | |
| 155 | +| fr-ca | French (Canada) | |
| 156 | +| ja | Japanese | |
| 157 | +| mr | Marathi | |
| 158 | +| ru | Russian | |
| 159 | +| uk | Ukrainian | |
| 160 | +| cs | Czech | |
| 161 | +| fr | French | |
| 162 | +| ka | Georgian | |
| 163 | +| ms | Malay | |
| 164 | +| sk | Slovak | |
| 165 | +| ur | Urdu | |
| 166 | +| cy-gb | Welsh (UK) | |
| 167 | +| ga-ie | Irish (Ireland) | |
| 168 | +| kk | Kazakh | |
| 169 | +| mt-mt | Maltese (Malta) | |
| 170 | +| sl | Slovenian | |
| 171 | +| uz-latn-uz | Uzbek (Latin, Uzbekistan) | |
| 172 | +| da | Danish | |
| 173 | +| gd | Scottish Gaelic | |
| 174 | +| km-kh | Khmer (Cambodia) | |
| 175 | +| nb-no | Norwegian (Bokmål) | |
| 176 | +| sq | Albanian | |
| 177 | +| vi | Vietnamese | |
| 178 | +| de | German | |
| 179 | +| gl | Galician | |
| 180 | +| kn | Kannada | |
| 181 | +| ne-np | Nepali (Nepal) | |
| 182 | +| sr-cyrl-ba | Serbian (Cyrillic, Bosnia and Herzegovina)| |
| 183 | +| zh-cn | Chinese (Simplified) | |
| 184 | +| el | Greek | |
| 185 | +| gu | Gujarati | |
| 186 | +| ko | Korean | |
| 187 | +| nl | Dutch | |
| 188 | +| sr-cyrl-rs | Serbian (Cyrillic, Serbia) | |
| 189 | +| zh-tw | Chinese (Traditional) | |
0 commit comments