{"record":{"id":"6de100e8e1fc8d3a","repo":"microsoft/semantic-kernel","slug":"vector-store-type-config-rag-vectorstoretype-i","errorCode":null,"errorMessage":"Vector store type '{config.Rag.VectorStoreType}' is not supported.","messagePattern":"Vector store type '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs","lineNumber":183,"sourceCode":"        }\n\n        // Add Vector Store\n        switch (config.Rag.VectorStoreType)\n        {\n            case AzureAISearchConfig.ConfigSectionName:\n            {\n                builder.AddAzureSearchClient(\n                    connectionName: AzureAISearchConfig.ConnectionStringName,\n                    configureSettings: (settings) => settings.Credential = builder.Environment.IsProduction()\n                        ? new DefaultAzureCredential()\n                        : new AzureCliCredential()\n                );\n                builder.Services.AddAzureAISearchCollection<TextSnippet<string>>(config.Rag.CollectionName);\n                builder.Services.AddVectorStoreTextSearch<TextSnippet<string>>();\n                break;\n            }\n            default:\n                throw new NotSupportedException($\"Vector store type '{config.Rag.VectorStoreType}' is not supported.\");\n        }\n    }\n\n    /// <summary>\n    /// Adds the chat completion agent to the service collection.\n    /// </summary>\n    /// <param name=\"builder\">The web application builder.</param>\n    /// <param name=\"config\">The host configuration.</param>\n    private static void AddAgent(WebApplicationBuilder builder, HostConfig config)\n    {\n        // Register agent without RAG if no collection name is provided. Allows for a basic experience where no data has been uploaded to the vector store yet.\n        if (string.IsNullOrEmpty(config.Rag.CollectionName))\n        {\n            PromptTemplateConfig templateConfig = KernelFunctionYaml.ToPromptTemplateConfig(EmbeddedResource.Read(\"AgentDefinition.yaml\"));\n\n            builder.Services.AddTransient<ChatCompletionAgent>((sp) =>\n            {\n                return new ChatCompletionAgent(templateConfig, new HandlebarsPromptTemplateFactory())","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs#L165-L201","documentation":"Error \"Vector store type '{config.Rag.VectorStoreType}' is not supported.\" thrown in microsoft/semantic-kernel.","triggerScenarios":"Thrown at dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/Program.cs:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set Rag:VectorStoreType to one of the supported vector store values in configuration.","Check Program.cs for the list of supported vector store types and correct the configuration value."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}