Suvansh Sanjeev • 2023-07-26
Experience a new paradigm of AI conversation. CLAIRe responds, remembers, and reaches out.
CLAIRe is open source. Find the code and setup instructions here!
In an era defined by advanced technology and AI, the significance of creating an engaging and seamless conversational experience cannot be overstated. Meet CLAIRe: Conversational Learning AI with Recall, a next-generation chat-based AI developed to take us a step closer to a human-like conversational experience.
CLAIRe’s principal function lies not merely in providing real-time responses to user queries, but in modeling human conversational styles. While traditional chatbots limit themselves to the current conversational context, CLAIRe’s multi-tiered context retrieval taps into near-term, medium-term, and long-term information reservoirs to generate responses. Unlike most AI chatbots that operate in a reactive call-response fashion, CLAIRe can reach out on its own with contextually-relevant follow-up messages.
Imagine telling a friend about introducing your partner to your parents. Your friend instinctively retrieves information from various contexts – your current relationship, your dating history, your parents' preferences – all of which factors into the response. Now, imagine your AI doing the same. CLAIRe uses a combination of current conversational context, semantically relevant past messages, and saved entity-specific information from prior conversations to generate cohesive and natural responses, closely mirroring human conversational dynamics.
While traditional chatbots adhere to a reactive conversational style, CLAIRe introduces active messaging, challenging the conventional call-response paradigm. Suppose you mentioned being nervous about a work presentation the next day. Much like a considerate friend, CLAIRe will not only respond to your immediate anxiety but remember to follow up, wishing you luck or asking how it went.
CLAIRe's cutting-edge features include:
CLAIRe's active messaging in action
Semantic search syntax – note that the word "appointment" is not an exact match
CLAIRe's unique combined memory allows it to seamlessly answer questions as a friend might rather than giving generic ideas or repeatedly requiring the same context.
The below diagram illustrates the relationship between some of the main components of CLAIRe's backend.
CLAIRe is open source and contributions addressing the below issues (or others) are welcomed.
CLAIRe use a bare-bones scheduler that serves as an exciting proof of concept while leaving room for improvement. It schedules future messages as you talk to CLAIRe by saving them to disk in a profile-specific file that gets polled for messages periodically (every 30 seconds by default). This means CLAIRe can’t unschedule messages. For example, if CLAIRe makes plans to follow up on how a doctor’s appointment went, and you discuss it prior to the scheduled message arriving, it will still send the follow-up message as scheduled.
A possible extension of this message scheduling system could feed in relevant messages that are already scheduled and give CLAIRe the option of unscheduling messages. This would also reduce the likelihood of redundant scheduled messages on the same topic. An improved scheduling system might also address redundant messages by waiting for a lull in the conversation before issuing scheduled messages.
A consequence of the disk-based scheduling mechanism is that if you have multiple CLAIRe tabs open, only one of them will win the race to poll for the scheduled message. A possible modification of the scheduling system would see the `scheduledMessages` API endpoint delay the deletion of the scheduled message from disk by a couple seconds, allowing all tabs to poll and receive the message. Equivalently, the scheduled messages could remain in place until a scheduled daily process removed old messages that had already been sent out.
Starting off with CLAIRe is like making a new friend in both good and bad ways. CLAIRe doesn’t know you yet when you begin, and though it will learn more about you and the folks in your life, it would be nice to be able to warm-start it by embedding Tweets, Facebook posts, blog posts, or autobiographies through integrations with social media profiles or document uploads.
Though the UI is quite responsive, the load-on-scroll behavior sometimes interferes with navigating search results. This can be avoided if you don’t load history while navigating search results, but poses an irksome limitation on CLAIRe’s UI that would be nice to rectify. The relevant scrolling and searching behavior is contained in the Chat React component.
Setting up CLAIRe is simple. All you need is Docker on your computer and your OpenAI API key handy. You can find detailed setup instructions in the CLAIRe GitHub repository README.
A huge thanks to Chroma for supporting the development of this project through the Hacker-in-Residence program. The program was a wonderful experience, from the team to the snacks and the vibes in between.
Anton’s support through weekly check-ins and proactive support (not unlike CLAIRe ;) were pivotal in getting thoughtful feedback, hearing his unique perspectives, and thinking about the most interesting directions to take my project ideas.
Conversations and support from Jeff, Peter (another hacker-in-residence), and Hammad were also incredibly useful in thinking about modeling human conversational dynamics.
CLAIRe is also built with LangChain and draws inspiration from several of its abstractions in creating a new experience for AI chat.
Stay connected and hear about what we're up to!