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

feat: Add document id and chunk ids to segments fixing order. #52

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

undo76
Copy link
Contributor

@undo76 undo76 commented Nov 25, 2024

Several improvements:

  • We return the document id in the context to make it available to the model. chunk_id and document_id not accessible #50
  • Better reconstruction of segments considering headings hierarchy
  • Fix order of segments. We use the sum of the reciprocal ranks of the chunks by default, while allowing passing a scoring function.
  • Now we write the context in the user prompt, but we can configure to pass it in the system prompt or in a separate system prompt. Order of the system message may prevent caching #49

@undo76 undo76 requested a review from lsorber November 25, 2024 16:30
@undo76 undo76 marked this pull request as draft November 25, 2024 17:32
@undo76 undo76 marked this pull request as ready for review November 25, 2024 22:20
Copy link
Member

@lsorber lsorber left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. It's a fairly big one so I have some more comments than the previous one 😅.

src/raglite/_database.py Outdated Show resolved Hide resolved
src/raglite/_database.py Outdated Show resolved Hide resolved
src/raglite/_database.py Outdated Show resolved Hide resolved
src/raglite/_database.py Outdated Show resolved Hide resolved
src/raglite/_database.py Outdated Show resolved Hide resolved
src/raglite/_rag.py Outdated Show resolved Hide resolved
src/raglite/_rag.py Outdated Show resolved Hide resolved
@undo76 undo76 requested a review from lsorber November 26, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants