INNER CODE UNIT · Python
_fetch_vector_analytics
marc-shade/world-intel-mcp · src/world_intel_mcp/dashboard/app.py:623
async def _fetch_vector_analytics() -> dict:
"""Gather vector store stats, domain summary, and trend detection."""
_ensure_fetcher()
if _vector_store is None:
return {
"available": False,
"error": "Vector store not available (Qdrant not running)",
"timestamp": datetime.now(timezone.utc).isoformat(),
}
stats_coro = _vector_store.collection_stats()
domain_coro = _vector_store.domain_summary(hours=24.0)
trend_coro = _vector_store.trend_detection(recent_hours=6.0, baseline_hours=48.0)
gathered = await asyncio.gather(
stats_coro, domain_coro, trend_coro, return_exceptions=True
)