You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want a decided design for PageIndex-style, vectorless / reasoning-based
navigation over long financial documents (10-K/10-Q, prospectuses, research
reports) before writing code. This issue captures the investigation and frames
the design PR; it does not add implementation.
What PageIndex is.VectifyAI/PageIndex
(MIT) reframes retrieval as relevance classification performed by the model
over a document's real structure instead of nearest-neighbor lookup in
embedding space. A document becomes a table-of-contents-like tree (nodes with
title, id, page range, summary, children); a query is answered by an LLM that
reads the tree of titles/summaries, picks a branch, drills down, and lazily
loads leaf text. No embeddings, no chunking, no vector store on the hot path.
It addresses failure modes of vector RAG on structured documents: similarity ≠
relevance, chunk fragmentation, cross-reference blindness ("see Item 7A"), and a
stateless retriever that cannot use prior reasoning.
Current state on master
The direction is already anticipated in the codebase; only the operation is
missing:
quantmind.knowledge documents PageIndex-style reasoning as the explicit
purpose of TreeKnowledge (_tree.py): read root + children summaries, pick a
branch, drill down, lazy-load leaf content; embeddings are a coarse pre-filter,
never a replacement.
contexts/design/library/local.md has a ## PageIndex Boundary; contexts/design/rag/document.md has ## Collection Search and PageIndex.
After the source-first Paper Flow V1 refactor (refactor(paper): add source-first Paper Flow V1 #120), PaperFlowResult has no tree; Paper is not a TreeKnowledge. Any navigation tree must be a new, independently versioned artifact linked to an exact source, not a
revived PaperTree.
Prior art we can reuse
VectifyAI/PageIndex (MIT): TOC detection, recursive node subdivision, the
node schema, and two retrieval paths (single-pass node selection and an
OpenAI Agents SDK tool loop). Reuse subject to license/dependency/contract
review.
Internal FinMind / SmartAsk validated a two-level (document → page) navigation
with two-step model selection and measured gains over an embedding baseline on
FinanceBench. We generalize that to a verified multi-level tree with exact
page-range citations.
Requirements to bake into the design
Multi-model compatibility.master passes cfg.model as a plain string
to agents.Agent(...) with no provider detection, and the only embedding
provider is OpenAI. The design must route all generation through one
provider-agnostic model-resolution seam (Agents SDK LiteLLM integration) and
keep the hybrid pre-filter behind the library's existing _EmbeddingProvider
Protocol — no provider registry.
Hybrid search compatibility. Support "semantic search to shortlist nodes,
then agentic reasoning over that shortlist." Because library already emits
one projection per non-root TreeKnowledge node, search() returns candidate node_ids that can seed agentic navigation with no second index.
A design PR adding contexts/design/mind/navigation.md (ownership split, TreeKnowledge-based tree model with Citation.end_page, deterministic-vs-model
build pipeline, single-pass + agentic navigation, the multi-model and hybrid
seams, import-linter placement, and phasing), plus cross-links from the existing
library and RAG boundary sections.
Context
We want a decided design for PageIndex-style, vectorless / reasoning-based
navigation over long financial documents (10-K/10-Q, prospectuses, research
reports) before writing code. This issue captures the investigation and frames
the design PR; it does not add implementation.
What PageIndex is.
VectifyAI/PageIndex(MIT) reframes retrieval as relevance classification performed by the model
over a document's real structure instead of nearest-neighbor lookup in
embedding space. A document becomes a table-of-contents-like tree (nodes with
title, id, page range, summary, children); a query is answered by an LLM that
reads the tree of titles/summaries, picks a branch, drills down, and lazily
loads leaf text. No embeddings, no chunking, no vector store on the hot path.
It addresses failure modes of vector RAG on structured documents: similarity ≠
relevance, chunk fragmentation, cross-reference blindness ("see Item 7A"), and a
stateless retriever that cannot use prior reasoning.
Current state on
masterThe direction is already anticipated in the codebase; only the operation is
missing:
quantmind.knowledgedocuments PageIndex-style reasoning as the explicitpurpose of
TreeKnowledge(_tree.py): read root + children summaries, pick abranch, drill down, lazy-load leaf content; embeddings are a coarse pre-filter,
never a replacement.
contexts/design/library/local.mdhas a## PageIndex Boundary;contexts/design/rag/document.mdhas## Collection Search and PageIndex.PaperFlowResulthasno tree;
Paperis not aTreeKnowledge. Any navigation tree must be anew, independently versioned artifact linked to an exact source, not a
revived
PaperTree.Prior art we can reuse
VectifyAI/PageIndex(MIT): TOC detection, recursive node subdivision, thenode schema, and two retrieval paths (single-pass node selection and an
OpenAI Agents SDK tool loop). Reuse subject to license/dependency/contract
review.
with two-step model selection and measured gains over an embedding baseline on
FinanceBench. We generalize that to a verified multi-level tree with exact
page-range citations.
Requirements to bake into the design
masterpassescfg.modelas a plain stringto
agents.Agent(...)with no provider detection, and the only embeddingprovider is OpenAI. The design must route all generation through one
provider-agnostic model-resolution seam (Agents SDK LiteLLM integration) and
keep the hybrid pre-filter behind the library's existing
_EmbeddingProviderProtocol — no provider registry.
then agentic reasoning over that shortlist." Because
libraryalready emitsone projection per non-root
TreeKnowledgenode,search()returns candidatenode_ids that can seed agentic navigation with no second index.Relationship to existing issues
feat: page-preserving TreeKnowledge build + agentic navigation), reconciling itsTreeKnowledge-based paper assumption with thepost-refactor(paper): add source-first Paper Flow V1 #120 source-first model.
mindscaffold + import-linter boundary). If unlanded,the implementation adds the minimal
mindpackage enforcingmind -> library -> knowledge.LocalKnowledgeLibrary, closed) and refactor(paper): add source-first Paper Flow V1 #120 (Paper FlowV1).
Deliverable
A design PR adding
contexts/design/mind/navigation.md(ownership split,TreeKnowledge-based tree model withCitation.end_page, deterministic-vs-modelbuild pipeline, single-pass + agentic navigation, the multi-model and hybrid
seams, import-linter placement, and phasing), plus cross-links from the existing
library and RAG boundary sections.