Multi-agent knowledge decay auditor โ Built for the Elasticsearch Agent Builder Hackathon
Enterprise knowledge bases decay silently. Documentation becomes outdated, contradictory, or concentrated in the hands of a few experts โ creating operational risk that's invisible until something breaks.
PassedAI detects four types of knowledge decay automatically:
| Decay Type | What It Catches | Business Impact |
|---|---|---|
| ๐ Stale Docs | Documents not updated in 6-24+ months | Employees following outdated procedures |
| โ๏ธ Contradictions | Two docs giving opposite guidance on the same topic | Confusion, compliance risk |
| โ Knowledge Gaps | Repeated employee questions with no matching documentation | Tribal knowledge, onboarding friction |
| ๐ค Expert Risk | Single owners of critical documentation | Bus factor = 1, knowledge silos |
flowchart TB
subgraph UI["๐ฅ๏ธ Demo UI (Flask :5050)"]
Dashboard["Real-time Dashboard"]
end
subgraph Orchestrator["๐ Python Orchestrator"]
RunAudit["run_audit.py"]
A2AClient["a2a_client.py"]
end
subgraph AgentBuilder["โก Elastic Agent Builder"]
subgraph Detect["PassedAI-Detect"]
D1["staleness_scorer"]
D2["gap_detector"]
D3["contradiction_finder"]
D4["expert_risk_finder"]
end
subgraph Act["PassedAI-Act"]
A1["notify_owner"]
A2["create_gap_task"]
end
end
subgraph ES["๐ Elasticsearch Serverless"]
Docs["passed_documents<br/>200 docs + ELSER v2"]
Questions["passed_questions<br/>60 questions + ELSER v2"]
AuditLog["passed_audit_log"]
Notifications["passed_notifications"]
end
Reports["๐ Audit Reports<br/>data/reports/*.md"]
Dashboard -->|REST API| ES
RunAudit -->|A2A| Detect
Detect -->|ESQL| ES
Detect -->|Findings| RunAudit
RunAudit -->|A2A| Act
Act -->|Actions| Notifications
RunAudit --> Reports
sequenceDiagram
participant O as Orchestrator
participant D as Detect Agent
participant A as Act Agent
participant ES as Elasticsearch
O->>D: A2A message/send audit prompt
D->>ES: ESQL staleness_scorer
D->>ES: ESQL gap_detector
D->>ES: ESQL contradiction_finder
D->>ES: ESQL expert_risk_finder
D-->>O: Structured findings STALE/GAP/CONTRADICTION/EXPERT_RISK
O->>A: A2A message/send (findings)
A-->>O: ACTION lines + ACTION_SUMMARY
O->>O: Write markdown report
| Feature | Implementation | Purpose |
|---|---|---|
| ES|QL Tools | 4 custom queries in Agent Builder | Detect stale docs, gaps, contradictions, expert risk |
| A2A Protocol | JSON-RPC 2.0 message/send |
Orchestrator โ Agent communication |
| ELSER v2 | semantic_text field type |
Semantic search for contradiction detection |
| Agent Builder | 2 agents with custom system prompts | Detect + Act multi-agent pattern |
| Serverless | Elastic Cloud Serverless | Zero-ops deployment |
Sample audit output from synthetic data:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ PassedAI Audit โ
โ Run ID: 0ec4c448 Window: 90d Top-N: 10 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Detect Results
Category Count
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Stale docs (score โฅ 70) 20
Knowledge gaps 1
Contradiction pairs 2
Expert risk owners 8
Dashboard Screenshot: The Flask UI at localhost:5050 shows real-time stats pulled from Elasticsearch.
PassedAI/
โโโ config/
โ โโโ agent_prompts/ # System prompts for both agents
โ โ โโโ detect_agent.md
โ โ โโโ act_agent.md
โ โโโ esql/ # ES|QL tool queries
โ โ โโโ staleness_scorer.esql
โ โ โโโ gap_detector.esql
โ โ โโโ contradiction_finder.esql
โ โ โโโ expert_risk_finder.esql
โ โโโ index_mappings/ # Elasticsearch index schemas
โโโ data/
โ โโโ generated/ # Synthetic test data
โ โโโ reports/ # Audit output (markdown)
โโโ docs/
โ โโโ kibana_setup.md # Step-by-step Kibana configuration
โโโ orchestrator/
โ โโโ a2a_client.py # A2A protocol client
โ โโโ run_audit.py # Main orchestrator script
โโโ scripts/
โ โโโ generate_synthetic_data.py
โ โโโ ingest.py
โโโ ui/
โ โโโ app.py # Flask dashboard
โ โโโ templates/index.html
โโโ .env.example
โโโ LICENSE (MIT)
โโโ README.md
โโโ requirements.txt
- Python 3.11+
- Elastic Cloud Serverless (free trial)
git clone https://github.com/N-45div/PassedAI.git
cd PassedAI
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env| Variable | Source |
|---|---|
ELASTIC_CLOUD_ID |
Elastic Cloud โ Project โ Manage โ Cloud ID |
ELASTIC_API_KEY |
Elastic Cloud โ API Keys โ Create |
KIBANA_BASE_URL |
Derived from Cloud ID (see docs) |
KIBANA_API_KEY |
Kibana โ Stack Management โ API Keys |
PASSED_DETECT_AGENT_ID |
After creating agent in Kibana |
PASSED_ACT_AGENT_ID |
After creating agent in Kibana |
python scripts/generate_synthetic_data.py
python scripts/ingest.py --resetFollow docs/kibana_setup.md:
- Verify ELSER v2 is running
- Create 4 ES|QL tools
- Create PassedAI-Detect and PassedAI-Act agents
- Copy agent IDs to
.env
python orchestrator/run_audit.py --audit-window-days 90 --top-n-actions 10python ui/app.py
# Open http://localhost:5050The PassedAI-Detect agent runs 4 ES|QL queries in sequence:
- staleness_scorer โ Finds docs with
staleness_score >= 70 - gap_detector โ Finds unanswered questions (knowledge gaps)
- contradiction_finder โ Semantic search for conflicting docs on same topic
- expert_risk_finder โ Aggregates doc ownership to find concentration risk
The PassedAI-Act agent processes findings and outputs structured action logs:
ACTION | notify_owner | doc_id=abc123 | owner=alice@acme.io | issue=stale | score=100
ACTION | notify_owner | topic=data-retention | issue=contradiction | docs=doc1,doc2
The Python orchestrator (run_audit.py):
- Sends audit prompt to Detect agent via A2A
- Parses structured findings
- Sends findings to Act agent via A2A
- Writes markdown report to
data/reports/
-
A2A Protocol Discovery โ Elastic Agent Builder uses
message/sendmethod withkind: "text"parts (nottype). Required debugging the JSON-RPC format. -
Serverless ES Restrictions โ Index mappings can't include
number_of_shards/number_of_replicassettings. Had to remove these for Serverless compatibility. -
ELSER Inference Timeouts โ Bulk ingestion with
semantic_textfields requires longer timeouts (120s) and smaller chunk sizes (10 docs) due to inference processing time.
MIT License โ see LICENSE
Built with:
Built for the Elasticsearch Agent Builder Hackathon ๐