Skip to content

refactor: agent architecture and documentation improvements#34

Merged
ceberam merged 4 commits into
mainfrom
dev/agentic-rag
Jun 15, 2026
Merged

refactor: agent architecture and documentation improvements#34
ceberam merged 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.

🟢 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)(?:\(.+\))?(!)?:

🟢 Require two reviewer for test updates

Wonderful, this rule succeeded.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 1

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

@PeterStaar-IBM PeterStaar-IBM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ceberam ceberam merged commit 4af1092 into main Jun 15, 2026
11 checks passed
@ceberam ceberam deleted the dev/agentic-rag branch June 15, 2026 07:39
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)

2 participants