Skip to content

Improve PDF extract cleanup and wire hybrid expand for agent search - #55

Merged
chengbiao-jin merged 4 commits into
release_2.0.2from
improve-pdf-extract-and-hybrid-expand
Aug 6, 2026
Merged

Improve PDF extract cleanup and wire hybrid expand for agent search#55
chengbiao-jin merged 4 commits into
release_2.0.2from
improve-pdf-extract-and-hybrid-expand

Conversation

@prinskumar-tigergraph

Copy link
Copy Markdown
Contributor

Description:

Summary

  • Cleaner PDF extract/chunking so chart labels and table numbers survive into the graph (picture-text normalization, unglue numbers, avoid fullwidth-digit collapse, mojibake page recovery).
  • Multimodal image prompt asks for categorical category: value transcription, not trend-only summaries.
  • Agent hybrid_search now honors hybrid_expand / hybrid_method from graph config, and keeps keyword seeds if vector seeding fails.

Why this helps

Better extract → more exact facts in chunks. Hybrid expand (keywords + vector) → agent is more likely to retrieve those chunks for table/chart questions. Together this raises grounded answer quality without question-specific hacks.

@prinskumar-tigergraph
prinskumar-tigergraph force-pushed the improve-pdf-extract-and-hybrid-expand branch from 23ec1c0 to 3a26df3 Compare July 30, 2026 13:40
Normalize picture-text and numeric cleanup, recover mojibake pages, keep chart labels in chunks, and enable keyword+vector hybrid expand for agent search without eval-shaped age-band post-processing.
Avoids an unnecessary rename that noisied the PR diff.
Restore the original OCR figure comment in the chunker to avoid noisy comment-only diff.
… docs.

No measured accuracy gain from these settings in Toppan runs; keep extract/chunk product fixes only.
@prinskumar-tigergraph
prinskumar-tigergraph force-pushed the improve-pdf-extract-and-hybrid-expand branch from 72ac547 to 81ad4af Compare August 4, 2026 13:13
@prinskumar-tigergraph
prinskumar-tigergraph changed the base branch from main to release_2.0.2 August 4, 2026 13:14
@chengbiao-jin
chengbiao-jin self-requested a review August 6, 2026 00:02
@chengbiao-jin
chengbiao-jin merged commit 4d1d752 into release_2.0.2 Aug 6, 2026
1 check failed
@chengbiao-jin
chengbiao-jin deleted the improve-pdf-extract-and-hybrid-expand branch August 6, 2026 20:40
chengbiao-jin added a commit that referenced this pull request Aug 28, 2026
* Recognize Gemini 3.x (and future families) as tool-calling

- The agentic chat engine was silently disabled for Gemini 3.x models
  because the capability check only knew Gemini 1.5/2.x. Any Gemini is
  now treated as tool-calling except the legacy 1.0-era models, so future
  families work without a code change.

Refs: GML-2171

* Fix chat Stop button empty-send and light-theme icon size

- Ignore empty submits so clicking Stop just as an answer finishes no
  longer sends an empty message.
- Size the Stop icon in both light and dark themes; it was styled only
  for dark, so it rendered oversized and broke the layout in light mode.

Refs: GML-2172

* Give the answer-generation fallback a helpful next step

- When an answer can't be generated, suggest retrying or rephrasing and
  point to the administrator, instead of a dead-end message.

Refs: GML-2170

* Fix rebuild crash on document names with parentheses

- Normalize vertex ids without truncating at "(", so names containing
  parentheses keep their chunk suffix and no longer corrupt chunk ids
- Derive the chunk index from the chunk's position instead of parsing it
  back out of the id

Refs: GML-2173

* Bump version to 2.0.2

- Set release version to 2.0.2
- Complete the 2.0.2 changelog with the answer-fallback message
  improvement, Gemini 3.x agentic support, and chat Stop button fixes

* Improve PDF extract cleanup and wire hybrid expand for agent search (#55)

* Improve PDF extract cleanup and wire hybrid expand for agent search.

Normalize picture-text and numeric cleanup, recover mojibake pages, keep chart labels in chunks, and enable keyword+vector hybrid expand for agent search without eval-shaped age-band post-processing.

* Restore _CJK_CHAR_CLASS name; keep fullwidth-digit exclusion.

Avoids an unnecessary rename that noisied the PR diff.

* Document hybrid expand knobs in docs; drop Toppan server_config from PR.

Restore the original OCR figure comment in the chunker to avoid noisy comment-only diff.

* Remove unused hybrid_expand/hybrid_method wiring from agent tools and docs.

No measured accuracy gain from these settings in Toppan runs; keep extract/chunk product fixes only.

---------

Co-authored-by: Prins Kumar <prins.kumar@agivant.com>

* Fix Est. Cost showing $0 for models missing from LangChain pricing. (#57)

* Fix Est. Cost showing $0 for models missing from LangChain pricing.

Fall back to LiteLLM catalog rates when LangChain total_cost is 0, for the configured model only.

* Use configured llm_service for LiteLLM pricing lookup.

Avoid scanning all provider prefixes when the server config already names the provider.

* Replace LiteLLM cost fallback with user-configured rates from LLM Config.

When input/output USD-per-1M rates are set, always use them for Est. Cost; otherwise keep LangChain pricing.

---------

Co-authored-by: Prins Kumar <prins.kumar@agivant.com>

* Fix token-cost rate inheritance and document 2.0.2 changes

- Completion input/output token-cost rates are no longer inherited by a
  same-provider embedding service, which is priced separately
- Add changelog entries for configurable token cost rates and for the
  PDF chart/table extraction fidelity improvements

* Add Recall@5 regression metric with Multihop30 dataset (#59)

* Add Recall@5 regression metric with Multihop30 dataset

- New recall_evaluator.py: computes Recall@K by querying GraphRAG and
  matching retrieved chunks against ground-truth chunks using embedding
  cosine similarity (threshold=0.70) or LLM judge
- New run_recall.sh: Docker wrapper to run recall evaluation
- New Multihop30 dataset: 30 multi-hop questions (10 each from HotpotQA,
  2WikiMultiHopQA, MuSiQue) with raw text corpus, answers, and
  ground_truth_chunks.csv for retrieval scoring
- Updated evaluator.py, run_eval.sh: unified --mode parameter replacing
  --agent + --search-type
- Updated run_setup.sh, setup_graph.py: support for Multihop30 graph setup

Co-authored-by: Cursor <cursoragent@cursor.com>

* Clean up Multihop30 README — remove stale build scripts and fix file references

Co-authored-by: Cursor <cursoragent@cursor.com>

* Increase evaluator.py httpx timeout from 120s to 600s for complex agentic queries

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Prins Kumar <prinskumar@Prinss-MacBook-Air.local>
Co-authored-by: Cursor <cursoragent@cursor.com>

* GraphRAG 2.0.2: Migration Assistant data-integrity + planned-agent fallback (#60)

* Add Migration Assistant data-integrity health checks

- Report per-vertex-type embedding coverage (missing/total counts) in the
  migration status
- Report the count of communities with placeholder or empty summaries in the
  migration status

Refs: GML-2175, GML-2176

* Add targeted regenerate actions to the Migration Assistant

- Regenerate embeddings: re-embed vertices missing an embedding, skipping
  empty/placeholder source text
- Regenerate community summaries: re-summarize communities with placeholder
  or empty descriptions, then re-embed the new summary
- Both run as targeted operations rather than a full rebuild, and refuse
  while a rebuild is in progress

Refs: GML-2175, GML-2176

* Add Migration Assistant health panel and regenerate buttons

- Show embedding coverage (missing by type) and community-summary
  completeness in the Migration Assistant
- Add "Regenerate embeddings" and "Regenerate summaries" actions that fix
  only the affected items instead of a full rebuild
- Document the new capabilities in the changelog

Refs: GML-2175, GML-2176

* Health check counts without initializing the embedding service

- The embedding-coverage and community-summary checks run count queries
  over the existing connection instead of building an embedding store, so
  the migration status no longer depends on embedding-service startup

Refs: GML-2175, GML-2176

* Fall back to document search when a structured query is empty

- The planned agent runs a hybrid document search when its structured
  query returns no rows, so an empty structured result no longer yields
  a non-answer.
- The fallback follows the existing router-fallback setting, matching
  the classic engine.

* Persist regenerated community summaries

- Regenerating community summaries now writes the new summary text
  directly, so it is saved even when run outside a full rebuild.

* Use placeholder names in regression script examples

- Replace the dataset/graph names in run_eval.sh and run_setup.sh
  usage comments with neutral placeholders.

* Document router-fallback coverage of the planned agent

- Note that the router-fallback setting also governs the planned
  agent's fallback to vector search, not just the classic engine.

* Detect tool-calling support via a cached runtime probe

- Determine whether the chat model can drive Agentic mode with a
  one-time runtime probe cached in memory (re-checked after a restart),
  instead of a fixed model list — so current and future tool-calling
  models, including new providers, enable Agentic mode automatically.
- Keep Agentic mode on by default; downgrade to classic only when the
  probe shows the model can't tool-call, until its configuration changes.
- Fall back to the static heuristic on a transient probe failure.

Refs: GML-2169

* Keep Agentic mode enabled unless the model is known to lack tool-calling

- Default to Agentic on; disable only on positive evidence — a known
  legacy model, an explicit "tools not supported" error, or a runtime
  tool-calling failure. Uncertain probe outcomes (transient, ambiguous,
  timeout, no provider yet) stay enabled and are not cached.
- Time-bound the probe so a slow model can't hang the first request.

Refs: GML-2169

* Align UI package version with the product release

- Bump the graphrag-ui package version to 2.0.2 to match the release.

* Detect embeddable vertex types from the schema's vector attributes

- The Migration Assistant's embedding health check and regenerate-
  embeddings action found no embeddable types, because native vector
  attributes aren't returned by the per-type attribute listing. Detect
  them from the schema's embedding-attribute metadata instead, so the
  health check reports per-type coverage and regeneration re-embeds
  vertices that are missing an embedding.

Refs: GML-2175

* Fall back to classic when an agentic query hits a tool-calling failure

- If the agent fails mid-run with a tool-calling error, disable Agentic
  for that model and answer the request via the classic engine, so a
  model that can't tool-call degrades gracefully instead of erroring.
- Only triggers on a confident tool-support signal; other errors are
  handled as before.

Refs: GML-2169

---------

Co-authored-by: prinskumar-tigergraph <prins.kumar@tigergraph.com>
Co-authored-by: Prins Kumar <prins.kumar@agivant.com>
Co-authored-by: Prins Kumar <prinskumar@Prinss-MacBook-Air.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

3 participants