From e4d7b01b0956f010359902da311a3ac8b143bb7d Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 4 Jun 2026 01:50:44 +0530 Subject: [PATCH] refactor(backend): Update references from document summary LLM to agent LLM across multiple files --- .../subagents/builtins/deliverables/tools/report.py | 2 +- surfsense_backend/app/agents/new_chat/tools/report.py | 2 +- surfsense_backend/app/agents/podcaster/nodes.py | 6 ++---- surfsense_backend/app/celery_app.py | 2 +- surfsense_backend/app/db.py | 2 +- .../app/tasks/connector_indexers/google_calendar_indexer.py | 2 +- .../app/tasks/connector_indexers/google_gmail_indexer.py | 2 +- .../app/tasks/connector_indexers/linear_indexer.py | 2 +- .../app/tasks/connector_indexers/notion_indexer.py | 2 +- 9 files changed, 10 insertions(+), 12 deletions(-) diff --git a/surfsense_backend/app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/report.py b/surfsense_backend/app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/report.py index 97f012414..39b7c4694 100644 --- a/surfsense_backend/app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/report.py +++ b/surfsense_backend/app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/report.py @@ -546,7 +546,7 @@ def create_generate_report_tool( Factory function to create the generate_report tool with injected dependencies. The tool generates a Markdown report inline using the search space's - document summary LLM, saves it to the database, and returns immediately. + agent LLM, saves it to the database, and returns immediately. Uses short-lived database sessions for each DB operation so no connection is held during the long LLM API call. diff --git a/surfsense_backend/app/agents/new_chat/tools/report.py b/surfsense_backend/app/agents/new_chat/tools/report.py index e8629aef3..8c0bd95ea 100644 --- a/surfsense_backend/app/agents/new_chat/tools/report.py +++ b/surfsense_backend/app/agents/new_chat/tools/report.py @@ -565,7 +565,7 @@ def create_generate_report_tool( Factory function to create the generate_report tool with injected dependencies. The tool generates a Markdown report inline using the search space's - document summary LLM, saves it to the database, and returns immediately. + agent LLM, saves it to the database, and returns immediately. Uses short-lived database sessions for each DB operation so no connection is held during the long LLM API call. diff --git a/surfsense_backend/app/agents/podcaster/nodes.py b/surfsense_backend/app/agents/podcaster/nodes.py index 517d900a3..277536211 100644 --- a/surfsense_backend/app/agents/podcaster/nodes.py +++ b/surfsense_backend/app/agents/podcaster/nodes.py @@ -31,12 +31,10 @@ async def create_podcast_transcript( search_space_id = configuration.search_space_id user_prompt = configuration.user_prompt - # Get search space's document summary LLM + # Use the search space's agent LLM for podcast transcript generation. llm = await get_agent_llm(state.db_session, search_space_id) if not llm: - error_message = ( - f"No document summary LLM configured for search space {search_space_id}" - ) + error_message = f"No agent LLM configured for search space {search_space_id}" print(error_message) raise RuntimeError(error_message) diff --git a/surfsense_backend/app/celery_app.py b/surfsense_backend/app/celery_app.py index c60b2e4df..c7ee72667 100644 --- a/surfsense_backend/app/celery_app.py +++ b/surfsense_backend/app/celery_app.py @@ -103,7 +103,7 @@ def init_worker(**kwargs): """Initialize the LLM Router and Image Gen Router when a Celery worker process starts. This ensures the Auto mode (LiteLLM Router) is available for background tasks - like document summarization and image generation. + like agent workflows and image generation. """ from app.observability.bootstrap import init_otel diff --git a/surfsense_backend/app/db.py b/surfsense_backend/app/db.py index 1e011e049..c6fe1ee37 100644 --- a/surfsense_backend/app/db.py +++ b/surfsense_backend/app/db.py @@ -2963,7 +2963,7 @@ async def shielded_async_session(): async def setup_indexes(): async with engine.begin() as conn: # Create indexes - # Document Summary Indexes + # Document embedding indexes await conn.execute( text( "CREATE INDEX IF NOT EXISTS document_vector_index ON documents USING hnsw (embedding public.vector_cosine_ops)" diff --git a/surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py b/surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py index bae0ba9cc..e0053f614 100644 --- a/surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py +++ b/surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py @@ -2,7 +2,7 @@ Google Calendar connector indexer. Uses the shared IndexingPipelineService for document deduplication, -summarization, chunking, and embedding. +chunking, and embedding. """ from collections.abc import Awaitable, Callable diff --git a/surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py b/surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py index 27ada4053..29b94a873 100644 --- a/surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py +++ b/surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py @@ -2,7 +2,7 @@ Google Gmail connector indexer. Uses the shared IndexingPipelineService for document deduplication, -summarization, chunking, and embedding. +chunking, and embedding. """ from collections.abc import Awaitable, Callable diff --git a/surfsense_backend/app/tasks/connector_indexers/linear_indexer.py b/surfsense_backend/app/tasks/connector_indexers/linear_indexer.py index 1e84e51b7..4ea781e6f 100644 --- a/surfsense_backend/app/tasks/connector_indexers/linear_indexer.py +++ b/surfsense_backend/app/tasks/connector_indexers/linear_indexer.py @@ -2,7 +2,7 @@ Linear connector indexer. Uses the shared IndexingPipelineService for document deduplication, -summarization, chunking, and embedding with bounded parallel indexing. +chunking, and embedding with bounded parallel indexing. """ from collections.abc import Awaitable, Callable diff --git a/surfsense_backend/app/tasks/connector_indexers/notion_indexer.py b/surfsense_backend/app/tasks/connector_indexers/notion_indexer.py index 878690d2f..59589b7c7 100644 --- a/surfsense_backend/app/tasks/connector_indexers/notion_indexer.py +++ b/surfsense_backend/app/tasks/connector_indexers/notion_indexer.py @@ -2,7 +2,7 @@ Notion connector indexer. Uses the shared IndexingPipelineService for document deduplication, -summarization, chunking, and embedding with bounded parallel indexing. +chunking, and embedding with bounded parallel indexing. """ from collections.abc import Awaitable, Callable