RΞASON is a minimalistic Typescript framework for building great LLM apps
joke
object would be:
Joke
interface:
joke
object would now contain a topics
array:
How does it work under-the-hood?
npm run dev
what you are actually running is npx reason dev
, which runs the RΞASON transpiler.The RΞASON transpiler — as the name suggests — transpile your code to a different representation.For instance, the previous examples gets transpiled to:Joke
interface gets converted to an object that is passed as a parameter to reason()
.The inspiration came from React: they created a new syntax (JSX) for writing “HTML” in .js
files that gets transpiled to normal JavaScript. The same is true with RΞASON — except we didn’t create a new syntax, we changed how interfaces
are used.interfaces
to get structured output from a LLM. Its an awesome library and if you are using Python, check them out.const agent = new ReasonChatAgent()
that is terrible to extend and customize.
To be clear, prompting & retrieval are key areas to the sucess of your LLM app, and, precisely because of that you should be the one in charge of it — not the framework. It is the job of the framework to focus on areas that do not differenciate your business, such as string parsing and handling HTTP streams.