Skip to content

feat: add optional You.com search integration - #188

Open
mouse-value-add wants to merge 1 commit into
u14app:mainfrom
mouse-value-add:feat/youcom-search-integration
Open

feat: add optional You.com search integration#188
mouse-value-add wants to merge 1 commit into
u14app:mainfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

Summary

This PR adds You.com as an optional search provider to Neo Chat's existing multi-provider search system, giving users another high-quality search option alongside existing providers like Tavily, Firecrawl, Exa, Bocha, and SearXNG.

Why You.com for Neo Chat?

Neo Chat is a local-first AI chat workspace with sophisticated search capabilities. Adding You.com enhances the platform by:

  • Quality Results: You.com provides high-quality, AI-enhanced web search results
  • Flexible Authentication: Supports both authenticated (YDC_API_KEY) and keyless modes
  • Advanced Filtering: Time range filtering, domain scoping, result limits
  • Payment Model Awareness: Handles x402 payment challenges gracefully

Implementation Details

Architecture Integration

  • Follows existing provider patterns in src/lib/search/providerAdapters.ts
  • Added youcom to SearchProviderID type and updated all related definitions
  • Integrates with Neo Chat's BYOK encrypted credential system
  • Added to search provider settings with proper normalization

Authentication Modes

  1. Authenticated: Uses YDC_API_KEY via X-API-Key header for full access
  2. Keyless: Falls back to public API with x402 payment challenge handling

API Integration

  • Endpoint: https://api.you.com/search (configurable)
  • Request: JSON POST with query, limits, time filters, domain scoping
  • Response: Normalizes to Neo Chat's Source and ImageSource formats
  • Error Handling: Proper messages for auth failures and payment challenges

Configuration

Users configure You.com via Settings:

  1. Select "You.com" from search provider dropdown
  2. Optionally enter YDC_API_KEY for enhanced features
  3. Customize base URL if needed
  4. Use time range and domain filtering as desired

Testing & Validation

Added comprehensive test coverage:

  • ✅ Authenticated mode with API key
  • ✅ Keyless mode without authentication
  • ✅ x402 payment challenge handling
  • ✅ Result normalization and filtering
  • ✅ TypeScript compilation successful
  • ✅ All existing tests continue to pass

Safety & Compatibility

  • No Breaking Changes: Backward compatible, opt-in only
  • No Default Changes: Existing users see no behavior changes
  • Security: Follows BYOK model, no credential exposure
  • Error Handling: Graceful degradation with clear error messages

This integration gives Neo Chat users access to You.com's search results while maintaining the platform's local-first philosophy and security model.

Related

Add You.com as an optional search provider to Neo Chat's existing multi-provider search system. This integration:

- Supports both authenticated (YDC_API_KEY) and keyless modes
- Follows the existing provider architecture patterns
- Integrates with BYOK encrypted credential system
- Handles x402 payment challenges for keyless usage
- Includes comprehensive test coverage
- Maintains backward compatibility - no changes to default behavior

The You.com provider offers high-quality web search results with advanced filtering options, giving users another excellent choice alongside existing providers like Tavily, Firecrawl, Exa, Bocha, and SearXNG.

Configuration:
- Provider: Select 'You.com' from search provider dropdown in Settings
- API Key: Optional YDC_API_KEY for enhanced features
- Base URL: Defaults to https://api.you.com (customizable)
- Supports time range filtering, domain scoping, and result limits

Testing:
- Added unit tests covering authenticated and keyless modes
- Added x402 payment challenge handling tests
- All existing tests continue to pass
- TypeScript compilation successful
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