-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Grand refactoring of the AI features #15688
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
Changes from 250 commits
52ce8f1
0803345
79a6df3
5c7d11a
bc5ebfe
cb2b08d
55bb1aa
ea09dc6
a00b9ac
02ff6ff
3dc512b
2398f4e
edb3d4e
90a2eaa
67ef0a0
6f8c361
e40cb01
ad9757e
9fefac2
57a81de
0e2e03f
b3cbda9
3e59ef9
e638de3
b346a29
37562df
6bb421b
1b79445
d9eb817
6382b62
af1f4f3
e7c66a0
c8a3e7d
e7ca964
0969f8f
7e87908
cd7a7ba
a001545
de98d83
c49a904
42f832c
2ef6fa8
f8ecd53
5c50a6d
e1b6eea
248c324
b5b404e
1bbbe72
be3eb71
c0d5db0
6e8e11a
85b5bb9
58bc248
d402a79
810d8b0
639748e
bc40a43
619f22c
eb62e20
2784ddb
051a9fb
fb5cc8d
8919106
1ccfc3e
d856055
c38d529
073f7d8
c4550d5
e690a65
abfd737
f4b808d
44e6abf
1e6f8e2
cf4ffb8
5d5e6f2
4610fcb
d44de0b
7b27d51
2af3303
d6a5a0a
0011b49
c0fa43e
7be33e5
3d058dd
7c2844f
7830a21
6ca5f63
0ff6310
a72ec17
87c6622
42ea039
819c2bf
f92b21e
9749dde
2eff7a7
2b9ef40
b2b8df7
d8ac13c
ac6607d
0d2d661
7087ef3
76991c4
e2c3084
cc3316d
d9a12e6
d2ba0da
1e2de88
db1415d
2d1d3aa
e638abd
1c14365
03d1071
87ba960
f674697
53e6324
fadb61c
ba75fe2
889fc3d
675350a
4664cb1
604b656
ae3241f
6417ebb
880c3c1
1646292
1ba5794
3abb140
31fe467
422d92e
33f125f
fbce38d
e6533e5
2db56d7
e0c7d7e
dc241a1
d1b3862
4ad31ba
b5a9498
a1f5b40
e86f51a
378958c
eedff09
a7ec558
4e3efc2
37d6fd4
a81e2b2
e022213
937632a
dc3e977
41336bd
59e0037
c898b6c
df3a541
020b180
b9550f6
8aec688
d89bc33
f189fc7
884a822
ce0022d
69c67c2
4ee03ea
96893e1
396376e
f90a002
f287dcf
cf0eef1
5ed90c4
abb2c3b
b425505
d4c21b9
2c4547a
bd4a2ca
c7a9c9f
8d33c1e
cd5d26f
e3342a7
e8e0a28
7f1aea2
1ace5c9
4c0c8dc
36fcedf
ad45161
1203ec4
d1b687b
8ef5d11
acfbfda
9c7a535
7af78d4
60eaa47
ebbfe9d
28dd5b0
a79abc0
c0f9533
d3b6947
188d7e1
14fbd67
9693f40
fefce14
a0d172e
4f66e5e
3b4d23b
8119660
5bc1ab2
597f0fa
2a3a700
0ea7dbd
1666477
c8393b4
48dafe7
7e0048f
5b6ba98
7a3eccc
9a328f9
6d971c5
eb27921
039d829
8ad81bc
9efce94
fcf1a08
accad0b
a8b1931
40ed7d6
d95af78
a3c88d0
f476826
23c43f9
5dfb52e
2048323
1a240b9
cccde54
51e2dde
0c15308
5965d9f
6397848
779f265
1c5cb1f
d41c599
4c968cf
1d4736b
1a063fb
ad6fe00
00201b4
fbc5ea8
6c41ec6
36761f4
75c4cca
474e2f4
1cb86ad
5232fa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,12 @@ | |
|
|
||
| ### Added | ||
|
|
||
| <<<<<<< refactor/ai-1 | ||
| - We added support for selecting answer engines and summarization algorithms, allowing users to change the underlying AI behavior. [#15688](https://github.com/JabRef/jabref/pull/15688) | ||
|
Check failure on line 15 in CHANGELOG.md
|
||
| ======= | ||
| - We added a new data format and property selection feature, enabling users to select one or more field properties for custom fields. [#9840](https://github.com/JabRef/jabref/issues/9840) | ||
|
Check failure on line 17 in CHANGELOG.md
|
||
| >>>>>>> main | ||
| - We fixed a glitch with the sidepane divider position on startup. [#15394](https://github.com/JabRef/jabref/issues/15394) | ||
|
Check failure on line 19 in CHANGELOG.md
|
||
| - We added a label to the Group dropdown in the Import Dialog. [#15567](https://github.com/JabRef/jabref/issues/15567) | ||
| - We added a related work text extractor, which finds and inserts the related work text into bib entries from references in the texts. [#9840](https://github.com/JabRef/jabref/issues/9840) | ||
| - We added a hover button on group rows to quickly add a new group or subgroup. [#12289](https://github.com/JabRef/jabref/issues/12289) | ||
|
|
@@ -36,6 +40,7 @@ | |
|
|
||
| ### Changed | ||
|
|
||
| - We refactored and enhanced the code of AI features. [#15688](https://github.com/JabRef/jabref/pull/15688) | ||
|
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
Outdated
|
||
| - We replaced deprecated Gemini Models from the AI chat model selection and with current ones. [#15398](https://github.com/JabRef/jabref/issues/15398) | ||
| - We changed CSL reference format by adding citation type at the end. [#15370](https://github.com/JabRef/jabref/issues/15370) [#15434](https://github.com/JabRef/jabref/issues/15434) | ||
| - We changed the groups filter field to use a filter icon. [#15402](https://github.com/JabRef/jabref/issues/15402) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| nav_order: 0056 | ||
| parent: Decision Records | ||
| --- | ||
| # Implementation of embeddings in JabRef | ||
|
InAnYan marked this conversation as resolved.
Outdated
|
||
|
|
||
| <!-- dsn->feat~ai.answer-engines.embeddings-search~1 --> | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| JabRef needs to implement embedding models to perform Retrieval-Augmented Generation (RAG) by generating embeddings for chunks of papers. The AI ecosystem in Java is not as diverse or developed as it is in Python, which limits the available tools for this task. | ||
|
|
||
| We need to decide how to design this integration to balance ease of development with the constraints of a desktop application. | ||
|
|
||
| The features that we need are: | ||
|
|
||
| 1. Ability to find models. | ||
| 2. Ability to download models. | ||
| 3. Ability to execute inference on models. | ||
|
|
||
| ## Decision Drivers | ||
|
|
||
| * The approach should not require additional setup from the user side | ||
| * It should be cross-platform | ||
| * It should support a wide variety of model architectures | ||
| * It should have an easy-to-use API | ||
| * The request that embedding libraries make should be known and controlled | ||
| * We should know how and where some library downloads and stores models | ||
|
|
||
| ## Considered Options | ||
|
|
||
| * Custom implementation | ||
| * Use a mix of custom implementation and an inference library | ||
| * Use a comprehensive library | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Chosen option: "Use a comprehensive library", because it is the standard approach in software engineering to rely on specialized libraries for complex tasks rather than re-implementing them. It allows us to delegate the heavy lifting of model management and inference to a dedicated tool. | ||
|
|
||
| ### Consequences | ||
|
|
||
| * Good, because it reduces the maintenance burden on the JabRef team | ||
| * Good, because we do not have to implement complex inference algorithms ourselves | ||
| * Bad, because we are dependent on the external library for updates and maintenance | ||
| * Bad, because it is not easy to find such a library in Java ecosystem | ||
|
|
||
| ## Pros and Cons of the Options | ||
|
|
||
| ### Custom implementation | ||
|
|
||
| * Good, because it will just work (no strange issues with PyTorch or ONNX, etc.) | ||
| * Bad, because it is a lot of work | ||
| * Bad, because for each architecture of embedding models we would have to write code | ||
|
|
||
| ### Use a mix of custom implementation and an inference library | ||
|
|
||
| In this approach we manually implement the features 1 and 2, while relying on an inference library for 3. | ||
|
|
||
| * Good, because complex computations are delegated to another library | ||
| * Good, because we are in full control of data (network rquests, model storage) | ||
| * Bad, because an inference library might be too scientifically centered with a complex API | ||
| * Bad, because we have to write code to find the models, which is not easy | ||
| * Bad, because the inference engine might not provide every tool needed | ||
|
|
||
| ### Use a comprehensive library | ||
|
|
||
| * Good, because this doesn't require custom code | ||
| * Good, because this is the right approach from software engineering POV | ||
| * Good, because it implements all features | ||
| * Good, because we delegate responsibilities to another library | ||
| * Neutral, because there is a small number of libraries for Java for these tasks | ||
| * Bad, because it might make untraceable requests to network | ||
| * Bad, because the storage of the models might be not customizable | ||
|
|
||
| ## More information | ||
|
|
||
| This ADR is highly related to [ADR 0037 - RAG Architecture Implementation](./0037-rag-architecture-implementation.md). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| nav_order: 0057 | ||
| parent: Decision Records | ||
| --- | ||
| # Choice of an embedding library | ||
|
InAnYan marked this conversation as resolved.
Outdated
|
||
|
|
||
| <!-- dsn->feat~ai.answer-engines.embeddings-search~1 --> | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| Following the decision to use a comprehensive library for embedding implementation (see [ADR 0056](./0056-embedding-implementation-approach.md)), we must select a specific Java library. | ||
|
|
||
| The features that the library must support are described in "Context and Problem Statement" section of the [ADR 0056](./0056-embedding-implementation-approach.md). | ||
|
|
||
| The Java AI ecosystem is not as diverse as the Python AI ecosystem, so the choice must be careful to ensure stability and ease of use for end users. | ||
|
|
||
| ## Decision Drivers | ||
|
|
||
| * The library should not require additional setup from the user side | ||
| * It should be cross-platform | ||
| * It should support a wide variety of model architectures | ||
| * It should have an easy-to-use API | ||
| * The request that the library makes should be known and controlled | ||
| * We should know how and where the library downloads and stores models | ||
|
|
||
| ## Considered Options | ||
|
|
||
| * LangChain4j | ||
| * ONNX Runtime | ||
| * Deep Java Library (DJL) | ||
| * DeepLearning4j | ||
|
|
||
| ## Decision Outcome | ||
|
|
||
| Chosen option: "Deep Java Library (DJL)", because it satisfies all our requirements for an all-in-one solution that handles model management and inference. | ||
|
|
||
| However, users have reported problems with the PyTorch engine integration and unstable behavior. Moreover, its API is a bit complex. | ||
|
|
||
| ### Consequences | ||
|
|
||
| * Good, because it has an API to show available models | ||
| * Good, because it handles model downloading automatically | ||
| * Neutral, because the API is complex | ||
| * Bad, because users have reported problems with the PyTorch engine integration and unstable behavior | ||
|
|
||
| ## Pros and Cons of the Options | ||
|
|
||
| ### LangChain4j | ||
|
|
||
| * Good, because it offers a high-level abstraction for LLM workflows | ||
| * Neutral, because it actually wraps other libraries like DJL or ONNX Runtime for the embeddings | ||
| * Bad, because it is a general LLM framework | ||
|
|
||
| ### ONNX Runtime | ||
|
|
||
| * Good, because it is fast and efficient | ||
| * Bad, because it is a low-level inference engine and does not provide model management or downloading features out of the box | ||
| * Bad, because it supplies all binaries for different platforms at once and also supply debugging symbols, which makes it larger than necessary (see [this issue in LangChain4j repository](https://github.com/langchain4j/langchain4j/issues/1492) and [this issue in ONNX repository](https://github.com/langchain4j/langchain4j/issues/1492)) | ||
|
|
||
| ### Deep Java Library (DJL) | ||
|
|
||
| * Good, because it supports multiple engines including PyTorch and ONNX | ||
| * Good, because it has a built-in model zoo for downloading models | ||
| * Neutral, because its API is a bit complex | ||
| * Bad, because of reported stability issues with certain engines | ||
Uh oh!
There was an error while loading. Please reload this page.