feat: add remote storage loaders and writers (S3, GCS, Azure Blob, SQL)#1102
Merged
Conversation
CoronRing
force-pushed
the
guan/1090/remote_store
branch
from
May 19, 2026 18:36
4cdece1 to
b354919
Compare
Pooria90
reviewed
May 21, 2026
Pooria90
reviewed
May 21, 2026
Pooria90
reviewed
May 21, 2026
CoronRing
force-pushed
the
guan/1090/remote_store
branch
2 times, most recently
from
May 21, 2026 23:37
5a4c7fe to
57be8ec
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CoronRing
force-pushed
the
guan/1090/remote_store
branch
from
May 21, 2026 23:45
57be8ec to
e0e6f9e
Compare
Pooria90
requested changes
May 22, 2026
Pooria90
left a comment
Contributor
There was a problem hiding this comment.
Good work @CoronRing
I went over the code. A few substantial changes needs to be applied:
- We need to move
loadersandwritersmodules topackages/railtracks/src/railtracks/retrieval/loadersas they are being built on top of Amir's work on loaders. I recommend having all classes for a specific provider under one single module: for example havingloaders/s3.pyandwriters/s3.pyall under ones3.py.
Or we can also have them under aloaders/cloudfolder. We can discuss the structure. - The modules are returning
Chunkwhich is located in our oldvector_storesmodule. That module is deprecated now and will be removed from the framework. The new type that we use for our retrieval module is calledDocumentwhich is located inpackages/railtracks/src/railtracks/retrieval/models.py. Please refer to Amir's loaders for examples. - Please adjust the Base classes, data models, and the docs accordingly.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Railtracks’ retrieval subsystem with new cloud/database document loaders (S3, GCS, Azure Blob, SQL), improves the sync load() wrapper to work inside an active event loop, and adds documentation/navigation for the new storage integrations.
Changes:
- Added new cloud/database loaders under
railtracks.retrieval.loaders.cloud(S3/GCS/Azure Blob/SQL) and re-exported them fromrailtracks.retrieval.loaders. - Updated
BaseDocumentLoader.load()to work when called from within a running event loop (e.g., Jupyter/async contexts). - Added storage integration docs + tutorial pages and updated MkDocs navigation; added unit tests for the new loaders.
Reviewed changes
Copilot reviewed 30 out of 32 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Reformats root deps list; narrows uv workspace members to packages/railtracks. |
| packages/railtracks/tests/unit_tests/retrieval/loaders/test_text_loader.py | Adds a regression test for recursive directory loading. |
| packages/railtracks/tests/unit_tests/retrieval/loaders/test_base.py | Adds async-context test to ensure load() works with a running event loop. |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/test_sql.py | Adds SQLLoader tests using in-memory SQLite. |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/test_s3.py | Adds S3Loader tests (mocked boto3 client). |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/test_gcs.py | Adds GCSLoader tests (mocked google storage client). |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/test_azure_blob.py | Adds AzureBlobLoader tests (mocked Azure SDK). |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/conftest.py | Shared cloud-loader test helpers/mocks + SQLite engine helper. |
| packages/railtracks/tests/unit_tests/retrieval/loaders/cloud/init.py | Declares the cloud loader test package. |
| packages/railtracks/tests/unit_tests/integrations/writers/conftest.py | Adds writer-test fixtures/mocks (though writer tests/impls aren’t present here). |
| packages/railtracks/tests/unit_tests/integrations/writers/init.py | Declares the writers test package. |
| packages/railtracks/src/railtracks/retrieval/models.py | Adds richer Document documentation describing fields/semantics. |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/sql.py | Implements SQLLoader (SQLAlchemy-backed, thread-backed async). |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/s3.py | Implements S3Loader (boto3-backed, thread-backed async). |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/gcs.py | Implements GCSLoader (google-cloud-storage-backed, thread-backed async). |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/azure_blob.py | Implements AzureBlobLoader (azure-storage-blob-backed, thread-backed async). |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/_common.py | Adds shared infer_document_type() helper for cloud keys. |
| packages/railtracks/src/railtracks/retrieval/loaders/cloud/init.py | Exposes cloud loaders via a package __init__. |
| packages/railtracks/src/railtracks/retrieval/loaders/base.py | Makes load() safe to call from inside an already-running event loop. |
| packages/railtracks/src/railtracks/retrieval/loaders/init.py | Re-exports new cloud loaders from retrieval loaders package. |
| packages/railtracks/src/railtracks/integrations/writers/storage_writers.py | Adds writer “examples” module (currently problematic as shipped code). |
| packages/railtracks/src/railtracks/init.py | Exposes the retrieval submodule at the package top level. |
| packages/railtracks/pyproject.toml | Adds new optional extras for aws/gcp/azure-blob/sql and expands integrations/all. |
| mkdocs.yml | Adds nav entries for storage integrations + new tutorial/notebook pages. |
| docs/tutorials/walkthroughs/storage_loaders_tutorial.md | New tutorial: loading from cloud storage into a RAG workflow. |
| docs/tutorials/notebooks/file_embedding.md | New notebook landing page linking to Colab notebooks. |
| docs/scripts/storage_loaders.py | Adds snippet source file for storage loader docs (--8<-- includes). |
| docs/integrations/storage/sql.md | New SQL loader integration documentation. |
| docs/integrations/storage/s3.md | New S3 loader integration documentation. |
| docs/integrations/storage/overview.md | New overview page for supported storage/database loaders. |
| docs/integrations/storage/gcs.md | New GCS loader integration documentation. |
| docs/integrations/storage/azure_blob.md | New Azure Blob loader integration documentation. |
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
reviewed
May 26, 2026
Pooria90
requested changes
May 26, 2026
Conflicts resolved: - models.py: merged docstrings; kept cloud-URI source detail from HEAD, corrected id description (UUID5 from source) and added content_hash docs from feature branch - loaders/__init__.py: kept cloud loaders (HEAD) + BaseOCRLoader, Sanitizer, SanitizingLoader (feature branch) - __init__.py: kept retrieval submodule export; dropped rag/vector_stores exports since those packages are removed by feature branch - mkdocs.yml: kept RAG/Vector Store/Storage Loader nav entries from HEAD
Pooria90
approved these changes
May 27, 2026
CoronRing
commented
May 27, 2026
Copilot stopped work on behalf of
CoronRing due to an error
May 27, 2026 22:13
Contributor
Author
|
closes #1090 |
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.
Summary
S3Loader/GCSLoader/AzureBlobLoader/SQLLoaderrailtracks[aws],railtracks[gcp],railtracks[azure-blob],railtracks[sql]) so the core package stays leanload/aload)with SQLLoader(...) as l) and explicitclose()for engine lifecycle managementSecurity hardening
__init__time — raisesValueErroron any metacharacter ([A-Za-z_][A-Za-z0-9_$]*allowlist, supportsschema.table)ValueErrorwhencontent_columnis missing from query results (was a bareKeyError)__repr__on all classes exposes only non-sensitive fields (bucket/container name); credentials never appear in reprImportErrormessages include bothpip installanduv addformsLimitations documented
WITH …) queries not supported astable_or_query; workaround shown in docsaloadare thread-backed (asyncio.to_thread) not true-async; noted in docs with guidance for high-concurrency casesTest plan
Additional file
Tutorial file are added to ipynb file on colab, not included per requirements for single-location consistency.