Skip to content

Genie Flow

The Genie Flow Framework is intended to make it easy to design and implement dialogues between a Human actor and an LLM. Such dialogue is typically directed through a number of stages. Often they start with a preamble, then some information retrieval, some conclusion building and an epilogue.

Keeping that state in check: what prompt should be used, given what has been discussed so far, is not trivial. And when implemented using simple if / then / else logic, the code becomes hard to maintain.

This package aims to simplify and streamline the creation of dialogue flows that have a user interact with an LLM.

The main concept of Genie Flow is to maintain a State Machine, coupled with a Data Object. The State Machine directs the flow and determines which prompts to invoke when during the conversation. The Data Object carries all the data that is gathered during the conversation.

These are only two classes that a developer would need to implement. The Genie Flow framework takes care of creating sessions, persisting data, maintaining the dialogue history, calling the LLMs asynchronously, and other feats.