Skip to content

[ROADMAP][1.7] Make LLM configs fully configurable with system prompts and citation settings #555

@MODSetter

Description

@MODSetter

Feature Description

Enhance the LLM configuration system to allow users to:

  • Configure custom system prompts per LLM config
  • Set citation behavior as default but make it configurable
  • Create specialized configs for different use cases
  • Share configs across search spaces

Target Deployment

  • SurfSense Cloud (hosted version)
  • Self-hosted version

Problem Statement

Current LLM config system:

  • Has limited customization options
  • Doesn't allow custom system prompts
  • Has fixed citation behavior
  • Cannot be easily tailored for specific use cases

Users need flexibility to create configs for:

  • Research assistant (detailed, citation-heavy)
  • Quick Q&A (concise, fast)
  • Creative writing (flexible, no citations)
  • Code assistant (technical, precise)

UI Enhancements

  • Config Editor: Rich editor for system prompts
  • Preset Library: Built-in presets for common use cases
  • Config Sharing: Ability to share configs within teams
  • Preview Mode: Test prompts before saving

Default Presets

  • Research Assistant: Citations enabled, detailed responses
  • Quick Q&A: Concise mode, minimal citations
  • Code Helper: Technical focus, code formatting
  • Creative: No citations, flexible format

Benefits

  • Highly customizable AI behavior
  • Users can tailor responses to their needs
  • Better separation of concerns for different tasks
  • Foundation for config marketplace/sharing

Use Case Examples

  • User creates "Academic Research" config with specific citation format
  • Team shares a "Customer Support" config optimized for their domain
  • User switches between "Deep Research" and "Quick Answer" modes

Implementation Considerations

[x] This may require frontend changes (config editor UI)
[x] This may require backend changes (schema updates, prompt handling)
[x] This may require database changes (new config fields)
[x] This may affect existing features (existing configs need migration)

Files Likely Affected

  • surfsense_backend/app/schemas/ - Config schemas
  • surfsense_backend/app/services/ - Config service
  • surfsense_backend/app/prompts/ - Prompt templates
  • surfsense_web/components/settings/ - Config UI
  • surfsense_web/hooks/use-llm-configs.ts - Config hooks

Acceptance Criteria

[ ] Config schema supports new fields
[ ] System prompts are properly applied to agent
[ ] Citation settings are respected
[ ] UI allows full config customization
[ ] Built-in presets are available
[ ] Existing configs migrated gracefully
[ ] Config validation prevents invalid settings

Migration Strategy

  • Add new fields with sensible defaults
  • Existing configs get enable_citations: true as default
  • System prompts default to current behavior
  • No breaking changes for existing users

Related Issues

  • Blocks: Issue 1.8 (Deep agent chat interface)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions