Skip to content

refactor: agent architecture and documentation improvements#34

Open
ceberam wants to merge 4 commits into
mainfrom
dev/agentic-rag
Open

refactor: agent architecture and documentation improvements#34
ceberam wants to merge 4 commits into
mainfrom
dev/agentic-rag

Conversation

@ceberam

@ceberam ceberam commented Jun 2, 2026

Copy link
Copy Markdown
Member

This PR includes architectural improvements and comprehensive documentation enhancements across the agent system.

Resolves #40

Commits Included

  1. Enable multi-document and page-level reasoning

    • Added support for multi-document RAG queries
    • Implemented page-level reasoning as an alternative to section-level
    • Enhanced document selection capabilities
  2. Refactor agent classes to inherit from ABC

    • Breaking Change: Refactored BaseDoclingAgent from Pydantic BaseModel to Python's Abstract Base Class (ABC)
    • Updated all agent classes (DoclingRAGAgent, DoclingEnrichingAgent, DoclingEditingAgent, DoclingWritingAgent, DoclingExtractingAgent, DoclingOrchestratorAgent) to inherit from ABC
    • Proper separation of concerns: ABC for agent behavior, Pydantic models for data validation only
    • Made last_operation private (_last_operation) in DoclingEnrichingAgent
  3. Update uv.lock dependencies

    • Updated project dependencies
  4. Documentation improvements

    • Pydantic Models: Updated all Pydantic models to use Annotated[type, Field(description="...")] pattern for better field documentation
    • Type Annotations: Added complete type annotations to all methods
    • Google-Style Docstrings: Verified and maintained Google-style docstrings across all agent modules

Testing

  • All 108 tests passing
  • No breaking changes to public APIs (except BaseDoclingAgent inheritance change)
  • Verified backward compatibility for agent instantiation and usage

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

DCO Check Passed

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

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.80519% with 85 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling_agent/agent/rag.py 13.63% 76 Missing ⚠️
docling_agent/agent/enricher.py 60.00% 4 Missing ⚠️
docling_agent/agent/extractor.py 50.00% 4 Missing ⚠️
docling_agent/agent/orchestrator.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mergify

mergify Bot commented Jun 2, 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)(?:\(.+\))?(!)?:

ceberam added 2 commits June 10, 2026 11:34
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
ceberam added 2 commits June 12, 2026 17:45
Refactor agents from Pydantic BaseModel to python's abstract base class.
Remove unused variables and attributes.
Add or edit docstrings
Review type annotations.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
@ceberam ceberam marked this pull request as ready for review June 12, 2026 15:53
@ceberam ceberam requested a review from PeterStaar-IBM June 12, 2026 15:54
@ceberam ceberam changed the title feat(rag): enable multi-document and page-level reasoning refactor: agent architecture and documentation improvements Jun 12, 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.

Refactor BaseDoclingAgent from Pydantic BaseModel to Abstract Base Class (ABC)

1 participant