Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

feat: Ingest document embeddings for Retrieval augmented generation - #2903

Merged
mergify[bot] merged 1 commit into
instructlab:mainfrom
dmartinol:rag_ingest
Jan 22, 2025
Merged

feat: Ingest document embeddings for Retrieval augmented generation#2903
mergify[bot] merged 1 commit into
instructlab:mainfrom
dmartinol:rag_ingest

Conversation

@dmartinol

@dmartinol dmartinol commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

Issue resolved by this Pull Request:
Resolves #2875
Addresses #2957
Depends on #2832

Dev Docs related to this Pull Request:
Link to Dev Doc or PR: instructlab/dev-docs#161

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Changelog updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Functional tests have been added, if necessary.
  • E2E Workflow tests have been added, if necessary.

Unit test code in the next commit

@mergify mergify Bot added testing Relates to testing dependencies Relates to dependencies ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 10, 2025
@dmartinol
dmartinol marked this pull request as ready for review January 10, 2025 20:31
@mergify mergify Bot added the ci-failure PR has at least one CI failure label Jan 10, 2025
Comment thread src/instructlab/defaults.py Outdated
Comment thread src/instructlab/defaults.py Outdated
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 13, 2025
Comment thread tests/testdata/default_config.yaml Outdated
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jan 14, 2025
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 14, 2025
@dmartinol

Copy link
Copy Markdown
Contributor Author

test coverage:

src/instructlab/cli/rag/__init__.py                                0      0   100%
src/instructlab/cli/rag/ingest.py                                 30      3    90%
src/instructlab/cli/rag/rag.py                                    13      2    85%
src/instructlab/rag/__init__.py                                    0      0   100%
src/instructlab/rag/document_store.py                              7      0   100%
src/instructlab/rag/document_store_factory.py                      9      0   100%
src/instructlab/rag/haystack/component_factory.py                 22      0   100%
src/instructlab/rag/haystack/components/document_splitter.py      52      7    87%
src/instructlab/rag/haystack/document_store_factory.py             9      0   100%
src/instructlab/rag/haystack/document_store_ingestor.py           42      3    93%
src/instructlab/rag/haystack/document_store_retriever.py          27      0   100%
src/instructlab/rag/taxonomy_utils.py                             16      0   100%

@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 15, 2025
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 16, 2025
@mergify mergify Bot added the ci-failure PR has at least one CI failure label Jan 21, 2025
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jan 21, 2025
@mergify mergify Bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 21, 2025
Comment thread src/instructlab/cli/rag/ingest.py Outdated
Comment thread src/instructlab/cli/rag/ingest.py

@cdoern cdoern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nothing jumps out at me, just one comment

Comment thread src/instructlab/rag/taxonomy_utils.py
Comment thread tests/testdata/default_config.yaml Outdated
@dmartinol
dmartinol force-pushed the rag_ingest branch 2 times, most recently from f52da9b to 4601aeb Compare January 21, 2025 21:54
@mergify mergify Bot added one-approval PR has one approval from a maintainer ci-failure PR has at least one CI failure labels Jan 21, 2025
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jan 22, 2025
@dmartinol

Copy link
Copy Markdown
Contributor Author

@anastasds I integrated changes for RAG CLI.
Note that I renamed the embedding-model-name argument to embedding-model-path as we agreed in the slack channel with @jwm4 (applied to all chat modules as well)

@cdoern cdoern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good! I think we can always iterate on this over time, but I'd like to get this in so we can add e2e testing on top of all the new RAG features.

@mergify mergify Bot added ci-failure PR has at least one CI failure and removed one-approval PR has one approval from a maintainer labels Jan 22, 2025
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label Jan 22, 2025
mergify Bot added a commit that referenced this pull request Jan 22, 2025
**Issue resolved by this Pull Request:**
Resolves #2957

Changes related to `ingest` CLI will be added to #2903

**Checklist:**

- [x] **Commit Message Formatting**: Commit titles and messages follow guidelines in the
  [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).
- [ ] [Changelog](https://github.com/instructlab/instructlab/blob/main/CHANGELOG.md) updated with breaking and/or notable changes for the next minor release.
- [ ] Documentation has been updated, if necessary.
- [ ] Unit tests have been added, if necessary.
- [ ] Functional tests have been added, if necessary.
- [ ] E2E Workflow tests have been added, if necessary.



Approved-by: cdoern

Approved-by: nathan-weinberg

@alinaryan alinaryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! one non blocking nit

@clickext.display_params
def convert(
ctx,
ctx, # pylint: disable=unused-argument

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: unless it's required for some other reason, you should be able to remove ctx, the pylint comment and @click.pass_context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since I did not develop the command but just hit this linting issue (not sure why passed the CI), I preferred (for now) to just solve it this way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW, I think removing the arg would be better. I accidentally left it in after getting rid of the code that used it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(But I am fine saying that should go into a future PR and not this one if you prefer)

@mergify
mergify Bot merged commit 3db4dd4 into instructlab:main Jan 22, 2025
mergify Bot added a commit that referenced this pull request Jan 23, 2025
Related ADR: instructlab/dev-docs#178
Depends on #2886 , #2903 
Resolves #2888 

* Adds feature gating following the pattern in the ADR linked above
* Adds an `@dev_preview` decorator that mocks the feature scope environment variable for specific tests covering experimental functionality. 
* Adds unit tests verifying that RAG related functionality gives a useful and accurate error message when attempted to be used without being enabled.


Approved-by: nathan-weinberg

Approved-by: cdoern
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Relates to dependencies testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RAG][Dev] Implement data ingest

7 participants