RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
refactor: agent templates (#20364)
Jin Hai2a94c6c1a06f
diff --git a/Dockerfile b/Dockerfileindex 1e15f70a46..edf6e94357 100644--- a/Dockerfile+++ b/Dockerfile@@ -249,7 +249,7 @@ RUN rm -f /etc/nginx/sites-enabled/defaultCOPY conf conf-COPY agent/templates agent/templates+COPY internal/agent/templates agent/templatesCOPY rag/prompts rag/prompts# Wiki page-structure presets read at runtime by the Go backenddiff --git a/docs/guides/models/deploy_local_llm.mdx b/docs/guides/models/deploy_local_llm.mdxindex fef39d65de..1d6401c9c3 100644--- a/docs/guides/models/deploy_local_llm.mdx+++ b/docs/guides/models/deploy_local_llm.mdx@@ -336,7 +336,7 @@ Starting vLLM API server 0 on http://0.0.0.0:1025Started server process [19177]Application startup complete.```-### 5.2 Intergrateing RAGFlow with vLLM Chat/Em/Rerank LLM with WebUI+### 5.2 Integrating RAGFlow with vLLM Chat/Em/Rerank LLM with WebUIGo to **Settings** → **Model Providers** → **Search** → **vLLM** → **Add**; configure as follows:@@ -376,7 +376,7 @@ root@gpustack-prod:~# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESabf59be84b1a gpustack/gpustack "/usr/bin/entrypoint…" 6 hours ago Up 6 hours 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:10161->10161/tcp, [::]:10161->10161/tcp gpustack```-### 6.2 Intergrateing RAGFlow with GPUStack Chat/Em/Rerank LLM with WebUI+### 6.2 Integrating RAGFlow with GPUStack Chat/Em/Rerank LLM with WebUIsetting->model providers->search->gpustack->add ,configure as follow:diff --git a/agent/templates/advanced_ingestion_pipeline.json b/internal/agent/templates/advanced_ingestion_pipeline.jsonsimilarity index 100%rename from agent/templates/advanced_ingestion_pipeline.jsonrename to internal/agent/templates/advanced_ingestion_pipeline.jsondiff --git a/agent/templates/cajal_scientific_paper_agent.json b/internal/agent/templates/cajal_scientific_paper_agent.jsonsimilarity index 100%rename from agent/templates/cajal_scientific_paper_agent.jsonrename to internal/agent/templates/cajal_scientific_paper_agent.jsondiff --git a/agent/templates/chunk_summary.json b/internal/agent/templates/chunk_summary.jsonsimilarity index 100%rename from agent/templates/chunk_summary.jsonrename to internal/agent/templates/chunk_summary.jsondiff --git a/agent/templates/compiler.json b/internal/agent/templates/compiler.jsonsimilarity index 100%rename from agent/templates/compiler.jsonrename to internal/agent/templates/compiler.jsondiff --git a/agent/templates/customer_feedback_dispatcher.json b/internal/agent/templates/customer_feedback_dispatcher.jsonsimilarity index 100%rename from agent/templates/customer_feedback_dispatcher.jsonrename to internal/agent/templates/customer_feedback_dispatcher.jsondiff --git a/agent/templates/data_analysis_beginner_assistant.json b/internal/agent/templates/data_analysis_beginner_assistant.jsonsimilarity index 100%rename from agent/templates/data_analysis_beginner_assistant.jsonrename to internal/agent/templates/data_analysis_beginner_assistant.jsondiff --git a/agent/templates/deep_research.json b/internal/agent/templates/deep_research.jsonsimilarity index 100%rename from agent/templates/deep_research.jsonrename to internal/agent/templates/deep_research.jsondiff --git a/agent/templates/market_seo_article_writer.json b/internal/agent/templates/market_seo_article_writer.jsonsimilarity index 100%rename from agent/templates/market_seo_article_writer.jsonrename to internal/agent/templates/market_seo_article_writer.jsondiff --git a/agent/templates/photo_text_translator.json b/internal/agent/templates/photo_text_translator.jsonsimilarity index 100%rename from agent/templates/photo_text_translator.jsonrename to internal/agent/templates/photo_text_translator.jsondiff --git a/agent/templates/reflective_academic_paper_generator.json b/internal/agent/templates/reflective_academic_paper_generator.jsonsimilarity index 100%rename from agent/templates/reflective_academic_paper_generator.jsonrename to internal/agent/templates/reflective_academic_paper_generator.jsondiff --git a/agent/templates/seo_article_writer.json b/internal/agent/templates/seo_article_writer.jsonsimilarity index 100%rename from agent/templates/seo_article_writer.jsonrename to internal/agent/templates/seo_article_writer.jsondiff --git a/agent/templates/smart_customer_service_specialist.json b/internal/agent/templates/smart_customer_service_specialist.jsonsimilarity index 100%rename from agent/templates/smart_customer_service_specialist.jsonrename to internal/agent/templates/smart_customer_service_specialist.jsondiff --git a/agent/templates/stock_market_research_assistant.json b/internal/agent/templates/stock_market_research_assistant.jsonsimilarity index 100%rename from agent/templates/stock_market_research_assistant.jsonrename to internal/agent/templates/stock_market_research_assistant.jsondiff --git a/agent/templates/text2sql_data_expert.json b/internal/agent/templates/text2sql_data_expert.jsonsimilarity index 100%rename from agent/templates/text2sql_data_expert.jsonrename to internal/agent/templates/text2sql_data_expert.jsondiff --git a/agent/templates/title_chunker.json b/internal/agent/templates/title_chunker.jsonsimilarity index 100%rename from agent/templates/title_chunker.jsonrename to internal/agent/templates/title_chunker.jsondiff --git a/agent/templates/trip_planner.json b/internal/agent/templates/trip_planner.jsonsimilarity index 100%rename from agent/templates/trip_planner.jsonrename to internal/agent/templates/trip_planner.jsondiff --git a/agent/templates/user_interaction.json b/internal/agent/templates/user_interaction.jsonsimilarity index 100%rename from agent/templates/user_interaction.jsonrename to internal/agent/templates/user_interaction.jsondiff --git a/agent/templates/web_search_assistant.json b/internal/agent/templates/web_search_assistant.jsonsimilarity index 100%rename from agent/templates/web_search_assistant.jsonrename to internal/agent/templates/web_search_assistant.jsondiff --git a/agent/templates/your_starter_dataset_chatbot.json b/internal/agent/templates/your_starter_dataset_chatbot.jsonsimilarity index 100%rename from agent/templates/your_starter_dataset_chatbot.jsonrename to internal/agent/templates/your_starter_dataset_chatbot.jsondiff --git a/internal/dao/canvas_template_seed.go b/internal/dao/canvas_template_seed.goindex 22b58dd7ce..f649f3684d 100644--- a/internal/dao/canvas_template_seed.go+++ b/internal/dao/canvas_template_seed.go@@ -265,6 +265,7 @@ func collectCanvasTypes(rawType, rawTypes any) entity.JSONSlice {func findAgentTemplatesDir() string {candidates := []string{+ "internal/agent/templates","agent/templates",filepath.Join("..", "agent", "templates"),filepath.Join("..", "..", "agent", "templates"),diff --git a/internal/ingestion/pipeline/pipeline_knowledge_compiler_dsl_test.go b/internal/ingestion/pipeline/pipeline_knowledge_compiler_dsl_test.goindex b0208af05d..c136ddc667 100644--- a/internal/ingestion/pipeline/pipeline_knowledge_compiler_dsl_test.go+++ b/internal/ingestion/pipeline/pipeline_knowledge_compiler_dsl_test.go@@ -65,7 +65,7 @@ func installStubResolvers(t *testing.T, groupToTemplates map[string][]string, te// singular compilation_template_group_id (see the frontend// accordion-operators.tsx restriction and the pipeline.tsx default).func TestKnowledgeCompilerDSL_FixtureDecodesAndBindsParams(t *testing.T) {- raw, err := os.ReadFile(filepath.Join(repoRootFromPipelineTest(t), "agent", "templates", "compiler.json"))+ raw, err := os.ReadFile(filepath.Join(repoRootFromPipelineTest(t), "internal", "agent", "templates", "compiler.json"))if err != nil {t.Fatalf("read fixture: %v", err)}@@ -113,7 +113,7 @@ func TestKnowledgeCompilerDSL_FixtureDecodesAndBindsParams(t *testing.T) {// rather than compiling with no template config.func TestKnowledgeCompilerDSL_FrontendDSLDecodesAndConstructs(t *testing.T) {ctx := t.Context()- raw, err := os.ReadFile(filepath.Join(repoRootFromPipelineTest(t), "agent", "templates", "compiler.json"))+ raw, err := os.ReadFile(filepath.Join(repoRootFromPipelineTest(t), "internal", "agent", "templates", "compiler.json"))if err != nil {t.Fatalf("read fixture: %v", err)}