Chatrr is a command line chatbot built around the openai api with one special feature: a memory!
You need to have set the environment variable OPENAI_API_KEY
to be your openai api key. Then:
make build
./bin/chatrr
When you submit input, it will be embedded and then used to query a sqlite database with the vector similarity search extension. If the results have strong similarity, they will be constructed into a "memory", prepended to your input, and sent to the completions api. This allows the bot to do cool things like remember your name from one conversation to the next or remember details of a project you were discussing.
If you would like the bot to remember the response it gave to your last prompt type: memorize 1
. This tells the bot to remember the last (Prompt, Response) interaction in the conversation. You can tell it to remember however many you like.
- I suspect that as conversations carry on for a long time, the bot might become confused. This effect would likely be amplified if you change topics a lot.
- Once you've told the bot to memorize a conversation fragment it will be in there unless you delete the database.
- This uses embedding + completions for every single prompt.
- If you have a long conversation and ask the bot to remember the entire thing, it might exceed the context limit in future conversations (this will probably break the bot).
- Add timestamps to conversation fragments
- Fix zero entry query sqlite vss explosion
- Make completion model configurable
- Real conversation ids
- Claude support
- Model agnostic conversation object (abstract openai.ChatCompletionMessage out)
- Add feature for bot to ingest documents (stored seperately)
- Add cli flagging for experimental features
- API for front end to be built
- Embed entire conversation segment when memorizing (current strategy is ok, but why not just do the whole thing?)
- Eviction policies for memories
- During memorization use openai function api to get list of tags summarizing what is being memorized to store the embedding with
- Research methods for calculating information density
- Research methods for calculating novelty against an established corpus