This repository supports my sessions on large language models and their integration into Domino apps. You can find the slides for the sessions below:
- Experimenting with Integrating Large Language Models into Domino Apps" at Engage 2024.
- Integrating Large Language Models into Domino Applications: A Primer at OpenNTF Webinars
- Project Metadata Database: Some of the code requires a project metadata database, which is publicly available as an OpenNTF project.
- Langchain4j-Domino Integration: The project utilizes langchain4j-domino, which will be made publicly available in the near future. Experimental version is here.
- LLM Model Container: The ingestion code leverages the Ollama LLM management tool, preferably installed locally.
- Vector Database: The ingestion target is a Chroma vector database, preferably installed locally.
- OpenAI API: The AiService demos require access to the OpenAI API, along with a valid API key.
- Copy the .env.example file to your user directory, rename it to .env, and add your OpenAI API key.
- Other XPages plugins:
- Prompts and Fewshots Demos: Demonstrations of the basic functionality of the AiService.
- ingestProjectMetadata: Demonstrates how project metadata can be ingested into a vector database.
This XPages application highlights the capabilities of langchain4j through three distinct demonstrations:
1. **Few Shots Example**: A simple use case of the AiService.
1. **Semantic Search**: Demonstrates two variations of semantic search using OLLAMA and OpenAI.
1. **Helpful Assistant**: An advanced example featuring a chat service enhanced with Retrieval-Augmented Generation (RAG) and tooling addons.
To configure the demos:
-
Create an NSF Database: Generate an NSF database from the provided ODP file.
-
Deploy to Domino Server: Place the NSF database on a Domino server and sign it.
-
Prepare Metadata Dataset: Download the OpenNTF Projects Dataset, deploy it to the same server, sign it, and create a full-text index.
-
Set Up Server Properties: Open the xsp.properties file in your server’s data directory and define the following variables:
PMT_METADATA_DB=demos/pmt_metadata.nsf
OLLAMA_URI=http://<ollama-server>:11434
OLLAMA_MODEL=mxbai-embed-large:latest
CHROMA_URI=http://<chroma-server>:8000
langchain4j.OPENAI_API_KEY=<Openai-api-key>
This project has been tested on Java 17 or higher.
If you’re running Apple Silicon computers, use a x86_64 JVM (e.g. IBM Semeru OpenSDK 17) to run the demo databases.