Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add chunker job to support configurable chunking #3093

Merged
merged 16 commits into from
Feb 19, 2024

Conversation

yonitoo
Copy link
Contributor

@yonitoo yonitoo commented Feb 7, 2024

What: Extend the pgvector-embedder by adding configurable chunking mechanism.

Why: Until now, the whole documents were embedded and ingested into the database but their size sometimes exceed the token limit imposed by the LLM used for inference. This change introduces a configurable document chunking mechanism to overcome this problem.

Testing Done: Ran the pipeline jobs locally.

Closes #3084

Signed-off by: Yoan Salambashev [email protected]

Copy link
Collaborator

@duyguHsnHsn duyguHsnHsn left a comment

Choose a reason for hiding this comment

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

Looks amazing! Good work

@yonitoo yonitoo changed the title examples: extend pgvector-embedder to support configurable chunking examples: add chunker job to support configurable chunking Feb 16, 2024
Copy link
Collaborator

@antoniivanov antoniivanov left a comment

Choose a reason for hiding this comment

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

How did you test it?

Looks ok. I just want to make sure it's tested properly before approving. All my other comments are minor things about documentation or adding comments.

Copy link
Collaborator

@antoniivanov antoniivanov left a comment

Choose a reason for hiding this comment

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

Let's merge it in whatever stable state it could be.

But a few things to note:

The current fixed splitting is splitting the text in the middle of a word/sentence which I am not sure how good it would affect the RAG app. We should test end to end.

It would be really good idea to add the metadata to each chunk (when creating embeddings ).

We should see to change the ID - as you can have multiple chunks per document so the ID should be composite

The default CHUNK_SIZE should be probably like 2048 and default overlap 64. As most LLMs have token limit like 4000.

yonitoo and others added 13 commits February 19, 2024 15:41
Signed-off by: Yoan Salambashev <[email protected]>
Signed-off by: Yoan Salambashev <[email protected]>
Please enter the commit message for your changes. Lines starting
…late from 5.10.0 to 5.11.0 in /projects/control-service/projects/pipelines_control_service (#3112)

Bumps net.javacrumbs.shedlock:shedlock-provider-jdbc-template from
5.10.0 to 5.11.0.

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=net.javacrumbs.shedlock:shedlock-provider-jdbc-template&package-manager=gradle&previous-version=5.10.0&new-version=5.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off by: Yoan Salambashev <[email protected]>
Signed-off by: Yoan Salambashev <[email protected]>
@yonitoo yonitoo force-pushed the topic/ysalambashev/chunking branch from 935295d to 0e57a23 Compare February 19, 2024 14:01
@yonitoo yonitoo merged commit e1e76ba into main Feb 19, 2024
9 of 10 checks passed
@yonitoo yonitoo deleted the topic/ysalambashev/chunking branch February 19, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce document chunking mechanism prior to embedding within the RAG pipeline
5 participants