feat(E): Unified Search — 24 Tasks complete
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
- SPIKE-E: FTS+Vector+Permission benchmark on 10k records (all <30ms) - E-PROV: supports_fts/vector/rag/graph capability flags on all providers - E-FTS/VEC: All 11 providers refactored to BaseSearchProvider with permission filtering - E-PERM: Over-fetch strategy for vector+permission (15x faster than ANY() filter) - E-FUSE: rrf_fusion_multi() for N-way RRF over FTS+Vector+RAG+Graph - E-LLM: Query understanding cleaned up to use central llm_complete() - E-CHUNK: Document chunking module + document_chunks table with HNSW index - E-EMB: Chunk embedding ARQ jobs (index_file_chunks, reindex_chunks) - E-RAG: RAG retrieval via FileSearchProvider.search_rag() - E-GRAPH: GraphRAG BFS traversal via GraphRAGSearchProvider.search_graph() - E-IX-EVT: Auto-indexing via outbox events + delete/cleanup handlers - E-IX-RE: Batch reindex with progress tracking + reindex_all job - E-DATA-LIFE: Lifecycle module (remove/rebuild/restore/correct) + API endpoints - E-K-MEM: AgentMemorySearchProvider - E-P-AI: AIChatSearchProvider - E-P-WF: WorkflowSearchProvider - E-P-COMM: ConversationSearchProvider verified (already on BaseSearchProvider) - E-API: Filter params (date_from/to, tags, sort) + /facets endpoint - E-TOOL: unified_search AI tool registered in ToolRegistry - E-MCP: Search tool in MCP server with normal RBAC/tenant checks - E-UI-CMD: CommandPalette (Cmd+K) with debounced search + recent searches - E-UI-FAC: SearchFacets, SearchResultCard, SavedSearches components - E-TEST: 40 new tests in test_unified_search_phase_e.py (105 total green) - E-DOC: api-documentation.md, plugin-development-guide.md, test-strategy.md updated 105 tests passing, TypeScript clean.
This commit is contained in:
@@ -19,6 +19,10 @@ class SearchProvider(Protocol):
|
||||
"""Protocol for entity-specific search providers."""
|
||||
|
||||
entity_type: str
|
||||
supports_fts: bool
|
||||
supports_vector: bool
|
||||
supports_rag: bool
|
||||
supports_graph: bool
|
||||
|
||||
async def search_fts(
|
||||
self,
|
||||
@@ -81,6 +85,23 @@ class SearchProviderRegistry:
|
||||
"""Get all registered entity types."""
|
||||
return list(self._providers.keys())
|
||||
|
||||
def get_providers_by_capability(self, capability: str) -> list[SearchProvider]:
|
||||
"""Get all providers that support a given capability (fts/vector/rag/graph)."""
|
||||
flag_attr = f"supports_{capability}"
|
||||
return [p for p in self._providers.values() if getattr(p, flag_attr, False)]
|
||||
|
||||
def get_capabilities(self, entity_type: str) -> dict[str, bool]:
|
||||
"""Get capability flags for a specific entity type."""
|
||||
provider = self.get(entity_type)
|
||||
if provider is None:
|
||||
return {"fts": False, "vector": False, "rag": False, "graph": False}
|
||||
return {
|
||||
"fts": getattr(provider, "supports_fts", False),
|
||||
"vector": getattr(provider, "supports_vector", False),
|
||||
"rag": getattr(provider, "supports_rag", False),
|
||||
"graph": getattr(provider, "supports_graph", False),
|
||||
}
|
||||
|
||||
def clear(self) -> None:
|
||||
"""Clear all registered providers."""
|
||||
self._providers.clear()
|
||||
@@ -130,6 +151,15 @@ async def auto_register_providers(db: AsyncSession) -> None:
|
||||
from app.plugins.builtins.unified_search.providers.user_provider import (
|
||||
UserSearchProvider,
|
||||
)
|
||||
from app.plugins.builtins.unified_search.providers.agent_memory_provider import (
|
||||
AgentMemorySearchProvider,
|
||||
)
|
||||
from app.plugins.builtins.unified_search.providers.ai_chat_provider import (
|
||||
AIChatSearchProvider,
|
||||
)
|
||||
from app.plugins.builtins.unified_search.providers.workflow_provider import (
|
||||
WorkflowSearchProvider,
|
||||
)
|
||||
from app.plugins.builtins.graph_rag.contracts import GraphRagContract
|
||||
GraphRAGSearchProvider = GraphRagContract.GraphRAGSearchProvider
|
||||
|
||||
@@ -148,6 +178,9 @@ async def auto_register_providers(db: AsyncSession) -> None:
|
||||
TagSearchProvider,
|
||||
ConversationSearchProvider,
|
||||
UserSearchProvider,
|
||||
AgentMemorySearchProvider,
|
||||
AIChatSearchProvider,
|
||||
WorkflowSearchProvider,
|
||||
GraphRAGSearchProvider,
|
||||
]:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user