Spaces:
Running
Running
MiniSearch Agent Guidelines
This is your navigation hub. Start here, follow the links, and return when you need orientation.
Before You Start
New to this codebase? Read in this order:
docs/quick-start.md- Get it runningdocs/overview.md- Understand the systemdocs/project-structure.md- Navigate the code
Making changes? Check:
docs/coding-conventions.md- Code styledocs/development-commands.md- Available commandsdocs/pull-requests.md- How to submit
Repository Map
Getting Started
docs/quick-start.md- Installation, first run, verificationdocs/overview.md- System architecture and data flowdocs/project-structure.md- Directory layout and component organization
Configuration & Setup
docs/configuration.md- Environment variables and settings referencedocs/security.md- Access control, privacy, and security model
Core Functionality
docs/ai-integration.md- AI inference types (WebLLM, Wllama, OpenAI, AI Horde, Internal)docs/ui-components.md- Component architecture and PubSub patternsdocs/search-history.md- History database schema and managementdocs/conversation-memory.md- Token budgeting and rolling summaries
Development
docs/development-commands.md- Docker, npm, and testing commandsdocs/coding-conventions.md- Style guide and patternsdocs/pull-requests.md- PR process and merge philosophydocs/core-technologies.md- Technology stack and dependenciesdocs/design.md- UI/UX design principles
Agent Decision Tree
Need to:
βββ Add a feature?
β βββ UI component β docs/ui-components.md
β βββ AI integration β docs/ai-integration.md
β βββ Search functionality β client/modules/search.ts
β βββ Settings option β docs/configuration.md
βββ Fix a bug?
β βββ UI issue β Check component + PubSub channels
β βββ AI not working β docs/ai-integration.md + browser console
β βββ Search failing β Check SearXNG + server hooks
β βββ Build error β docs/development-commands.md
βββ Configure deployment?
β βββ Environment variables β docs/configuration.md
β βββ Access control β docs/security.md
β βββ Docker setup β docs/overview.md
βββ Understand data flow?
βββ Search flow β client/modules/search.ts
βββ AI generation β client/modules/textGeneration.ts
βββ State management β docs/ui-components.md
βββ History/Chat β docs/search-history.md + docs/conversation-memory.md
Key Files Reference
Entry Points
client/index.tsx- React app initializationvite.config.ts- Vite dev server with hooksDockerfile- Multi-stage container build
Business Logic Modules
client/modules/search.ts- Search orchestration and cachingclient/modules/textGeneration.ts- AI response flowclient/modules/pubSub.ts- All PubSub channelsclient/modules/settings.ts- Settings managementclient/modules/history.ts- Search history database
Server-Side Modules
server/searchEndpointServerHook.ts-/searchendpointsserver/internalApiEndpointServerHook.ts-/inferenceproxyserver/webSearchService.ts- SearXNG integrationserver/rerankerService.ts- Local result reranking
Key Components
client/components/App/- Application shellclient/components/Search/Form/- Search inputclient/components/Search/Results/- Results displayclient/components/AiResponse/- AI response + chatclient/components/Pages/Main/Menu/- Settings drawersclient/modules/webGpu.ts- Detects WebGPU availability and F16 shader support for WebLLMclient/modules/querySuggestions.ts- Provides search suggestion UI, stored in IndexedDBclient/modules/relatedSearchQuery.ts- Generates related search queriesclient/modules/followUpQuestions.ts- Generates suggested follow-up questions, usesfollowUpQuestionPubSubclient/modules/accessKey.ts- Validates and stores access keys, usesaccessKeyValidatedPubSubclient/modules/parentWindow.ts- PostMessage API for embedding in parent windowsclient/hooks/- Reusable React hooksserver/searchToken.ts- Generates CSRF protection tokens for search requestsserver/downloadFileFromHuggingFaceRepository.ts- Downloads GGUF models from HuggingFace using@huggingface/hubpackage
Common Tasks Quick Reference
Add a new AI model
- Add to
client/modules/wllama.tsor WebLLM registry - Update
docs/ai-integration.md - Update
docs/configuration.mddefaults
Add a new setting
- Add to
client/modules/settings.tsdefault object - Add UI in
client/components/Pages/Main/Menu/ - Update
docs/configuration.mdsettings table
Modify search behavior
- Edit
client/modules/search.ts - Update
server/webSearchService.tsif server-side changes needed - Check
server/rerankerService.tsif reranking affected
Fix UI state issues
- Check PubSub channels in
client/modules/pubSub.ts - Verify component subscriptions in
docs/ui-components.md - Ensure proper state updates in business logic modules
Analyze test coverage
- Run
npm run test:coverageto generate reports - Check
coverage/coverage-summary.jsonfor quick metrics - See
docs/development-commands.mdfor full coverage analysis guide
Quality Gates
Before any change:
docker compose exec development-server npm run lint
This runs:
- Biome (formatting/linting)
- TypeScript (type checking)
- ts-prune (dead code detection)
- jscpd (copy-paste detection)
- dpdm (circular dependency detection)
- Custom architectural linter
Agent-First Principles
Repository as System of Record:
- All knowledge lives in versioned docs/ structure
- This file is your entry point - start here
- Follow links, don't assume - verify in code
Context Efficiency:
- Use this map to navigate quickly
- Return to this file when context drifts
- Follow the decision tree for common tasks
Architecture & Boundaries:
- Respect PubSub boundaries - don't cross concerns
- Client vs server - keep them separate
- Feature-based organization - one folder per feature
Documentation Maintenance:
- Update these docs when you learn something new
- Add cross-references when linking concepts
- Keep examples current with actual code
Technology Stack
React + TypeScript + Mantine UI v8, with privacy-first architecture.
See docs/core-technologies.md for complete dependency list and selection criteria.
Need Help?
- Check relevant doc in
docs/ - Read the module code in
client/modules/orserver/ - Look at similar existing implementations
- Run
npm run lintto validate changes