I created Sensei to make it easier to quickly create and deploy new AI guides. Sharing it here in case it’s useful for other people, and especially if anyone wants to hack on it with me! I’m not planning for this to be a business or anything, I just needed it for myself.
Basic idea:
Each AI guide is a web application consisting of an Express server running a Node app, with a Postgres database, hosted on Heroku. OpenAI is called in the background, either the Assistants API or the Chat Completions API, depending on the “target” in your config. I’m mainly interested in the Assistants API.
Some key features:
User registration and login
Chat history in your own database, identified by user
Each AI has its own web endpoint, so you can call them from somewhere else
Basic web interface for prompting, login, and registration, which you can customize
Cheap default plans for Heroku, to keep prototyping cost-effective
Logtail free plan for server logs
Shell scripts to easily create new projects and branches (which get their own web endpoint)
Files in the “files” directory are available automatically to your AI for knowledge retrieval
Ditto for functions and function definitions in your “functions” directory
Pick your own model
GitHub workflow for CI/CD before Heroku deployment
Please reach out if you want to hack on this, if you find it useful, or if you have any feedback! I’ll keep iterating on it, but it has enough features at this point that I can begin to make use of it for my main project.
I wanted to share a few updates from the last ten days!
From the beginning, we wanted AI guides to be able to call on other, specialized AI guides for support. Our hypothesis is that a network of guides with specialized prompts and knowledge will outperform a single guide that is overwhelmed with too much information.
We’ve seen some early confirmation of that in our tests: Even for something simple, like explaining a book, we had better performance by having a “root” guide handle human input, and call on specialized guides that have access to individual chapters to get into the details.
Splitting functionality across multiple guides becomes even more important when guide responses need to be quite different from each other. For instance, one guide may need to generate technical output at a low temperature, while another guide may need to understand emotions expressed in the humans’ prompts. The root guide’s role is to play traffic controller, prompting its external guides based on the human prompt, and synthesizing responses.
Anyway, on to the new stuff:
Improvements to the branch and start scripts to make it easier to create and deploy AI guides
External guides can be named and described in the config file
A standard “callGuide” function can be used to call any external guides in the config
Speaking of updates, I added just speech-to-text for prompting, and highlighted that as the primary mode of interaction. It was pretty quick. I’ll add text-to-speech next, to close the loop, so interactions with the AI guide are conversational and voice-driven, since that’s how we expect our end product to work. You still have access to the text in the thread, and you can always show the text-based chat form to enter your prompts with a keyboard if you want.
For our use case, we look for regular expressions in the AI guide responses to trigger actions on our React frontend, like pulling up a dashboard or initiating a crypto transaction. A lot of the newer code in the repo is only relevant to our project, and could be stripped out or ignored if you are using Sensei to build something else. Using regex to let the AI responses trigger frontend functions is pretty cool and useful, though, if you develop your own patterns to watch for.
Thanks for all the kind words! I commented on your issue, and merged your pull request (thanks for that!). Sorry the repo is so specialized at this point. We’ve been adding a ton of features for our product, and pushing right to the main branch for convenience, so there’s a lot of code that could be deleted or modified to make Sensei more general-purpose. Hopefully we’ll have more resources soon and can take care of that. In the meantime, I’m happy to keep answering questions and helping you any way I can. Excited to see you trying it out!
@rmcsharry quick update: I’m reading up on structured outputs, and figuring out how Sensei-style AI guide networks can use them more effectively than regex parsing. It looks like we could have specialized guides in charge of generating strictly structured JSON outputs when called by the root guide, instead of having the root guide do its best and hope the regex captures the pattern we want. Regex works okay for the moment, but structured outputs might be a 100% effective solution. When the root guide recognizes they should take some action, they can call a specialized guide instead of trying to create a JSON object themselves. The root guide must have maximum flexibility, since it’s handling the actual conversation, and the specialized guide must be maximally rigid, since we want specific responses.