Skip to content

3.Summary Tree & Retriever Integration#105

Open
santo0 wants to merge 15 commits into
kg-enhancementfrom
kg-summary-tree
Open

3.Summary Tree & Retriever Integration#105
santo0 wants to merge 15 commits into
kg-enhancementfrom
kg-summary-tree

Conversation

@santo0
Copy link
Copy Markdown
Contributor

@santo0 santo0 commented Apr 10, 2026

PRs structure

The PRs depend on the previous ones.

  1. 1.Knowledge Graph Building Pipeline  #97
  2. 2.Canonicalization, Section Tree and KG Retriever #98
  3. Current

SummaryEntry + summary_tree.py
Builds LLM-generated summaries bottom-up across the section tree. Leaf nodes summarize sliding windows of adjacent chunks; internal nodes summarize their children's summaries. All summaries are embedded and persisted as a FAISS index (summary_index.faiss + summary_meta.json) under the run directory.

SectionSummaryRetriever (name="section_summary")
At query time, embeds the query and searches the summary FAISS index. Each matching summary distributes its cosine similarity score to every chunk it covers; a chunk's final score is the max across all hits. Lazy-loads the embedding model on first call.

Update benchmark_retrieval.py
Evaluates all three KG retrievers (kg_node, section_tree, section_summary) plus the existing FAISS/BM25 retrievers against a query set from tests/benchmarks.yaml. Supports optional LLM relevance grading via OpenRouter.

KG and Section retrievers integration in main.py
Each of kg_node, section_tree, and section_summary is only loaded if its weight in ranker_weights is non-zero. CanonicalLookup is built once and shared across KG retrievers.

@santo0 santo0 changed the title Kg summary tree Kg Summary Tree Apr 10, 2026
@santo0 santo0 changed the title Kg Summary Tree Summary Tree & Retriever Integration Apr 10, 2026
@santo0 santo0 marked this pull request as ready for review April 10, 2026 13:59
@santo0
Copy link
Copy Markdown
Contributor Author

santo0 commented Apr 14, 2026

I'm trying to simplify this PR, I will notify when I'm done.

@santo0 santo0 changed the title Summary Tree & Retriever Integration 3.Summary Tree & Retriever Integration Apr 15, 2026
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