mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
3.0 KiB
3.0 KiB
AI observability
AI observability started as an analytics view over generation events and has grown into a full LLM platform: traces, evaluations, clustering, prompt management, a model gateway, a playground, and review queues.
This README is the orientation map for the product folder. Agents should also read AGENTS.md for product-specific rules.
Directory layout
products/ai_observability/
backend/ # Django app (label: llm_analytics)
api/ # DRF viewsets (one file per resource;
# api/__init__.py is the canonical inventory)
llm/ # Unified LLM client
client.py # Single entry point for provider calls
providers/ # Per-provider adapters
formatters/ # Provider request/response formatters
models/ # Django models + pydantic validators
migrations/
queries/ # Raw .sql files used by query runners
summarization/ # Trace and evaluation summarization
translation/
text_repr/ # Text-representation formatters for events
tools/ # Shared backend tools
test/
frontend/ # React + kea
components/ # Reusable UI
<feature>/ # clusters, datasets, evaluations, playground,
# prompts, settings, traceReviews,
# scoreDefinitions, skills, ...
generated/ # Generated types (do not edit)
mcp/ # MCP tool definitions
dags/ # Dagster jobs + metrics
skills/ # Agent skills scoped to the product
docs/ # Product-level docs (architecture decision records)
shared/ # Cross-frontend/backend constants, schemas
manifest.tsx # Scene + navigation registration
package.json # Turborepo package (@hanzo/products-ai-observability)
Query runners for the product live outside this folder in
insights/insightsql_queries/ai/. Two runners matter: trace_query_runner.py
(single trace) and traces_query_runner.py (list). See
AGENTS.md for why that detail matters.
Running tests locally
# Backend (pytest, Django)
insightscli test products/ai_observability/backend
insightscli test products/ai_observability/backend/api/test/test_trace_reviews.py
# InsightsQL query runners (live in insights/, not products/)
insightscli test insights/insightsql_queries/ai
# Frontend (Jest)
insightscli test products/ai_observability/frontend
insightscli test products/ai_observability/frontend/utils.test.ts --watch
After changing a serializer or viewset, regenerate OpenAPI and TypeScript types:
insightscli build:openapi
Further reading
- AGENTS.md — product-specific conventions.
- products/architecture.md — target architecture for products (facades, contracts, isolation). This product has not yet been migrated.