How jaswanthyamana/agent-hub works
Agent Hub captures agent execution traces, analyzes their reliability and security, and presents the results in a React observability workspace. The main flow is agent or SDK/OTLP spans through normalization and persistence, then trace analysis, evaluation, graphing, and replay; red-team campaigns exercise agents and compare attacked runs with baselines. The README also describes live trace streaming and Pass@k benchmarking. Evidence is strongest for ingestion, red-team orchestration, replay, persistence, and app routing; several API and UI interactions are represented at subsystem level because their implementation excerpts were not provided.
Main entry points: models.py Trace models · engine.py Red-team campaigns · main.py FastAPI routes · ingest.py Span ingestion
Components 26
Capture and runtime
- Instrumented agents
backend/agents - Tracing SDK
backend/sdk.py - Agent adapters
backend/integrations - Span ingestion
backend/api/ingest.py - Span normalizer
backend/ingestion/normalizer.py - Trace models
backend/core/models.py
Trace analysis
- Anomaly detection
backend/anomaly/detector.py - Reliability metrics
backend/evaluation/metrics.py - Judge evaluation
backend/evaluation/judge.py - LLM judge
backend/evaluation/llm_judge.py - Execution DAG
backend/graph/builder.py - Replay and diff
backend/replay/engine.py
Adversarial testing
- Red-team campaigns
backend/redteam/engine.py - Attack catalogue
backend/redteam/catalogue.py
API and persistence
- Domain policies
backend/domains/definitions.py - FastAPI routes
backend/main.py - Trace repository
backend/storage/pg_repository.py - PostgreSQL store
backend/storage/pg_database.py
Observability UI
- React workspace
frontend-react/src/App.jsx - API client
frontend-react/src/services/api.js - Observability views
frontend-react/src/views - Trace visualizations
frontend-react/src/components/graph/ExecutionGraph.jsx - Analytics view
frontend-react/src/views/Analytics.jsx - Red-team view
frontend-react/src/views/RedTeam.jsx - Replay view
frontend-react/src/views/Replay.jsx
Other components
- OTLP agents
Connections 31
- OTLP agents → Span ingestion: sends OTLP
backend/api/ingest.py - Tracing SDK → Span ingestion: posts spans
backend/api/ingest.py - Agent adapters → Tracing SDK: instruments
backend/integrations/langchain_adapter.py - Span ingestion → Span normalizer: normalizes
backend/api/ingest.py - Span ingestion → Trace repository: saves spans
backend/api/ingest.py - Span normalizer → Trace models: creates spans
backend/ingestion/normalizer.py - Instrumented agents → Trace models: emits traces
backend/agents/demo_agent.py - FastAPI routes → Span ingestion: registers route
backend/main.py - FastAPI routes → Trace repository: initializes storage
backend/main.py - Trace repository → PostgreSQL store: uses pool
backend/storage/pg_repository.py - Red-team campaigns → Instrumented agents: runs baseline
backend/redteam/engine.py - Red-team campaigns → Reliability metrics: computes scores
backend/redteam/engine.py - Red-team campaigns → Anomaly detection: checks attacks
backend/redteam/engine.py - Red-team campaigns → Attack catalogue: selects payload
backend/redteam/engine.py - Red-team campaigns → Trace repository: persists results
- FastAPI routes → Red-team campaigns: registers route
backend/main.py - FastAPI routes → Domain policies: loads policies
backend/main.py - Anomaly detection → Trace models: analyzes traces
backend/anomaly/detector.py - Reliability metrics → Trace models: scores traces
backend/evaluation/metrics.py - LLM judge → Trace models: assesses traces
backend/evaluation/llm_judge.py - LLM judge → Judge evaluation: uses fallback
- Execution DAG → Trace models: builds DAG
backend/graph/builder.py - Replay and diff → Trace models: captures frames
backend/replay/engine.py - Trace repository → Trace models: loads traces
backend/storage/pg_repository.py - React workspace → Observability views: routes to
frontend-react/src/App.jsx - React workspace → API client: checks health
- Analytics view → API client: requests analytics
frontend-react/src/views/Analytics.jsx - API client → FastAPI routes: calls REST
- Trace visualizations → Execution DAG: visualizes DAG
- Red-team view → API client: submits campaigns
- Replay view → API client: requests replay