Design doc: ../PROFILES.md
The when and what's next for domain-aware structuring. Profiles turn the generic heading tree into a typed, navigable map for a specialized domain (research papers, medical guidelines, …).
| Phase | Status |
|---|---|
| Phase 0 — generic baseline (heading tree) | Shipped (the MVP) |
Phase 1 — scaffold + research-paper + medical-guideline |
Not started |
| Phase 2 — domain metadata extraction | Not started |
| Phase 3 — cross-refs + semantic query API | Not started |
The baseline (Phase 0) is what ships today: parsers → heading tree →
per-section summaries → tree retrieval, hardened for real-world PDFs.
Everything below is additive; the generic profile preserves current
behavior with zero regression.
Decisions locked (see design doc): profile
selection is declared → auto → generic; kinds are per-profile over a
fixed core_kind set; figures/tables are metadata refs not nodes;
both first profiles ship in parallel.
Blocker for medical: needs a clean guideline PDF fixture (a real GINA/NICE/WHO doc that isn't encrypted/watermarked). The research path can proceed immediately on the arXiv fixture.
One scaffold, two real profiles validated against their fixtures.
-
pkg/profilepackage-
Profileinterface (Name,Detect,Apply). -
Registrythat routes a document to the best-fit profile (same pattern aspkg/parser); selection order declared → auto-detect (threshold ~0.6) →generic. -
genericprofile — no-op,Kind="". The fallback. -
Kind+CoreKind+CrossRef+DocMetatypes. Fixedcore_kindset: meta / body / reference / appendix / navigation.
-
-
tree.Section:Kind+CoreKindfields;Viewexposes both. - DB:
kind+core_kindcolumns onsections(+ migration, indexed). Reads/writes carry them. - Ingest runs the selected profile after
persistTree(parsing → structuring → summarizing → ready). Idempotent. - API:
X-Vectorless-Profilehonored on upload;profile+ per-sectionkind/core_kindin document + tree responses. -
research-paperprofile-
Detectfrom outline (Abstract + References + IMRaD-ish headings; arXiv/DOI filename hints). No LLM. - Classify — rule pass + one batched LLM call for the residue, bounded by the kind vocabulary.
- Kinds: Abstract, Contributions, RelatedWork, Method, Experiment, Result, Limitation, Conclusion, References, Appendix (→ core_kind mapping).
- Validate on arXiv: ToC shows
[Method] §3 Model Architecture.
-
-
medical-guidelineprofile-
Detectfrom recommendation/evidence-grade phrasing. - Kinds: Recommendation, Evidence, Population, Intervention, Dosage, Contraindication, Monitoring, References.
- Validate against a clean guideline PDF (fixture needed).
-
- Research metadata: datasets, metrics,
figure_refs,table_refs,equation_refsinto sectionmetadata(refs, not nodes — per decision). - Medical metadata:
evidence_grade,condition,drug,population,strength_of_recommendation. - Retrieval becomes profile-aware: pass the profile name + kind glossary into the select prompt.
- Cross-references: citation graph for papers; recommendation
→ evidence for guidelines. Decide
section_refstable vs. metadata edges. - Query API
kinds[]filter: "select only Recommendation sections" — structural filter, no LLM call. - Claim ↔ evidence links surfaced in the map + query results.
-
syntheticprofile (optional): build a tree for structure-less documents (flat OCR) via recursive summarization — no embeddings.
- Auto-detect confidence threshold (start ~0.6, tune on real uploads).
- Re-profiling existing docs when a better profile ships (ties to incremental re-ingest).
- Cross-ref storage: table vs. metadata (Phase 3).
- ../PROFILES.md — the design doc.
- ../ENGINE.md — the engine this builds on.
- ../../ROADMAP.md — root checkbox document.