Greasy Fork is available in English.

DeepSeek Conversation Search [DSCS]

Adds icon to the sidebar that opens a modal with chat search functionality

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

ผู้เขียน
Dramorian
จำนวนติดตั้งประจำวัน
0
จำนวนติดตั้งทั้งหมด
54
คะแนน
1 0 1
เวอร์ชัน
2.0
สร้างเมื่อ
29-01-2025
อัปเดตเมื่อ
29-12-2025
Size
97.3 กิโลไบต์
สัญญาอนุญาต
MIT
ปรับใช้กับ

DeepSeek Conversation Search (DSCS)

A powerful userscript that adds advanced search and indexing capabilities to DeepSeek Chat, allowing you to quickly find conversations by title or content.

✨ Features

🔍 Advanced Search

  • Title Search: Instantly search through conversation titles
  • Content Search: Deep search through message history within conversations
  • Real-time Results: Search results update as you type
  • Highlighted Matches: Query terms are highlighted in search results with context snippets

📊 Smart Indexing

  • Local IndexedDB Cache: Conversations and histories stored locally for instant search
  • Auto-Sync: Automatically syncs newest conversations in the background
  • Incremental Updates: Only fetches new or updated conversations
  • Configurable TTL: Control how long data stays cached

🎯 Pagination & Performance

  • Paginated Results: Browse through search results with configurable page size
  • Rate Limiting: Built-in token bucket algorithm prevents API rate limits
  • Concurrent Fetching: Parallel requests with configurable concurrency
  • Smart Retries: Automatic retry with exponential backoff for failed requests

⚙️ Highly Configurable

  • Adjust results per page, search depth, cache duration
  • Configure rate limiting and request concurrency
  • Control auto-sync behavior and intervals
  • All settings persist across sessions

🚀 Usage

Quick Start

  1. Install the script via Tampermonkey or similar userscript manager
  2. Navigate to chat.deepseek.com
  3. Click the search icon (🔍) in the sidebar, or press Ctrl+K (Cmd+K on Mac)
  4. Start typing to search your conversations!

Keyboard Shortcut

  • Ctrl+K (Windows/Linux) or Cmd+K (Mac): Open search modal from anywhere

Search Modes

  • Title Search (default): Fast search through conversation titles
  • Content Search: Enable the "Content" checkbox to search within message content
    • Searches cached histories first (instant)
    • Optionally fetches uncached conversations (configurable limit)

Manual Indexing

Click the Settings button in the search modal to access:

  • Index All Chats: Fetch and index all conversations (one-time operation)
  • Clear Session Index: Remove cached conversation data
  • Clear Histories: Remove cached message histories

⚙️ Configuration

All settings can be adjusted via the Settings panel or localStorage keys:

Pagination

  • dscs_results_page_size: Results per page in modal (default: 20)
  • dscs_page_count: Sessions fetched per API page (default: 50)

Content Search

  • dscs_content_count: Histories to fetch per page during search (default: 20)
  • dscs_max_pages: Maximum pages to search (default: 10)

Cache TTL

  • dscs_page_ttl: Session cache duration in milliseconds (default: 24 hours)
  • dscs_history_ttl: History cache duration in milliseconds (default: 7 days)

Auto Sync

  • dscs_auto_sync: Enable/disable auto-sync (default: enabled)
  • dscs_auto_sync_interval_ms: Sync interval in milliseconds (default: 5 minutes)
  • dscs_auto_sync_pages: Number of newest pages to sync (default: 2)
  • dscs_auto_prefetch_new_histories: Auto-fetch histories for new sessions (default: disabled)
  • dscs_auto_prefetch_limit: Maximum histories to prefetch (default: 20)

Rate Limiting

  • dscs_token_capacity: Token bucket capacity (default: 4)
  • dscs_token_refill: Tokens refilled per second (default: 0.5)
  • dscs_request_concurrency: Concurrent API requests (default: 2)
  • dscs_min_delay: Minimum delay between requests in ms (default: 400)

Advanced

  • dscs_fetch_timeout: Request timeout in ms (default: 20000)
  • dscs_max_retries: Maximum retry attempts (default: 5)
  • dscs_backoff_base: Base backoff time in ms (default: 1000)

🛠️ Developer API

The script exposes utility functions via window.DSCS:

// Clear all cached sessions
await window.DSCS.clearSessionIndex();

// Clear all cached message histories
await window.DSCS.clearHistories();

// Manually trigger auto-sync
await window.DSCS.autoSyncRecentSessions();

// Index all conversations (may take a while)
await window.DSCS.indexAllChats();

🎨 Theme Support

Automatically detects and adapts to DeepSeek's light/dark theme.

📝 Technical Details

  • Storage: Uses IndexedDB for efficient local caching
  • API Integration: Works with DeepSeek's official API endpoints
  • Rate Limiting: Token bucket algorithm with configurable parameters
  • Request Queue: Manages concurrent requests with minimum delay enforcement
  • Auto-Sync: Intelligent incremental sync using updated_at timestamps
  • Error Handling: Comprehensive retry logic with exponential backoff
  • Memory Efficient: Paginated results avoid DOM bloat

🐛 Troubleshooting

Search not finding conversations

  1. Click Settings → "Index All Chats" to build initial index
  2. Ensure auto-sync is enabled for ongoing updates
  3. Check browser console for errors

Rate limiting errors

  1. Reduce dscs_request_concurrency in settings
  2. Increase dscs_min_delay between requests
  3. Decrease dscs_token_refill rate

Performance issues

  1. Reduce dscs_results_page_size for fewer results per page
  2. Lower dscs_content_count and dscs_max_pages for content search
  3. Clear old cache data using Settings panel

🤝 Contributing

Found a bug or have a feature request? Please report issues or contribute improvements!