Skip to content

docs(ai): activate the project semantic graph pipeline — the moat path (plan)#925

Open
seonghobae wants to merge 1 commit into
developfrom
docs/ai-moat-project-graph-activation
Open

docs(ai): activate the project semantic graph pipeline — the moat path (plan)#925
seonghobae wants to merge 1 commit into
developfrom
docs/ai-moat-project-graph-activation

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

The single highest-leverage AI work: the codebase has a wired content-graph substrate (every import persists ContentSegmentRecord) and read/feedback surfaces (api/projects.py /candidates, apply_project_graph_correction) that already assume a project graph — but the extract→persist step is dead code (extract_project_semantics/persist_project_graph_projection have zero non-test callers). So the schema in the middle is never filled outside test fixtures.

Evidence (code-verified)

Piece Status Ref
Content segments persisted per email wired email_import_service.py:307
extract_project_semantics / persist_project_graph_projection dead (0 live callers) project_graph/extractors.py:227, projection.py:11
/candidates read surface reads unfilled tables api/projects.py
Human corrections captured wired apply_project_graph_correction (projection.py:30)
Extractor is keyword/regex, not ML v0 baseline only extractors.py _RULES

Plan (docs-only; matches docs/plans/ convention)

  • Phase 1 — activate: call extract→persist after _append_email_content_graph (line 307), async + owner-scoped + flagged, off the synchronous import critical path. Ships the keyword baseline and makes the projects surfaces honest.
  • Phase 2 — upgrade the keyword extractor to grounded LLM/embedding extraction with source_segment_uids citations (already modeled).
  • Phase 3 — turn apply_project_graph_correction human corrections into a per-tenant eval set + calibrated (verified-against-citations) confidence + an eval harness (there is none today).

Phase 1 is behavior-changing on the import path, so it lands test-first (RED: import → assert project_graph_objects created with correct owner scope + real segment citations). This is the one genuine per-tenant data-moat path in the product.

🤖 Generated with Claude Code

The content-graph substrate is built and wired (email_import_service.py:307
persists ContentSegmentRecord per email), and the projects API + correction
endpoint already read/annotate project_graph_objects — but the extract->persist
step (extract_project_semantics / persist_project_graph_projection) has zero
non-test callers, so the schema is never filled outside fixtures. Plans a phased
activation: (1) wire extract->persist into import, async+owner-scoped+flagged,
(2) upgrade the keyword extractor to grounded LLM/embedding with segment
citations, (3) turn human corrections into an eval set + calibrated confidence.
This is the one genuine per-tenant data-moat path in the codebase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RkKdtHRLG4wSLh6PVsp8J
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant