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

Implement RAG #92

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

Implement RAG #92

wants to merge 79 commits into from

Conversation

RHeckerIntel
Copy link
Collaborator

@RHeckerIntel RHeckerIntel commented Jan 27, 2025

Implementation of RAG!

Features:

  1. Add documents temporarily to your LLM chat
  2. Create knowledge bases that contain documents so you can easily select the documents in the LLM
  3. Supported document types: pdf, docx, txt, html

Knowledge base:
image

Text generation with temporary file:
image

Text generation using existing knowledge base:
image

It's not robust. Just minimum work to produces embeddings.
Implemented version for LLM and sentence transformer
Also implemented a basic test UI in the knowledge base page just for testing
Adapter for Langchain still needs to be implemented...
Knowledge base should allow the user to add files/folders to a knowledge
base so that it can be used in llm
WIP. Still need to figure out correct way of dealing with this.
Perhaps a provider instead?
The knowledge groups are not separated for RAG yet. It basically pulls
all embeddings regardless of group.
However, its rough, it assumes a hardcoded path to an embedder
Looks like state is not well done thus it doesnt know when it's done.
Just a lot of problems to fix before release but a working prototype.
Still need to be able to remove the documents?
Removed the loader selector and allow the user to toggle files to upload instead
DropArea can take multiple files/directories
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 9.72644% with 297 lines in your changes missing coverage. Please review.

Project coverage is 30.75%. Comparing base (ce2f1ff) to head (62e8881).

Files with missing lines Patch % Lines
lib/providers/text_inference_provider.dart 2.12% 46 Missing ⚠️
lib/interop/sentence_transformer.dart 0.00% 39 Missing ⚠️
lib/langchain/openvino_llm.dart 0.00% 38 Missing ⚠️
lib/langchain/jinja_prompt_template.dart 0.00% 32 Missing ⚠️
lib/langchain/chain_builder.dart 0.00% 28 Missing ⚠️
lib/providers/download_provider.dart 0.00% 26 Missing ⚠️
lib/langchain/all_mini_lm_v6.dart 0.00% 23 Missing ⚠️
lib/langchain/object_box_store.dart 0.00% 20 Missing ⚠️
lib/interop/generated_bindings.dart 0.00% 12 Missing ⚠️
lib/interop/llm_inference.dart 0.00% 9 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
- Coverage   36.22%   30.75%   -5.47%     
==========================================
  Files          43       58      +15     
  Lines        1858     2286     +428     
==========================================
+ Hits          673      703      +30     
- Misses       1185     1583     +398     
Flag Coverage Δ
unittests 30.75% <9.72%> (-5.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RHeckerIntel RHeckerIntel marked this pull request as ready for review January 28, 2025 12:59
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.

1 participant