-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
GSoC 2024 ‐ AI‐Powered Summarization and “Interaction” with Academic Papers
Student | Ruslan Popov |
---|---|
Organization | JabRef e.V. |
Primary repository | JabRef/jabref |
Project name | AI-Powered Summarization and “Interaction” with Academic Papers |
Project mentors | @koppor, @ThiloteE, @Calixtus |
Project page | Google Summer of Code Project Page |
Status | Complete |
During my Google Summer of Code (GSoC) project, I was working on enhancing JabRef with AI features to assist researchers in their work. Given the current popularity and enhanced usability of AI technologies, my mentors and I aimed to integrate Large Language Models (LLMs) that would analyze research papers.
To achieve this, the project introduced three core AI features:
- Chatting with Library Entries. This feature allows users to interact with their library entries through a chat interface. Users can ask questions about specific papers, and the AI will provide relevant answers, making it easier to find and process information without manually searching through the text.
- Generating Summaries. The summarization feature provides a concise overview of research papers. This helps researchers quickly understand the content of a paper before deciding whether to read it in full, saving time and effort.
- Supporting Multiple AI Providers. To ensure flexibility and robustness, I integrated support for multiple AI providers. This allows users to choose the AI model that best suits their needs and preferences.
The implementation was primarily done in Java using JavaFX, with the integration of the LangChain4j library (a Java counterpart to the Python-based LangChain). The embedding model part was done with the Java based DeepJavaLibrary.
The AI features developed in this project have the potential to significantly improve the workflow of researchers by providing them with an AI assistant capable of answering questions and generating summaries. This not only saves time but also enhances the overall research process.
There were many challanges during the development of this project, and I developed a lot of skills and knowledge by overcoming them:
- LangChain4j was not easily usable in the JabRef development due to JabRef making use of JDK's modularization features. However, with the 0.33 release of Langchain4j, the problem was solved. Nevertheless, I learned a lot about Java build systems, when we were trying to develop JabRef with older versions of LangChain4j.
- At the beginning, it was not possible to debug JabRef on Windows, because the command line generated by Gradle grew too large. This issue is related to a previous one with split packages. Patching modules introduced a lot of CLI arguments, so Windows could not handle them properly. Moreover, the dependency on LangChain4j introduced new modules (which were added to the command line, too). Handling of long command lines with Gradle was "fixed" by gradle-modules-plugin#282.
- In some cases, our application cannot shutdown, because LangChain4j was running some threads that were not properly closed. That forced us to dive deep into its source code and use
jvm-openai
as the underlying OpenAI client. - In the end, we also found out that the application size with LangChain4j was enormous. The reason for this problem was the usage of ONNX library in LangChain4j, it was supplying all possible implementations for various platforms in one package. Also, it included the debugging symbols for Windows implementation (
.pdb
file that weighed 200 MBs!). To solve this problem, we partially switched todjl
library. - On the frontend side, there is a long-standing issue in JavaFX that text of labels should be selectable/copyable. This severely affects how we develop chat UI because, on one hand, users need a comfortable UI (which can be made with
Label
orText
element), but, on the other hand, users will want a copy feature (which is only available inTextField
orTextArea
components). We still have many issues with the chat UI and scrolling down the messages.
All those issues were unexpected at the beginning of the project, and they caused headaches at my and mentor's side. With having time lost at these unexpected Java ecosystem issues, we could not work on JabRef itself.
Initially, understanding the existing code base and learning best practices was challenging. However, with time and guidance from mentors, I became more proficient. Integrating AI features into the existing application required overcoming numerous bugs and architectural challenges, but most issues were successfully resolved!
Throughout the development process, I gained valuable insights into Software Engineering. I identified and fixed several small bugs in the original JabRef codebase and discovered several issues in other libraries. These experiences have significantly enhanced my problem-solving skills and, especially, understanding of integrating AIs in software applications.
- Сonnect to LLM.
- Store chat history.
- Delete messages.
- Process errors from AI.
- Generating summary in background: just as embeddings generation, with all information needed.
- Handle both small and large documents.
- Handle models with both small and big context window.
- Show the summary and record the time of the genera ted summary and model that was used.
- Add the ability to regenerate summary.
- Tell users that they need to wait before chatting with attached files.
- Generate embeddings in the background: it also shows how much work was and should be done, with ETA estimation.
- Tell users how AI features work.
- Give users link to privacy policies of AI providers.
- Add the ability to agree or disagree (if user doesn't click "I agree", nothing will happen, they can turn off "AI Chat" and "AI Summary" in preferences).
- Choose chat model.
- Supply an API token.
- Choose any provider you like.
- The available model list is updated according to selected AI provider.
- The API token is saved separately for AI providers.
- For Hugging Face there is no supplied list of models (because it's too large), instead users can enter model name manually.
- Users can customize how AI will respond to their requests.
Future features include:
- Introduce AI-assistant search for papers in the context of a research group sharing their references and pdf files using a BibTeX file.
- Support full offline mode (no external access to network).
- Support for external RAG (all the workload for generating and storing embeddings, generating AI answer is offloaded to a separate server). This could be implemented using Microsoft Kernel Memory.
- Integrate scholar.ai, or other services.
- AI chatting functionality.
- Add OpenAI privacy policy.
- Add more organizations related to AI features to PRIVACY.md.
- Add explanation of embeddings.
- AI functionality in JabRef.
- Add AI documentation.
- Update AI documentation.
- Add more explanation for localization in Java code and FXML.
-
Change branches of
scanLabeledControls
. - Support .lnk files for TeXworks.
- Move advanced contribution hints.
- Fix help wanted in adding entry PDFs.
- Add more explanation for localization in Java code and FXML.
- Add docusaurus-lunr-search plugin.
- Implement remove methods for InMemoryEmbeddingStore.
- Support relative paths without parent directory.
- Devdocs don't have favicon.
- Number of indexed files grows after reindexing action.
- "Default library mode" combobox is cut off.
- UI progress indication button is not shown, if at start of JabRef it was hidden.
- JabRef resets window size and position when a dialog occurs.
- Black text in Dark mode inside "Citation information".
- Extra step in documentation.
- scanLabeledControl logic issue.
-
[FEATURE] Add
logRequests
andlogResponses
toHuggingFaceChatModel
. - [FEATURE] Stop document ingestion in the middle of the process.
- [FEATURE] Distribution size of app that uses langchain4j with in-process embedding models.
-
[FEATURE] Add context window size and
estimateNumberOfTokens
toChatLanguageModel
. -
[FEATURE] Make
DocumentSplitter
s to beIterable
s orStream
s. - [FEATURE] Make MessageWindowChatMemory not to remove evicted messages from ChatMemoryStore.
- [FEATURE] Generate new chat IDs automatically as a default parameter.
- [FEATURE] Implement searching on docs website.
- [BUG] FileSystemDocumentLoader cannot handle relative paths without parent directory.
I want to express my gratitude to those people and companies:
- @koppor for mentoring in the project and for raising me as a real developer.
- @ThiloteE for mentoring in the project and for great knowledge of AI ecosystem.
- @calixtus for mentoring in the project and for reviewing and improving my PR.
-
@langchain4j for developing and supporting the
LangChain4j
library. -
@hendrikebbers for raising and fixing the split package problems in
langchain4j
. -
@StefanBratanov for developing the
jvm-openai
library. -
@deepjavalibrary for developing the
djl
library. - OpenAI, Mistral AI, and Hugging Face for their API and models.
- Home
- General Information
- Development
- Please go to our devdocs at https://devdocs.jabref.org
- "Google Summer of Code" project ideas
- Completed "Google Summer of Code" (GSoC) projects
- GSoC 2024 ‐ Improved CSL Support (and more LibreOffice‐JabRef integration enhancements)
- GSoC 2024 - Lucene Search Backend Integration
- GSoC 2024 ‐ AI‐Powered Summarization and “Interaction” with Academic Papers
- GSoC 2022 — Implement a Three Way Merge UI for merging BibTeX entries
- GSoC 2021 - Improve pdf support in JabRef
- GSoC 2021 - Microsoft Word Integration
- GSoc 2019 - Bidirectional Integration — Paper Writing — LaTeX and JabRef 5.0
- GSoC Archive
- Release
- JabCon Archive