Skip to content

feat(rag): expose reasoning trace via public run_with_trace()#39

Open
pjmalandrino wants to merge 1 commit into
docling-project:mainfrom
pjmalandrino:dev/rag-run-with-trace
Open

feat(rag): expose reasoning trace via public run_with_trace()#39
pjmalandrino wants to merge 1 commit into
docling-project:mainfrom
pjmalandrino:dev/rag-run-with-trace

Conversation

@pjmalandrino

Copy link
Copy Markdown

Add RAGTrace model (query, per_document, final_answer) and a public run_with_trace() method on DoclingRAGAgent returning the full per-iteration trace that was previously discarded inside run().

run() becomes a thin wrapper around run_with_trace(): single source of truth for the loop, no behavior change for existing callers.

RAGTrace, RAGResult and RAGIteration are re-exported at package level so downstream consumers can type-hint against the trace.

Closes #26

Add RAGTrace model (query, per_document, final_answer) and a public
run_with_trace() method on DoclingRAGAgent returning the full
per-iteration trace that was previously discarded inside run().

run() becomes a thin wrapper around run_with_trace(): single source
of truth for the loop, no behavior change for existing callers.

RAGTrace, RAGResult and RAGIteration are re-exported at package level
so downstream consumers can type-hint against the trace.

Closes docling-project#26

Signed-off-by: Pier-Jean Malandrino <pierjean.malandrino@scub.net>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @pjmalandrino, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 1
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 1

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

RAG: public method exposing the reasoning trace

1 participant