Skip to content

Commit 3a40672

Browse files
Merge branch 'ftr/phase-07-1-KG-Builder' into development
2 parents fd76a32 + f84233a commit 3a40672

File tree

19 files changed

+2832
-27
lines changed

19 files changed

+2832
-27
lines changed

.planning/ROADMAP.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
| 5 | Agent Flow | Real-time visualization, SSE streaming, HITL dialogs | REQ-VIS-001/001a/002, REQ-INF-004 | ✅ COMPLETE |
3131
| 6 | Domain Agents | Financial, Legal, Strategy, Evidence agents, Entity taxonomy, Hypothesis evaluation | REQ-AGENT-003/004/005/006/007c/007d/007h, REQ-HYPO-002/003 | ✅ COMPLETE |
3232
| 7 | Knowledge Storage & Domain Agent Enrichment | DB schema, enriched citations, KG Builder, findings storage, KG API | REQ-AGENT-009, REQ-STORE-001/002, REQ-AGENT-003-006 (enrichment) | ✅ COMPLETE |
33-
| 7.1 | LLM-Based KG Builder Agent | Replace programmatic KG Builder with LLM agent for curated entities + semantic relationships | REQ-AGENT-009 (revised) | ⏳ NOT_STARTED |
33+
| 7.1 | LLM-Based KG Builder Agent | Replace programmatic KG Builder with LLM agent for curated entities + semantic relationships | REQ-AGENT-009 (revised) | ✅ COMPLETE |
3434
| 7.2 | Knowledge Graph Frontend (D3.js Enhancement) | Improve D3.js graph with Epstein-inspired layout, physics, sidebars, filtering, document excerpts | REQ-VIS-003 | ⏳ NOT_STARTED |
3535
| 7.3 | Knowledge Graph Frontend (vis-network) — OPTIONAL | Premium vis-network graph visualization (preserved for experimentation) | REQ-VIS-003 (alternative) | ⏳ DEFERRED |
3636
| 8 | Synthesis Agent & Intelligence Layer | Cross-referencing, hypotheses, contradictions, gaps, timeline, case summary/verdict | REQ-AGENT-008, REQ-HYPO-*, REQ-WOW-*, REQ-VIS-004/005/006, REQ-TASK-001/002 | ⏳ NOT_STARTED |
@@ -681,7 +681,15 @@ Plans:
681681

682682
**Depends on:** Phase 7 (case_findings + raw entities stored, KG API endpoints exist)
683683

684-
**Status:** ⏳ NOT_STARTED
684+
**Status:** ✅ COMPLETE (2026-02-08) — 2 plans, 6 commits, 8/8 must-haves verified
685+
686+
**Verification:** `.planning/phases/07.1-llm-kg-builder-agent/07.1-VERIFICATION.md` — 8/8 must-haves verified
687+
688+
**Plans:** 2 plans in 2 waves
689+
690+
Plans:
691+
- [x] 07.1-01-PLAN.md — DB schema evolution (Alembic migration, ORM columns) + Pydantic schemas (LLM output + API response)
692+
- [x] 07.1-02-PLAN.md — KG Builder agent (runner, factory, prompt, input assembly, DB write) + pipeline wiring
685693

686694
**Context / Why This Change:**
687695
The Phase 7 programmatic KG Builder produces low-quality graphs because:
@@ -1468,6 +1476,7 @@ For 2 developers working simultaneously:
14681476
*Phase 7 complete: 2026-02-07 (6 plans, 11 commits, 8/8 must-haves verified)
14691477
*Phase 7.1 (vis-network) planned: 2026-02-07 (3 plans in 3 waves — SUPERSEDED by architecture revision 2026-02-08)
14701478
*Architecture revision: 2026-02-08 (Programmatic KG Builder → LLM-based KG Builder Agent; D3.js retained+enhanced; vis-network deferred to 7.3)
1471-
*Phase 7.1 (LLM KG Builder) defined: 2026-02-08
1479+
*Phase 7.1 (LLM KG Builder) planned: 2026-02-08 (2 plans in 2 waves)
1480+
*Phase 7.1 (LLM KG Builder) complete: 2026-02-08 (2 plans, 6 commits, 8/8 must-haves verified)
14721481
*Phase 7.2 (D3.js Enhancement) defined: 2026-02-08
14731482
*Phase 7.3 (vis-network, optional) renumbered: 2026-02-08

.planning/STATE.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Holmes Project State
22

33
**Last Updated:** 2026-02-08
4-
**Current Phase:** 7 of 12 (Knowledge Storage & Domain Agent Enrichment) — COMPLETE
5-
**Next Phase:** 7.1 (LLM-Based KG Builder Agent) → 7.2 (D3.js KG Frontend Enhancement) → 8 (Synthesis)
4+
**Current Phase:** 7.1 of 12 (LLM-Based KG Builder Agent) — COMPLETE (2/2 plans)
5+
**Next Phase:** 7.2 (D3.js KG Frontend Enhancement) → 8 (Synthesis)
66
**Current Milestone:** M1 - Holmes v1.0
77

88
## Progress Overview
@@ -18,7 +18,7 @@
1818
| 5 | Agent Flow | COMPLETE | 2026-02-04 | 2026-02-05 | SSE pipeline complete; HITL infra built but verification deferred to Phase 6+ |
1919
| 6 | Domain Agents | COMPLETE | 2026-02-06 | 2026-02-06 | 5 plans (14 commits) + 21 post-plan commits (35 total): refactoring, routing HITL, production hardening, live-testing bugfixes |
2020
| 7 | Knowledge Storage & Domain Agent Enrichment | COMPLETE | 2026-02-07 | 2026-02-07 | 6 plans (11 commits), 8/8 verified: 9 DB models + migration, KG/findings schemas, KG Builder + findings service, prompt enrichment, 10 API endpoints, pipeline wiring |
21-
| 7.1 | LLM-Based KG Builder Agent | NOT_STARTED | - | - | Replaces programmatic KG Builder with LLM agent |
21+
| 7.1 | LLM-Based KG Builder Agent | COMPLETE | 2026-02-08 | 2026-02-08 | 2 plans (4 commits): schema evolution, Pydantic schemas, agent runner/prompt/factory, pipeline wiring |
2222
| 7.2 | KG Frontend (D3.js Enhancement) | NOT_STARTED | - | - | Epstein-inspired D3.js improvements |
2323
| 7.3 | KG Frontend (vis-network) | DEFERRED | - | - | Optional; only if D3.js proves insufficient |
2424
| 8 | Intelligence Layer & Geospatial | NOT_STARTED | - | - | |
@@ -53,8 +53,12 @@
5353
- vis-network deferred to optional Phase 7.3
5454
- New phase structure: 7.1 (LLM KG Builder) → 7.2 (D3.js Enhancement) → 7.3 (vis-network, optional)
5555

56+
**Phase 7.1 Complete** (2026-02-08): LLM-Based KG Builder Agent -- 2 plans, 4 commits
57+
- Plan 01: Alembic migration adding 10 new nullable columns + KgBuilderOutput Pydantic schemas with integer ID cross-referencing
58+
- Plan 02: KgBuilderAgentRunner with text-only input, KG_BUILDER_SYSTEM_PROMPT (8+1 entity taxonomy), AgentFactory.create_kg_builder_agent(), DB writer with clear-and-rebuild, pipeline Stage 7 replaced with LLM invocation
59+
- Full pipeline: Triage -> Orchestrator -> Domain -> Strategy -> HITL -> Save Findings -> LLM KG Builder -> Backfill Entity IDs -> Final
60+
5661
**What's next:**
57-
- Phase 7.1: LLM-Based KG Builder Agent — replace programmatic KG Builder with LLM agent for curated entities + semantic relationships
5862
- Phase 7.2: D3.js KG Frontend Enhancement — Epstein-inspired layout, physics, sidebars, filtering, document excerpts
5963
- Phase 8: Synthesis Agent & Intelligence Layer — cross-referencing, hypotheses, contradictions, gaps, timeline
6064

@@ -366,6 +370,11 @@ All frontend features need these backend endpoints:
366370
| Findings search route ordering | Before /{finding_id} vs After | Before /{finding_id} | Prevents FastAPI treating "search" as UUID path param |
367371
| KG API data access | Direct model queries vs Service layer | Direct model queries | Simple CRUD doesn't need service abstraction; findings uses service for complex search |
368372
| EntityCreateRequest metadata mapping | Direct field vs Renamed | metadata -> properties | Schema field "metadata" maps to DB column "properties" (SQLAlchemy reserved attribute) |
373+
| KG Builder entity cross-referencing | Name matching vs Integer IDs | Integer IDs (1, 2, 3...) | Eliminates name-matching inconsistencies; LLM assigns sequential IDs, mapped to DB UUIDs during write |
374+
| KG Builder input format | Multimodal files vs Text-only | Text-only (findings + entities + case description) | Domain agents already processed raw evidence; KG Builder only needs pre-processed text |
375+
| KG Builder rebuild strategy | Incremental merge vs Clear-and-rebuild | Clear-and-rebuild | Clean slate every run; delete all KG data then insert curated LLM output |
376+
| KG Builder failure handling | Block pipeline vs Non-blocking | Non-blocking (try/except, continue) | KG Builder failure emits SSE error, pipeline continues; KG page shows empty state |
377+
| KG Builder media resolution | HIGH vs None | None (text-only input) | No generate_content_config needed; KG Builder receives text, not files |
369378

370379
---
371380

@@ -378,7 +387,7 @@ None currently.
378387
## Session Continuity
379388

380389
Last session: 2026-02-08
381-
Stopped at: Architecture revision complete (Phases 7.1-7.3 restructured); ready to begin Phase 7.1 (LLM KG Builder Agent)
390+
Stopped at: Completed 07.1-02-PLAN.md (KG Builder agent runner, prompt, pipeline wiring)
382391
Resume file: None
383392

384393
---

0 commit comments

Comments
 (0)