mirror of
https://github.com/run-llama/notebookllama.git
synced 2026-06-30 22:17:57 -04:00
[PR #31] [MERGED] Refactoring utils.py and creating a document management UI #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/run-llama/notebookllama/pull/31
Author: @AstraBert
Created: 7/13/2025
Status: ✅ Merged
Merged: 7/17/2025
Merged by: @AstraBert
Base:
main← Head:clelia/utils-refactoring-and-document-management📝 Commits (10+)
c9d8db8refactor: refactoring utils; feat: adding document management classf25b3c2feat: add UI666a89fchore: delete try.html and vbumpd1f3944ci: typechecka40a08dchore: implementing suggestionse99ea0cfeat: first implementation of parametrized SQL (untested)ecd9973chore: resolve suggestions + tests2c889acFix boolean evaluation errorca8799bMerge branch 'main' into clelia/utils-refactoring-and-document-managementec7479cci: linting📊 Changes
17 files changed (+778 additions, -337 deletions)
View changed files
📝
pyproject.toml(+2 -1)📝
src/notebookllama/Home.py(+46 -13)➕
src/notebookllama/documents.py(+136 -0)➕
src/notebookllama/mindmap.py(+109 -0)➕
src/notebookllama/pages/1_Document_Management_UI.py(+109 -0)📝
src/notebookllama/pages/2_Document_Chat.py(+1 -1)📝
src/notebookllama/pages/3_Interactive_Table_and_Plot_Visualization.py(+1 -1)📝
src/notebookllama/pages/4_Observability_Dashboard.py(+0 -0)➕
src/notebookllama/processing.py(+148 -0)➕
src/notebookllama/querying.py(+43 -0)📝
src/notebookllama/server.py(+3 -1)➖
src/notebookllama/utils.py(+0 -314)➕
src/notebookllama/verifying.py(+50 -0)➕
tests/test_document_management.py(+77 -0)📝
tests/test_models.py(+30 -3)📝
tests/test_utils.py(+2 -2)📝
uv.lock(+21 -1)📄 Description
Description
Refactoring changes
The
utilsmodule had exploded with hundreds of lines of miscellaneous code that does a lot of different things.To keep it clean and maintainable, I decided to move different functionalities into their own modules, more specifically:
processing.py: everything concerning document processing and related operationsverifying.py: everything concerning claim verificationquerying.py: everything concerning querying the LlamaCloud indexAdding a Document Management UI
Following what is highlighted in #21, we do not have a piece of UI that stores documents processed in the past.
By adding the
pages/2_Document_Management_UI.pypage and thedocuments.pymodule, we address this issue.The solution implemented is the following:
DocumentManagerclass that can import into the database instances ofManagedDocumentcontaining all the details of the processed documents (content, summary, Q&A, bullet points, mind map). The import is done after the document processing workflow inHome.pyhas completed its run.DocumentManagercan export the documents, and we then render them through Streamlit.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.