{"record":{"id":"d8f78f26fdf5b6eb","repo":"spring-projects/spring-ai","slug":"spring-ai-chat-client-tool-search-advisor-tool-in","errorCode":null,"errorMessage":"'spring.ai.chat.client.tool-search-advisor.tool-index-type=vector' requires a VectorStore bean in the application context, but none was found. Add a VectorStore implementation (e.g. spring-ai-starter-vector-store-pgvector) to your dependencies.","messagePattern":"'spring\\.ai\\.chat\\.client\\.tool-search-advisor\\.tool-index-type=vector' requires a VectorStore bean in the application context, but none was found\\. Add a VectorStore implementation \\(e\\.g\\. spring-ai-starter-vector-store-pgvector\\) to your dependencies\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"auto-configurations/advisors/spring-ai-autoconfigure-tool-search-advisor/src/main/java/org/springframework/ai/chat/client/advisor/toolsearch/autoconfigure/ToolSearchAdvisorAutoConfiguration.java","lineNumber":177,"sourceCode":"\n\t/**\n\t * Registers a {@link VectorToolIndex}.\n\t * <p>\n\t * Activated only when {@code tool-index-type=vector} is set explicitly. Fails fast\n\t * with a descriptive error if no {@link VectorStore} bean is present in the context.\n\t */\n\t@Configuration(proxyBeanMethods = false)\n\t@ConditionalOnClass(VectorToolIndex.class)\n\t@ConditionalOnMissingBean(ToolIndex.class)\n\t@ConditionalOnProperty(prefix = ToolSearchAdvisorProperties.CONFIG_PREFIX, name = \"tool-index-type\",\n\t\t\thavingValue = \"vector\", matchIfMissing = false)\n\tstatic class VectorToolIndexConfiguration {\n\n\t\t@Bean\n\t\tVectorToolIndex vectorToolIndex(ObjectProvider<VectorStore> vectorStoreProvider) {\n\t\t\tVectorStore vectorStore = vectorStoreProvider.getIfAvailable();\n\t\t\tif (vectorStore == null) {\n\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\"'spring.ai.chat.client.tool-search-advisor.tool-index-type=vector' requires a VectorStore \"\n\t\t\t\t\t\t\t\t+ \"bean in the application context, but none was found. Add a VectorStore \"\n\t\t\t\t\t\t\t\t+ \"implementation (e.g. spring-ai-starter-vector-store-pgvector) to your \"\n\t\t\t\t\t\t\t\t+ \"dependencies.\");\n\t\t\t}\n\t\t\treturn new VectorToolIndex(vectorStore);\n\t\t}\n\n\t}\n\n\t/**\n\t * Registers a {@link LuceneToolIndex}.\n\t * <p>\n\t * Activated only when {@code tool-index-type=lucene} is set explicitly. Also requires\n\t * {@code LuceneToolIndex} on the classpath (i.e.\n\t * {@code org.apache.lucene:lucene-core} present).\n\t */\n\t@Configuration(proxyBeanMethods = false)","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/auto-configurations/advisors/spring-ai-autoconfigure-tool-search-advisor/src/main/java/org/springframework/ai/chat/client/advisor/toolsearch/autoconfigure/ToolSearchAdvisorAutoConfiguration.java#L159-L195","documentation":"ToolSearchAdvisorAutoConfiguration's VectorToolIndexConfiguration creates a VectorToolIndex bean that requires a VectorStore. When spring.ai.chat.client.tool-search-advisor.tool-index-type=vector is set but no VectorStore bean exists in the application context, the configuration fails fast with this IllegalStateException telling you to add a vector-store dependency.","triggerScenarios":"Setting the property spring.ai.chat.client.tool-search-advisor.tool-index-type=vector (or leaving defaults that select vector) in a Spring Boot app that has no VectorStore bean, e.g. no spring-ai-starter-vector-store-* dependency or the store bean failed to register.","commonSituations":"Enabling the tool-search advisor's vector index in an application without any vector database configured; excluding the vector-store starter; the VectorStore auto-configuration being disabled by a @SpringBootApplication exclude or missing connection properties.","solutions":["Add a vector store starter dependency, e.g. spring-ai-starter-vector-store-pgvector, and configure its connection properties.","Switch the property to the in-memory index: spring.ai.chat.client.tool-search-advisor.tool-index-type=in-memory, if a vector store is not needed.","Verify the VectorStore bean actually exists (actuator/beans or a debug breakpoint on vectorToolIndex) — a failed store auto-configuration also surfaces as 'none found'."],"exampleFix":"# before\nspring.ai.chat.client.tool-search-advisor.tool-index-type=vector\n\n# after (no VectorStore available)\nspring.ai.chat.client.tool-search-advisor.tool-index-type=in-memory\n# or add:\n# implementation 'org.springframework.ai:spring-ai-starter-vector-store-pgvector'","handlingStrategy":"validation","validationCode":"// run before context startup or in a @PostConstruct\nif (toolIndexType.equals(\"vector\") && applicationContext.getBeanProvider(VectorStore.class).getIfAvailable() == null) {\n    throw new IllegalStateException(\"tool-index-type=vector needs a VectorStore bean — add a vector store starter\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    context = new SpringApplicationBuilder(App.class).run(args);\n} catch (BeanCreationException e) {\n    if (e.getMessage().contains(\"requires a VectorStore\")) {\n        // fall back to in-memory index or add a vector store dependency\n    }\n    throw e;\n}","preventionTips":["Pair tool-index-type=vector with a vector-store starter dependency","Use in-memory index type when no vector DB is needed","Verify VectorStore auto-configuration is not excluded","Smoke-test application context startup in CI"],"tags":["spring-boot","auto-configuration","vector-store","missing-bean"],"backgroundTag":"missing-dependency","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}