Skip to content

feat: added basic UI for automations and removed surfsense docs in chat related code.#1445

Merged
MODSetter merged 6 commits into
devfrom
dev_mod
May 29, 2026
Merged

feat: added basic UI for automations and removed surfsense docs in chat related code.#1445
MODSetter merged 6 commits into
devfrom
dev_mod

Conversation

@MODSetter
Copy link
Copy Markdown
Owner

@MODSetter MODSetter commented May 29, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR removes the internal SurfSense product documentation feature and replaces the raw-JSON automation creation form with a user-friendly visual builder. The backend removes search_surfsense_docs tool, drops the associated database tables (migration 146), and updates all agent prompts to direct users to the public docs site instead. The frontend introduces a comprehensive automation builder with task management, @-mention support for files/folders/connectors, schedule configuration (both preset and cron), and runtime settings. The builder supports bidirectional conversion between form and JSON, with automatic fallback to JSON mode for complex definitions that can't be represented in the UI. Agent task steps now accept the same mention parameters as chat messages, allowing automations to scope retrieval to specific resources.

⏱️ Estimated Review Time: 1-3 hours

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/alembic/versions/146_drop_surfsense_docs_tables.py
2 surfsense_backend/app/tasks/surfsense_docs_indexer.py
3 surfsense_backend/app/db.py
4 surfsense_backend/app/routes/surfsense_docs_routes.py
5 surfsense_backend/app/utils/surfsense_docs.py
6 surfsense_backend/scripts/seed_surfsense_docs.py
7 surfsense_backend/app/schemas/surfsense_docs.py
8 surfsense_backend/app/app.py
9 surfsense_backend/app/agents/new_chat/tools/search_surfsense_docs.py
10 surfsense_backend/app/agents/multi_agent_chat/subagents/builtins/research/tools/search_surfsense_docs.py
11 surfsense_backend/app/agents/new_chat/prompts/tools/search_surfsense_docs.md
12 surfsense_backend/app/agents/new_chat/prompts/examples/search_surfsense_docs.md
13 surfsense_backend/app/agents/new_chat/mention_resolver.py
14 surfsense_backend/app/agents/new_chat/tools/__init__.py
15 surfsense_backend/app/agents/new_chat/tools/registry.py
16 surfsense_backend/app/agents/new_chat/prompts/composer.py
17 surfsense_backend/app/agents/new_chat/prompts/base/kb_only_policy_private.md
18 surfsense_backend/app/agents/new_chat/prompts/base/kb_only_policy_team.md
19 surfsense_backend/app/agents/new_chat/prompts/base/tool_routing_private.md
20 surfsense_backend/app/agents/new_chat/prompts/base/tool_routing_team.md
21 surfsense_backend/app/agents/new_chat/prompts/base/citations_on.md
22 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/citations/on.md
23 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/dynamic_context/private.md
24 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/dynamic_context/team.md
25 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/kb_first.md
26 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/routing.md
27 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/providers/anthropic.md
28 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/providers/deepseek.md
29 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/providers/google.md
30 surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/prompts/providers/openai_classic.md
31 surfsense_backend/app/tasks/chat/streaming/context/mentioned_docs.py
32 surfsense_backend/app/tasks/chat/stream_new_chat.py
33 surfsense_backend/app/schemas/new_chat.py
34 surfsense_backend/app/routes/new_chat_routes.py
35 surfsense_web/lib/apis/documents-api.service.ts
36 surfsense_web/contracts/types/document.types.ts
37 surfsense_web/contracts/enums/connectorIcons.tsx
38 surfsense_web/contracts/enums/toolIcons.tsx
39 surfsense_web/components/assistant-ui/inline-citation.tsx
40 surfsense_web/atoms/chat/mentioned-documents.atom.ts
41 surfsense_web/components/new-chat/document-mention-picker.tsx
42 surfsense_web/lib/chat/mention-doc-key.ts
43 surfsense_web/lib/documents/document-type-labels.ts
44 surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
45 surfsense_web/lib/automations/builder-schema.ts
46 surfsense_web/lib/automations/schedule-builder.ts
47 surfsense_web/lib/automations/describe-cron.ts
48 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/automation-builder-form.tsx
49 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/task-list.tsx
50 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/task-item.tsx
51 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/mention-task-input.tsx
52 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/schedule-section.tsx
53 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/timezone-combobox.tsx
54 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/basics-section.tsx
55 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/advanced-section.tsx
56 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/builder-summary.tsx
57 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/form-field.tsx
58 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/json-mode-panel.tsx
59 surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/unattended-toggle.tsx
60 surfsense_web/app/dashboard/[search_space_id]/automations/new/automation-new-content.tsx
61 surfsense_web/app/dashboard/[search_space_id]/automations/new/components/automation-new-header.tsx
62 surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/edit/automation-edit-content.tsx
63 surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/edit/components/automation-edit-header.tsx
64 surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-header.tsx
65 surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-empty-state.tsx
66 surfsense_backend/app/automations/actions/agent_task/params.py
67 surfsense_backend/app/automations/actions/agent_task/invoke.py
68 surfsense_backend/app/automations/actions/agent_task/factory.py

Need help? Join our Discord

MODSetter added 6 commits May 28, 2026 19:21
- Added support for @-mentions in agent tasks, allowing users to reference documents, folders, and connectors directly in their queries.
- Updated `run_agent_task` to resolve mentions and include them in the context passed to the agent.
- Introduced new parameters in `AgentTaskActionParams` for handling mentioned document and connector IDs.
- Refactored the automation edit and new components to utilize the new `AutomationBuilderForm` for a more streamlined user experience.
- Removed deprecated JSON forms to simplify the automation creation process.
…and header components

- Replaced the FileJson icon with SquarePen in both AutomationsEmptyState and AutomationsHeader components.
- Updated button label from "Create via JSON" to "Create manually" for clarity in the automation creation process.
- Updated the `mentionParams` function to separate document and connector mentions, improving clarity and organization of the output.
- Modified the `mentionsFromParams` function to correctly handle and categorize mentions from parameters, ensuring connectors are processed separately.
- Adjusted documentation comments for better understanding of the changes in mention handling.
- Deleted the `search_surfsense_docs` tool and its associated files, streamlining the agent's toolset.
- Updated various components and prompts to remove references to the now-removed tool, ensuring consistency across the codebase.
- Adjusted documentation to direct users to the SurfSense documentation link for product-related queries instead.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment May 29, 2026 5:38am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7daaf193-faab-412d-bc4c-0dec6446ddfb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_mod

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MODSetter MODSetter merged commit 5d90fbe into dev May 29, 2026
7 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant