Add .docx support to RAG document loader - #277
Open
pcbeingused333 wants to merge 1 commit into
Open
Conversation
ApusBerliozi
self-requested a review
July 27, 2026 03:09
ApusBerliozi
approved these changes
Jul 27, 2026
Contributor
|
Hey @pcbeingused333! Everything looks good for me. @blkdmr, could you please take a look at this PR as well? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #97 (or: relates to #97 — see note below)
What
Adds Word (
.docx) support tofenn/agents/rag/loader.py, following the samepattern as the existing
_read_pdfloader..docxadded toSUPPORTED_EXTENSIONS_read_filenow routes.docxfiles to a new_read_docxhelper_read_docxextracts text from both paragraphs and table cells usingpython-docxrag-docx = ["python-docx>=1.0.0"](also added torag-all)tests/unit/agents/test_docx_loader.pyHow it was tested
pytest tests/unit/agents/test_docx_loader.py— 6 passing:paragraphs, table cells, empty document → None,
_read_filedelegation,load_documents, and the missing-dependencyImportError.Note / question for maintainers
The existing loader error messages reference
cofone[pdf]/cofone[web], whilethe package is
fennand the extras arerag-pdf/rag-web. I kept the samewording (
cofone[docx]) in the new_read_docxfor consistency with the currentfile — but happy to align everything to
fenn[rag-docx]in this PR (or a separateone) if you prefer. Just let me know which you'd rather have.