Skip to content

Conversation

@CREDO23
Copy link
Contributor

@CREDO23 CREDO23 commented Jan 9, 2026

Description

  • Add a Built-in documentation search tool

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 adds a built-in documentation search tool that allows the AI assistant to search and cite Surfsense's own documentation when answering user questions about how to use the application. The implementation includes database tables (surfsense_docs_documents and surfsense_docs_chunks) with vector embeddings for semantic search, an indexer that processes MDX documentation files at deployment time, a new agent tool for searching the docs, API routes for citation resolution, and frontend updates to display documentation citations alongside regular knowledge base citations using a doc- prefix to differentiate them.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/alembic/versions/60_add_surfsense_docs_tables.py
2 surfsense_backend/app/db.py
3 surfsense_backend/app/schemas/surfsense_docs.py
4 surfsense_backend/app/tasks/surfsense_docs_indexer.py
5 surfsense_backend/scripts/seed_surfsense_docs.py
6 scripts/docker/entrypoint-allinone.sh
7 surfsense_backend/app/agents/new_chat/tools/search_surfsense_docs.py
8 surfsense_backend/app/agents/new_chat/tools/registry.py
9 surfsense_backend/app/agents/new_chat/tools/__init__.py
10 surfsense_backend/app/routes/surfsense_docs_routes.py
11 surfsense_backend/app/routes/__init__.py
12 surfsense_web/lib/apis/documents-api.service.ts
13 surfsense_web/components/assistant-ui/inline-citation.tsx
14 surfsense_web/components/assistant-ui/markdown-text.tsx
15 surfsense_web/components/new-chat/source-detail-panel.tsx

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link

vercel bot commented Jan 9, 2026

@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on e8dc80c..2c3d625

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (15)

scripts/docker/entrypoint-allinone.sh
surfsense_backend/alembic/versions/60_add_surfsense_docs_tables.py
surfsense_backend/app/agents/new_chat/tools/__init__.py
surfsense_backend/app/agents/new_chat/tools/registry.py
surfsense_backend/app/agents/new_chat/tools/search_surfsense_docs.py
surfsense_backend/app/db.py
surfsense_backend/app/routes/__init__.py
surfsense_backend/app/routes/surfsense_docs_routes.py
surfsense_backend/app/schemas/surfsense_docs.py
surfsense_backend/app/tasks/surfsense_docs_indexer.py
surfsense_backend/scripts/seed_surfsense_docs.py
surfsense_web/components/assistant-ui/inline-citation.tsx
surfsense_web/components/assistant-ui/markdown-text.tsx
surfsense_web/components/new-chat/source-detail-panel.tsx
surfsense_web/lib/apis/documents-api.service.ts

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