{"id":437447,"date":"2024-11-05T21:00:47","date_gmt":"2024-11-05T21:00:47","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=437447"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=437447","title":{"rendered":"<span>AI \u0438 Spring Petclinic: \u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0418\u0418-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0441 Spring AI (\u0427\u0430\u0441\u0442\u044c II)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u0432\u0442\u043e\u0440 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u0430 (RAG), \u0447\u0442\u043e\u0431\u044b LLM \u043c\u043e\u0433\u043b\u0430 \u0443\u0447\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0432\u0445\u043e\u0434\u0438\u0432\u0448\u0443\u044e \u0432 \u0435\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443.<\/p>\n<p>\u0412 \u043d\u043e\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <a href=\"https:\/\/t.me\/+QmrKn0wA8CdkNjAy\">Spring \u0410\u0439\u041e<\/a> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u0430 Spring AI \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043d\u043e \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0434\u0435\u043b\u0430\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c.<\/p>\n<hr\/>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/h2>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/companies\/spring_aio\/articles\/848016\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Spring AI \u0441 \u043a\u0440\u0443\u043f\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e ChatClient, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Function Calling \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Petclinic. \u041a \u043a\u043e\u043d\u0446\u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0418\u0418-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0438\u043d\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 RAG (Retrieval-Augmented Generation) \u2014 \u0442\u0435\u0445\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Function Calling. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a RAG \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0418\u0418 \u0441\u043e \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430.<\/p>\n<h2>Retrieval-Augmented Generation (RAG)<\/h2>\n<p>\u0425\u043e\u0442\u044f \u0432\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043c\u043e\u0433 \u0431\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u0430 (RAG).<\/p>\n<p>RAG \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u044b. \u0425\u043e\u0442\u044f \u044d\u0442\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439, RAG \u043e\u0431\u044b\u0447\u043d\u043e \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414.<\/p>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0411\u0414 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 (<em>embeddings)<\/em> \u2014 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0441\u043c\u044b\u0441\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0448\u0438\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445. \u042d\u0442\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443, \u0430 \u043d\u0435 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438 \u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u0414-\u0440 \u0410\u043b\u0438\u0441\u0430 \u0411\u0440\u0430\u0443\u043d \u2014 \u041a\u0430\u0440\u0434\u0438\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0414-\u0440 \u0411\u043e\u0431 \u0421\u043c\u0438\u0442 \u2014 \u0421\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0414-\u0440 \u041a\u044d\u0440\u043e\u043b \u0423\u0430\u0439\u0442 \u2014 \u0414\u0435\u0440\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u00ab\u0427\u0438\u0441\u0442\u043a\u0430 \u0437\u0443\u0431\u043e\u0432\u00bb \u043d\u0435\u00a0\u0434\u0430\u0441\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u00a0\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u00a0\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u0445, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u00ab\u0427\u0438\u0441\u0442\u043a\u0430 \u0437\u0443\u0431\u043e\u0432\u00bb \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u00ab\u0421\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u0438\u00bb. \u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u2011\u0440 \u0411\u043e\u0431 \u0421\u043c\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043a\u0430\u043a\u00a0\u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0440\u044f\u043c\u043e \u043d\u0435\u00a0\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u042d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u00a0\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u043c\u044b\u0441\u043b, \u043d\u0435\u00a0\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044f\u0441\u044c \u0442\u043e\u0447\u043d\u044b\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c. \u0425\u043e\u0442\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u044d\u0442\u043e <a href=\"https:\/\/youtu.be\/eMlx5fFNoYc?si=Lyjb1doyeAt3_EKG\">\u0432\u0438\u0434\u0435\u043e \u043d\u0430 YouTube<\/a>.<\/p>\n<p><em>\u0417\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u2014 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b <\/em><a href=\"https:\/\/chatgpt.com\/share\/66eef934-696c-8008-9961-93da0740c8f2\"><em>\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0430\u043c\u0438\u043c ChatGPT<\/em><\/a><em>.<\/em><\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e (LLM).<\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0448\u0435\u0441\u0442\u044c \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u043a \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u0434\u043e 256. \u0425\u043e\u0442\u044f \u0434\u0430\u0436\u0435 256 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u043e\u043b\u044c, \u043e\u0434\u043d\u0443 \u0438\u043b\u0438 \u0434\u0432\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u0438\u0437 Spring Petclinic. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a ChatGPT. \u041e\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 250 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 80% \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0439 WITH first_names AS (     SELECT 'James' AS name UNION ALL     SELECT 'Mary' UNION ALL     SELECT 'John' UNION ALL     ... ), last_names AS (     SELECT 'Smith' AS name UNION ALL     SELECT 'Johnson' UNION ALL     SELECT 'Williams' UNION ALL     ... ), random_names AS (     SELECT         first_names.name AS first_name,         last_names.name AS last_name     FROM         first_names     CROSS JOIN         last_names     ORDER BY         RAND()     LIMIT 250 ) INSERT INTO vets (first_name, last_name) SELECT first_name, last_name FROM random_names;  -- \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0434\u043b\u044f 80% \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 WITH vet_ids AS (     SELECT id     FROM vets     ORDER BY RAND()     LIMIT 200  -- 80% of 250 ), specialties AS (     SELECT id     FROM specialties ), random_specialties AS (     SELECT          vet_ids.id AS vet_id,         specialties.id AS specialty_id     FROM          vet_ids     CROSS JOIN          specialties     ORDER BY          RAND()     LIMIT 300 -- \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430  ) INSERT INTO vet_specialties (vet_id, specialty_id) SELECT      vet_id,     specialty_id FROM (     SELECT          vet_id,         specialty_id,         ROW_NUMBER() OVER (PARTITION BY vet_id ORDER BY RAND()) AS rn     FROM          random_specialties ) tmp WHERE      rn &lt;= 2;  -- \u041d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 2 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430  -- \u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 20% \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u0432\u0438\u0434\u0435 \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 (<code>INSERT<\/code>). \u042d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b <code>data.sql<\/code>:<\/p>\n<pre><code class=\"sql\">INSERT INTO vets VALUES (default, 'James', 'Carter'); INSERT INTO vets VALUES (default, 'Helen', 'Leary'); INSERT INTO vets VALUES (default, 'Linda', 'Douglas'); INSERT INTO vets VALUES (default, 'Rafael', 'Ortega'); INSERT INTO vets VALUES (default, 'Henry', 'Stevens'); INSERT INTO vets VALUES (default, 'Sharon', 'Jenkins'); INSERT INTO vets VALUES (default, 'Matthew', 'Alexander'); INSERT INTO vets VALUES (default, 'Alice', 'Anderson'); INSERT INTO vets VALUES (default, 'James', 'Rogers'); INSERT INTO vets VALUES (default, 'Lauren', 'Butler'); INSERT INTO vets VALUES (default, 'Cheryl', 'Rodriguez'); ... ... -- \u0412\u0441\u0435\u0433\u043e 256 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432   -- \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 5 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 INSERT INTO specialties (name) VALUES ('radiology'); INSERT INTO specialties (name) VALUES ('surgery'); INSERT INTO specialties (name) VALUES ('dentistry'); INSERT INTO specialties (name) VALUES ('cardiology'); INSERT INTO specialties (name) VALUES ('anesthesia');  INSERT INTO vet_specialties VALUES ('220', '2'); INSERT INTO vet_specialties VALUES ('131', '1'); INSERT INTO vet_specialties VALUES ('58', '3'); INSERT INTO vet_specialties VALUES ('43', '4'); INSERT INTO vet_specialties VALUES ('110', '3'); INSERT INTO vet_specialties VALUES ('63', '5'); INSERT INTO vet_specialties VALUES ('206', '4'); INSERT INTO vet_specialties VALUES ('29', '3'); INSERT INTO vet_specialties VALUES ('189', '3'); ... \u2026 <\/code><\/pre>\n<h2>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Postgres \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c pgVector. Greenplum \u2014 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Postgres \u2014 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 pgVector. \u0412 <a href=\"https:\/\/docs.spring.io\/spring-ai\/reference\/api\/vectordbs.html\">\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> Spring AI \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0411\u0414.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Spring AI \u043a\u043b\u0430\u0441\u0441 <code>SimpleVectorStore<\/code>. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>Java ConcurrentHashMap<\/code>, \u0447\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 256 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0430\u0442\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>AIBeanConfiguration<\/code>, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c <code>@Configuration<\/code>:<\/p>\n<pre><code class=\"java\">@Configuration @Profile(\"openai\") public class AIBeanConfiguration {  @Bean public ChatMemory chatMemory() { return new InMemoryChatMemory(); }  @Bean VectorStore vectorStore(EmbeddingModel embeddingModel) { return new SimpleVectorStore(embeddingModel); }  }<\/code><\/pre>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0411\u0414 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0431\u0438\u043d <code>VectorStoreController<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>@EventListener<\/code>, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>ApplicationStartedEvent<\/code>. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Spring`\u043e\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"java\">@EventListener public void loadVetDataToVectorStoreOnStartup(ApplicationStartedEvent event) throws IOException {     \/\/ \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Vet \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430     Pageable pageable = PageRequest.of(0, Integer.MAX_VALUE);     Page&lt;Vet&gt; vetsPage = vetRepository.findAll(pageable);     Resource vetsAsJson = convertListToJsonResource(vetsPage.getContent());     DocumentReader reader = new JsonReader(vetsAsJson);     List&lt;Document&gt; documents = reader.get();      \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414     this.vectorStore.add(documents);      if (vectorStore instanceof SimpleVectorStore) {         var file = File.createTempFile(\"vectorstore\", \".json\");         ((SimpleVectorStore) this.vectorStore).save(file);         logger.info(\"vector store contents written to {}\", file.getAbsolutePath());     }     logger.info(\"vector store loaded with {} documents\", documents.size()); }  public Resource convertListToJsonResource(List&lt;Vet&gt; vets) {     ObjectMapper objectMapper = new ObjectMapper();     try {         \/\/ Convert List&lt;Vet&gt; to JSON string         String json = objectMapper.writeValueAsString(vets);         \/\/ Convert JSON string to byte array         byte[] jsonBytes = json.getBytes();         \/\/ Create a ByteArrayResource from the byte array         return new ByteArrayResource(jsonBytes);     }     catch (JsonProcessingException e) {         e.printStackTrace();         return null;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e:<\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>listOwners<\/code>, \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>Spring AI \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u0430 <code>Document<\/code>. <code>Document<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c, \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u0422\u0430\u043a\u043e\u0435 \u0434\u0432\u043e\u0439\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u0434\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Document<\/code>, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Vet<\/code> \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442. Spring AI \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 readers \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438: <code>JsonReader<\/code> \u0438 <code>TextReader<\/code>. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Vet<\/code> \u0438\u043c\u0435\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u0432\u0438\u0434\u0435 JSON. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>convertListToJsonResource<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0441\u0435\u0440\u0430 Jackson \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0432 JSON-\u0440\u0435\u0441\u0443\u0440\u0441, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>add(documents)<\/code> \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 (\u043d\u0430\u0448\u0438\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON) \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f \u0435\u0433\u043e, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044f \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0442\u044f \u044d\u0442\u043e \u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>vectorstore.json<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 <code>SimpleVectorStore<\/code>. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a Spring AI \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u00ab\u0437\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438\u00bb. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0438\u0434\u0438\u0442 Spring AI.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"json\">{   \"dd919c71-06bb-4777-b974-120dfee8b9f9\" : {     \"embedding\" : [ 0.013877872, 0.03598228, 0.008212427, 0.00917901, -0.036433823, 0.03253927, -0.018089917, -0.0030867155, -0.0017038669, -0.048145704, 0.008974405, 0.017624263, 0.017539598, -4.7888185E-4, 0.013842596, -0.0028221398, 0.033414137, -0.02847539, -0.0066955267, -0.021885695, -0.0072387885, 0.01673529, -0.007386951, 0.014661016, -0.015380662, 0.016184973, 0.00787377, -0.019881975, -0.0028785826, -0.023875304, 0.024778388, -0.02357898, -0.023748307, -0.043094076, -0.029322032, ... ],     \"content\" : \"{id=31, firstName=Samantha, lastName=Walker, new=false, specialties=[{id=2, name=surgery, new=false}]}\",     \"id\" : \"dd919c71-06bb-4777-b974-120dfee8b9f9\",     \"metadata\" : { },     \"media\" : [ ]   },   \"4f9aabed-c15c-43f6-9dbc-46ed9a18e176\" : {     \"embedding\" : [ 0.01051745, 0.032714732, 0.007800559, -0.0020621764, -0.03240663, 0.025530376, 0.0037602335, -0.0023702774, -0.004978633, -0.037364256, 0.0012831709, 0.032742742, 0.005430281, 0.00847278, -0.004285406, 0.01146276, 0.03036196, -0.029941821, 0.013220336, -0.03207052, -7.518716E-4, 0.016665466, -0.0052062077, 0.010678503, 0.0026591222, 0.0091940155, ... ],     \"content\" : \"{id=195, firstName=Shirley, lastName=Martinez, new=false, specialties=[{id=1, name=radiology, new=false}, {id=2, name=surgery, new=false}]}\",     \"id\" : \"4f9aabed-c15c-43f6-9dbc-46ed9a18e176\",     \"metadata\" : { },     \"media\" : [ ]   },   \"55b13970-cd55-476b-b7c9-62337855ae0a\" : {     \"embedding\" : [ -0.0031563698, 0.03546827, 0.018778138, -0.01324492, -0.020253662, 0.027756566, 0.007182742, -0.008637386, -0.0075725033, -0.025543278, 5.850768E-4, 0.02568248, 0.0140383635, -0.017330453, 0.003935892, ... ],     \"content\" : \"{id=19, firstName=Jacqueline, lastName=Ross, new=false, specialties=[{id=4, name=cardiology, new=false}]}\",     \"id\" : \"55b13970-cd55-476b-b7c9-62337855ae0a\",     \"metadata\" : { },     \"media\" : [ ]   }, ... ... ...<\/code><\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c \u0437\u0434\u043e\u0440\u043e\u0432\u043e! \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u043d\u0430\u0447\u0438\u043c\u044b \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Vet<\/code> \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<h2>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0442 \u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u0432\u0443\u043c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430\u043c:<\/p>\n<ul>\n<li>\n<p><strong>\u0414\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/strong>: \u043a\u0430\u0436\u0434\u044b\u0439 JSON-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b<\/strong>: \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f 256 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 256 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0430\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 ETL (Extract, Transform, Load) \u0438\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043d\u0435 \u0432\u043b\u0438\u044f\u044f \u043d\u0430 user experience \u0438 \u0438\u0437\u0431\u0435\u0433\u0430\u044f \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 Spring Petclinic, \u044f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 LLM. \u0412\u043e\u0442, \u043a\u0430\u043a \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u044d\u0442\u043e \u0432 \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">@EventListener public void loadVetDataToVectorStoreOnStartup(ApplicationStartedEvent event) throws IOException {     Resource resource = new ClassPathResource(\"vectorstore.json\");     \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430     if (resource.exists()) {         \/\/ \u0427\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043a\u0440\u0435\u0434\u0438\u0442\u044b \u043d\u0430 \u0418\u0418, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c pre-embedded \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430         \/\/ \u043d\u0430 \u0434\u0438\u0441\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 h2 data.sql         File file = resource.getFile();         ((SimpleVectorStore) this.vectorStore).load(file);         logger.info(\"vector store loaded from existing vectorstore.json file in the classpath\");         return;     }  \u00a0\u00a0\u00a0\u00a0\/\/ \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u0439 \u00a0\u00a0\u00a0\u00a0... \u00a0\u00a0\u00a0\u00a0... }<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b <code>vectorstore.json<\/code> \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>src\/main\/resources<\/code>, \u0447\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0451 \u0437\u0430\u043d\u043e\u0432\u043e. \u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b <code>vectorstore.json<\/code> \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043d\u043e\u0432\u0430\u044f \u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>vectorstore.json<\/code> \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <code>src\/main\/resources<\/code>. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0438\u0437\u0431\u0435\u0433\u0430\u044f \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0411\u0414 \u0433\u043e\u0442\u043e\u0432\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>listVets<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">@Bean @Description(\"\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u043a\u043b\u0438\u043d\u0438\u043a\u0435 \u0434\u043b\u044f \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445\") public Function&lt;VetRequest, VetResponse&gt; listVets(AIDataProvider petclinicAiProvider) {     return request -&gt; {         try {             return petclinicAiProvider.getVets(request);         }         catch (JsonProcessingException e) {             e.printStackTrace();             return null;         }     }; } record VetResponse(List&lt;String&gt; vet) { };  record VetRequest(Vet vet) { }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 <code>AIDataProvider<\/code>:<\/p>\n<pre><code class=\"java\">public VetResponse getVets(VetRequest request) throws JsonProcessingException {     ObjectMapper objectMapper = new ObjectMapper();     String vetAsJson = objectMapper.writeValueAsString(request.vet());     SearchRequest sr = SearchRequest.from(SearchRequest.defaults()).withQuery(vetAsJson).withTopK(20);     if (request.vet() == null) {         \/\/ Provide a limit of 50 results when zero parameters are sent         sr = sr.withTopK(50);     }     List&lt;Document&gt; topMatches = this.vectorStore.similaritySearch(sr);     List&lt;String&gt; results = topMatches.stream().map(document -&gt; document.getContent()).toList();     return new VetResponse(results); }<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438:<\/p>\n<ol>\n<li>\n<p>\u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Vet<\/code> \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \u043f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Vet<\/code> \u0442\u0430\u043a\u0436\u0435 \u0432 JSON.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c <code>SearchRequest<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 <code>similaritySearch<\/code> \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414. <code>SearchRequest<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>topK<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 4, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u043e 20, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u00ab\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0440\u0434\u0438\u043e\u043b\u043e\u0433\u0438\u0438?\u00bb<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b (\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c <code>Vet<\/code> \u043f\u0443\u0441\u0442\u0430), \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>topK<\/code> \u0434\u043e 50. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u043e 50 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u0430\u043a \u00ab\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043a\u043b\u0438\u043d\u0438\u043a\u0438\u00bb. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u0432\u0435\u0434\u044c \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 LLM \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432:<\/p>\n<p><em>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445, \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0430. \u0422\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043e\u0431 \u043e\u0431\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0435\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432, \u043e\u0442\u0432\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0438\u0445 \u043c\u043d\u043e\u0433\u043e, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438. \u0414\u043b\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432, \u043f\u0438\u0442\u043e\u043c\u0446\u0435\u0432 \u0438\u043b\u0438\u0432\u0438\u0437\u0438\u0442\u043e\u0432\u00a0\u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <code>similaritySearch<\/code>. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c <code>getContent()<\/code> \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 JSON \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445, \u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0438\u0434\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e. \u042f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0447\u0430\u0442\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d09\/6f2\/975\/d096f29757e823c68606238ab001872a.png\" width=\"409\" height=\"609\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d09\/6f2\/975\/d096f29757e823c68606238ab001872a.png\"\/><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u043d\u0430\u0448 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044f \u043b\u044e\u0431\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5a2\/89b\/eee\/5a289beee38a29ccbf6e0f76c27506b8.png\" width=\"412\" height=\"616\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a2\/89b\/eee\/5a289beee38a29ccbf6e0f76c27506b8.png\"\/><\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u043b\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d88\/042\/9ac\/d880429acbd8105fae95216708124fc0.png\" width=\"410\" height=\"611\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d88\/042\/9ac\/d880429acbd8105fae95216708124fc0.png\"\/><\/figure>\n<p>\u042f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0430 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 20 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u043a\u0430\u0440\u0434\u0438\u043e\u043b\u043e\u0433\u0438\u0438, \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043f\u0440\u0435\u0434\u0435\u043b <code>topK(20)<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445, \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u044b, \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Thymeleaf, JavaScript, CSS \u0438 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c SCSS.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0432 \u043c\u0435\u0441\u0442\u0435, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u0441 \u043b\u044e\u0431\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 layout.html \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c.<\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f PR \u0441 \u0434\u043e\u043a\u0442\u043e\u0440\u043e\u043c \u0414\u0435\u0439\u0432\u043e\u043c \u0421\u0430\u0439\u0435\u0440\u043e\u043c \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0430\u0439\u043b petclinic.css \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0442\u0430\u043a \u043a\u0430\u043a Spring Petclinic \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 SCSS-\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 CSS-\u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c backend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 Spring, \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, Kubernetes \u0438 Cloud Foundry. \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Angular, \u043d\u043e \u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044f \u043c\u043e\u0433 \u0431\u044b \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0431\u044b \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0430\u0440\u0442\u043d\u0435\u0440 \u0434\u043b\u044f \u043f\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 ChatGPT. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/chatgpt.com\/share\/8c7accc2-8939-4fd6-8090-6abbb9d4e4cc\">\u044d\u0442\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0435\u0439 ChatGPT<\/a>. \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0430\u044f \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0432 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u043b\u0435\u043f\u0443\u044e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e Spring AI \u044f \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043e\u0446\u0435\u043d\u0438\u043b \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u044b\u0441\u043b\u0438 \u0438 \u0443\u0441\u0438\u043b\u0438\u044f. Spring AI \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043c\u0438\u0440 \u0418\u0418, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044f \u043e\u0442 \u043d\u0438\u0445 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a Python. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e\u0442 \u043e\u043f\u044b\u0442 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e: \u0432\u0430\u0448 \u043a\u043e\u0434 \u0441 \u0418\u0418 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u0434\u0435, \u0447\u0442\u043e \u0438 \u0432\u0430\u0448\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0418\u0418, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0421\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0443\u043b\u044f \u0432 \u043d\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043d\u0430 \u0418\u0418, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0414\u0430\u0436\u0435 \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 JPA \u0432 IDE, \u0432\u043d\u043e\u0441\u044f\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434.<\/p>\n<p>Spring AI \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0431\u0430\u0437\u0435 Spring, \u0443\u043f\u0440\u043e\u0449\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0418\u0418. \u041e\u043d \u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0418\u0418 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0430\u0443\u043a\u0438 \u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u0410\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0418\u0418 \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f \u0438\u0445 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 Spring, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u042d\u0442\u043e\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u044b\u0439 \u0441\u043e\u044e\u0437 \u0418\u0418 \u0438 Spring \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0443, \u0433\u0434\u0435 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0431\u0430\u0440\u044c\u0435\u0440\u0430\u043c\u0438, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u043c\u043d\u044b\u0445 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/725\/c0c\/ddb\/725c0cddbe78ce9d7a9dd868c3632ad6.png\" width=\"1560\" height=\"334\" data-src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/725\/c0c\/ddb\/725c0cddbe78ce9d7a9dd868c3632ad6.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a\u00a0\u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430\u00a0Spring Boot \u0432\u00a0\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u00a0\u2014\u00a0<a href=\"https:\/\/t.me\/+oBwACbkvJ19iODAy\">Spring \u0410\u0439\u041e<\/a>, \u0447\u0442\u043e\u0431\u044b\u00a0\u0431\u044b\u0442\u044c \u0432\u00a0\u043a\u0443\u0440\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u0438\u0437\u00a0\u043c\u0438\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u00a0Spring Boot \u0438 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e\u00a0\u0441\u00a0\u043d\u0438\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043e.<\/p>\n<p>\u0416\u0434\u0435\u043c \u0432\u0441\u0435\u0445,\u00a0<a href=\"https:\/\/t.me\/+oBwACbkvJ19iODAy\">\u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/855398\/\"> https:\/\/habr.com\/ru\/articles\/855398\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u0432\u0442\u043e\u0440 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u0430 (RAG), \u0447\u0442\u043e\u0431\u044b LLM \u043c\u043e\u0433\u043b\u0430 \u0443\u0447\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0432\u0445\u043e\u0434\u0438\u0432\u0448\u0443\u044e \u0432 \u0435\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443.<\/p>\n<p>\u0412 \u043d\u043e\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <a href=\"https:\/\/t.me\/+QmrKn0wA8CdkNjAy\">Spring \u0410\u0439\u041e<\/a> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u0430 Spring AI \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043d\u043e \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0434\u0435\u043b\u0430\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c.<\/p>\n<hr\/>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/h2>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/companies\/spring_aio\/articles\/848016\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Spring AI \u0441 \u043a\u0440\u0443\u043f\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e ChatClient, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Function Calling \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Petclinic. \u041a \u043a\u043e\u043d\u0446\u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0418\u0418-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0438\u043d\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 RAG (Retrieval-Augmented Generation) \u2014 \u0442\u0435\u0445\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Function Calling. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a RAG \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0418\u0418 \u0441\u043e \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430.<\/p>\n<h2>Retrieval-Augmented Generation (RAG)<\/h2>\n<p>\u0425\u043e\u0442\u044f \u0432\u044b\u0432\u043e\u0434 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043c\u043e\u0433 \u0431\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u0430 (RAG).<\/p>\n<p>RAG \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u044b. \u0425\u043e\u0442\u044f \u044d\u0442\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439, RAG \u043e\u0431\u044b\u0447\u043d\u043e \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414.<\/p>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0411\u0414 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 (<em>embeddings)<\/em> \u2014 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0441\u043c\u044b\u0441\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0448\u0438\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445. \u042d\u0442\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443, \u0430 \u043d\u0435 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438 \u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u0414-\u0440 \u0410\u043b\u0438\u0441\u0430 \u0411\u0440\u0430\u0443\u043d \u2014 \u041a\u0430\u0440\u0434\u0438\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0414-\u0440 \u0411\u043e\u0431 \u0421\u043c\u0438\u0442 \u2014 \u0421\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0414-\u0440 \u041a\u044d\u0440\u043e\u043b \u0423\u0430\u0439\u0442 \u2014 \u0414\u0435\u0440\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u00ab\u0427\u0438\u0441\u0442\u043a\u0430 \u0437\u0443\u0431\u043e\u0432\u00bb \u043d\u0435\u00a0\u0434\u0430\u0441\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u00a0\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u00a0\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u0445, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u00ab\u0427\u0438\u0441\u0442\u043a\u0430 \u0437\u0443\u0431\u043e\u0432\u00bb \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u00ab\u0421\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u0438\u00bb. \u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u2011\u0440 \u0411\u043e\u0431 \u0421\u043c\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043a\u0430\u043a\u00a0\u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0440\u044f\u043c\u043e \u043d\u0435\u00a0\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u042d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u00a0\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u043c\u044b\u0441\u043b, \u043d\u0435\u00a0\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044f\u0441\u044c \u0442\u043e\u0447\u043d\u044b\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c. \u0425\u043e\u0442\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u044d\u0442\u043e <a href=\"https:\/\/youtu.be\/eMlx5fFNoYc?si=Lyjb1doyeAt3_EKG\">\u0432\u0438\u0434\u0435\u043e \u043d\u0430 YouTube<\/a>.<\/p>\n<p><em>\u0417\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u2014 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b <\/em><a href=\"https:\/\/chatgpt.com\/share\/66eef934-696c-8008-9961-93da0740c8f2\"><em>\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0430\u043c\u0438\u043c ChatGPT<\/em><\/a><em>.<\/em><\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e (LLM).<\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0448\u0435\u0441\u0442\u044c \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u043a \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u0434\u043e 256. \u0425\u043e\u0442\u044f \u0434\u0430\u0436\u0435 256 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u043e\u043b\u044c, \u043e\u0434\u043d\u0443 \u0438\u043b\u0438 \u0434\u0432\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u0438\u0437 Spring Petclinic. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u044f \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a ChatGPT. \u041e\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 250 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 80% \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0439 WITH first_names AS (     SELECT 'James' AS name UNION ALL     SELECT 'Mary' UNION ALL     SELECT 'John' UNION ALL     ... ), last_names AS (     SELECT 'Smith' AS name UNION ALL     SELECT 'Johnson' UNION ALL     SELECT 'Williams' UNION ALL     ... ), random_names AS (     SELECT         first_names.name AS first_name,         last_names.name AS last_name     FROM         first_names     CROSS JOIN         last_names     ORDER BY         RAND()     LIMIT 250 ) INSERT INTO vets (first_name, last_name) SELECT first_name, last_name FROM random_names;  -- \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0434\u043b\u044f 80% \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 WITH vet_ids AS (     SELECT id     FROM vets     ORDER BY RAND()     LIMIT 200  -- 80% of 250 ), specialties AS (     SELECT id     FROM specialties ), random_specialties AS (     SELECT          vet_ids.id AS vet_id,         specialties.id AS specialty_id     FROM          vet_ids     CROSS JOIN          specialties     ORDER BY          RAND()     LIMIT 300 -- \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430  ) INSERT INTO vet_specialties (vet_id, specialty_id) SELECT      vet_id,     specialty_id FROM (     SELECT          vet_id,         specialty_id,         ROW_NUMBER() OVER (PARTITION BY vet_id ORDER BY RAND()) AS rn     FROM          random_specialties ) tmp WHERE      rn &lt;= 2;  -- \u041d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 2 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430  -- \u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 20% \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u0432\u0438\u0434\u0435 \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 (<code>INSERT<\/code>). \u042d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b <code>data.sql<\/code>:<\/p>\n<pre><code class=\"sql\">INSERT INTO vets VALUES (default, 'James', 'Carter'); INSERT INTO vets VALUES (default, 'Helen', 'Leary'); INSERT INTO vets VALUES (default, 'Linda', 'Douglas'); INSERT INTO vets VALUES (default, 'Rafael', 'Ortega'); INSERT INTO vets VALUES (default, 'Henry', 'Stevens'); INSERT INTO vets VALUES (default, 'Sharon', 'Jenkins'); INSERT INTO vets VALUES (default, 'Matthew', 'Alexander'); INSERT INTO vets VALUES (default, 'Alice', 'Anderson'); INSERT INTO vets VALUES (default, 'James', 'Rogers'); INSERT INTO vets VALUES (default, 'Lauren', 'Butler'); INSERT INTO vets VALUES (default, 'Cheryl', 'Rodriguez'); ... ... -- \u0412\u0441\u0435\u0433\u043e 256 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432   -- \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 5 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 INSERT INTO specialties (name) VALUES ('radiology'); INSERT INTO specialties (name) VALUES ('surgery'); INSERT INTO specialties (name) VALUES ('dentistry'); INSERT INTO specialties (name) VALUES ('cardiology'); INSERT INTO specialties (name) VALUES ('anesthesia');  INSERT INTO vet_specialties VALUES ('220', '2'); INSERT INTO vet_specialties VALUES ('131', '1'); INSERT INTO vet_specialties VALUES ('58', '3'); INSERT INTO vet_specialties VALUES ('43', '4'); INSERT INTO vet_specialties VALUES ('110', '3'); INSERT INTO vet_specialties VALUES ('63', '5'); INSERT INTO vet_specialties VALUES ('206', '4'); INSERT INTO vet_specialties VALUES ('29', '3'); INSERT INTO vet_specialties VALUES ('189', '3'); ... \u2026 <\/code><\/pre>\n<h2>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0411\u0414 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Postgres \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c pgVector. Greenplum \u2014 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Postgres \u2014 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 pgVector. \u0412 <a href=\"https:\/\/docs.spring.io\/spring-ai\/reference\/api\/vectordbs.html\">\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> Spring AI \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0411\u0414.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Spring AI \u043a\u043b\u0430\u0441\u0441 <code>SimpleVectorStore<\/code>. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>Java ConcurrentHashMap<\/code>, \u0447\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 256 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0430\u0442\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>AIBeanConfiguration<\/code>, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c <code>@Configuration<\/code>:<\/p>\n<pre><code class=\"java\">@Configuration @Profile(\"openai\") public class AIBeanConfiguration {  @Bean public ChatMemory chatMemory() { return new InMemoryChatMemory(); }  @Bean VectorStore vectorStore(EmbeddingModel embeddingModel) { return new SimpleVectorStore(embeddingModel); }  }<\/code><\/pre>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0411\u0414 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0431\u0438\u043d <code>VectorStoreController<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>@EventListener<\/code>, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>ApplicationStartedEvent<\/code>. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Spring`\u043e\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"java\">@EventListener public void loadVetDataToVectorStoreOnStartup(ApplicationStartedEvent event) throws IOException {     \/\/ \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Vet \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u0430     Pageable pageable = PageRequest.of(0, Integer.MAX_VALUE);     Page&lt;Vet&gt; vetsPage = vetRepository.findAll(pageable);     Resource vetsAsJson = convertListToJsonResource(vetsPage.getContent());     DocumentReader reader = new JsonReader(vetsAsJson);     List&lt;Document&gt; documents = reader.get();      \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414     this.vectorStore.add(documents);      if (vectorStore instanceof SimpleVectorStore) {         var file = File.createTempFile(\"vectorstore\", \".json\");         ((SimpleVectorStore) this.vectorStore).save(file);         logger.info(\"vector store contents written to {}\", file.getAbsolutePath());     }     logger.info(\"vector store loaded with {} documents\", documents.size()); }  public Resource convertListToJsonResource(List&lt;Vet&gt; vets) {     ObjectMapper objectMapper = new ObjectMapper();     try {         \/\/ Convert List&lt;Vet&gt; to JSON string         String json = objectMapper.writeValueAsString(vets);         \/\/ Convert JSON string to byte array         byte[] jsonBytes = json.getBytes();         \/\/ Create a ByteArrayResource from the byte array         return new ByteArrayResource(jsonBytes);     }     catch (JsonProcessingException e) {         e.printStackTrace();         return null;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e:<\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>listOwners<\/code>, \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0435\u0442\u0435\u0440\u0438\u043d\u0430\u0440\u043e\u0432 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>Spring AI \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0411\u0414 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u0430 <code>Document<\/code>. <code>Document<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-437447","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=437447"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437447\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}