Edge-AI and FOLIO at Stanford University Libraries

Edge-AI Next Steps

Retrieval Augmented Generation (RAG)

To improve the quality of LLM outputs and reduce hallucinations, we have begun investigating various Retrieval Augmented Generation (RAG) approaches to FOLIO JSON records.

An initial proof-of-concept for FOLIO RAG was implemented in RAGatouille with mixed results. Since FOLIO (and Airflow) use PostgresSQL database, our next RAG iteration will explore using the PostgresSQL extension, pgvector.

Another option is to utilize the FOLIO search engine which currently supports Elasticsearch or OpenSearch but only for Inventory records.

FOLIO Function-Calling

ChatGPT's function calling feature allows you to define function definitions that the models can use to interact with your API.

Here is an example chat using Invoice Storage raw RAML at instance-storage.raml to create Open AI function definitions in JSON.

Given the large number of FOLIO API endpoints (currently at 1,500!) to manually code using these endpoints is a daunting task. Generating function definitions with a LLM would reduce the manual coding effort while providing a method to keep edge-ai current with the available endpoints as FOLIO updates and adds new endpoints in future releases.


Dynamic DAGs

An intriguing possibility with the current edge-ai and the Airflow-based AI Workflows combination is to generate dynamic DAGs based on the user or system prompts.

The DAGs could be generated, uploaded to Airflow server, and then activated through the Airflow REST API.

Alternative Interfaces

As demonstrated by the file upload example, edge-ai could offer alternative interfaces like uploaded images and even speech to interact with FOLIO. These interfaces could be provided by a mobile app that would allow a user to take a photo and upload it to the edge-ai to start cataloging a physical item.

Another exciting possibility is to enable speech-to-text that would staff users to interact with FOLIO through a speech model like Whisper.