Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

refactor: agent templates (#20364)

Jin Hai2a94c6c1a06f
diff --git a/Dockerfile b/Dockerfile
index 1e15f70a46..edf6e94357 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -249,7 +249,7 @@ RUN rm -f /etc/nginx/sites-enabled/default
COPY conf conf
-COPY agent/templates agent/templates
+COPY internal/agent/templates agent/templates
COPY rag/prompts rag/prompts
# Wiki page-structure presets read at runtime by the Go backend
diff --git a/docs/guides/models/deploy_local_llm.mdx b/docs/guides/models/deploy_local_llm.mdx
index 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:1025
Started 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 WebUI
Go to **Settings** → **Model Providers** → **Search** → **vLLM** → **Add**; configure as follows:
@@ -376,7 +376,7 @@ root@gpustack-prod:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
abf59be84b1a 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 WebUI
setting->model providers->search->gpustack->add ,configure as follow:
diff --git a/agent/templates/advanced_ingestion_pipeline.json b/internal/agent/templates/advanced_ingestion_pipeline.json
similarity index 100%
rename from agent/templates/advanced_ingestion_pipeline.json
rename to internal/agent/templates/advanced_ingestion_pipeline.json
diff --git a/agent/templates/cajal_scientific_paper_agent.json b/internal/agent/templates/cajal_scientific_paper_agent.json
similarity index 100%
rename from agent/templates/cajal_scientific_paper_agent.json
rename to internal/agent/templates/cajal_scientific_paper_agent.json
diff --git a/agent/templates/chunk_summary.json b/internal/agent/templates/chunk_summary.json
similarity index 100%
rename from agent/templates/chunk_summary.json
rename to internal/agent/templates/chunk_summary.json
diff --git a/agent/templates/compiler.json b/internal/agent/templates/compiler.json
similarity index 100%
rename from agent/templates/compiler.json
rename to internal/agent/templates/compiler.json
diff --git a/agent/templates/customer_feedback_dispatcher.json b/internal/agent/templates/customer_feedback_dispatcher.json
similarity index 100%
rename from agent/templates/customer_feedback_dispatcher.json
rename to internal/agent/templates/customer_feedback_dispatcher.json
diff --git a/agent/templates/data_analysis_beginner_assistant.json b/internal/agent/templates/data_analysis_beginner_assistant.json
similarity index 100%
rename from agent/templates/data_analysis_beginner_assistant.json
rename to internal/agent/templates/data_analysis_beginner_assistant.json
diff --git a/agent/templates/deep_research.json b/internal/agent/templates/deep_research.json
similarity index 100%
rename from agent/templates/deep_research.json
rename to internal/agent/templates/deep_research.json
diff --git a/agent/templates/market_seo_article_writer.json b/internal/agent/templates/market_seo_article_writer.json
similarity index 100%
rename from agent/templates/market_seo_article_writer.json
rename to internal/agent/templates/market_seo_article_writer.json
diff --git a/agent/templates/photo_text_translator.json b/internal/agent/templates/photo_text_translator.json
similarity index 100%
rename from agent/templates/photo_text_translator.json
rename to internal/agent/templates/photo_text_translator.json
diff --git a/agent/templates/reflective_academic_paper_generator.json b/internal/agent/templates/reflective_academic_paper_generator.json
similarity index 100%
rename from agent/templates/reflective_academic_paper_generator.json
rename to internal/agent/templates/reflective_academic_paper_generator.json
diff --git a/agent/templates/seo_article_writer.json b/internal/agent/templates/seo_article_writer.json
similarity index 100%
rename from agent/templates/seo_article_writer.json
rename to internal/agent/templates/seo_article_writer.json
diff --git a/agent/templates/smart_customer_service_specialist.json b/internal/agent/templates/smart_customer_service_specialist.json
similarity index 100%
rename from agent/templates/smart_customer_service_specialist.json
rename to internal/agent/templates/smart_customer_service_specialist.json
diff --git a/agent/templates/stock_market_research_assistant.json b/internal/agent/templates/stock_market_research_assistant.json
similarity index 100%
rename from agent/templates/stock_market_research_assistant.json
rename to internal/agent/templates/stock_market_research_assistant.json
diff --git a/agent/templates/text2sql_data_expert.json b/internal/agent/templates/text2sql_data_expert.json
similarity index 100%
rename from agent/templates/text2sql_data_expert.json
rename to internal/agent/templates/text2sql_data_expert.json
diff --git a/agent/templates/title_chunker.json b/internal/agent/templates/title_chunker.json
similarity index 100%
rename from agent/templates/title_chunker.json
rename to internal/agent/templates/title_chunker.json
diff --git a/agent/templates/trip_planner.json b/internal/agent/templates/trip_planner.json
similarity index 100%
rename from agent/templates/trip_planner.json
rename to internal/agent/templates/trip_planner.json
diff --git a/agent/templates/user_interaction.json b/internal/agent/templates/user_interaction.json
similarity index 100%
rename from agent/templates/user_interaction.json
rename to internal/agent/templates/user_interaction.json
diff --git a/agent/templates/web_search_assistant.json b/internal/agent/templates/web_search_assistant.json
similarity index 100%
rename from agent/templates/web_search_assistant.json
rename to internal/agent/templates/web_search_assistant.json
diff --git a/agent/templates/your_starter_dataset_chatbot.json b/internal/agent/templates/your_starter_dataset_chatbot.json
similarity index 100%
rename from agent/templates/your_starter_dataset_chatbot.json
rename to internal/agent/templates/your_starter_dataset_chatbot.json
diff --git a/internal/dao/canvas_template_seed.go b/internal/dao/canvas_template_seed.go
index 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.go
index 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)
}