Core Primitives
Using Honcho has the following flow:- Initialize your
Honcho
instance andApp
- Create a
User
- Create a
Session
for aUser
. - Create a
Collection
for aUser
- Add
Message
s to aUser
’sSession
. - Add
Metamessage
s to aUser
(optional links toSession
,Message
) - Add
Document
s to aUser
’sCollection
Apps
AnApp
is the highest-level primitive in Honcho. It is the scope that all of your Users
are bound to.
Users
TheUser
object is the main interface for managing a User’s context. With it
you can interface with the User
’s Session
s and Collections
s directly.
Sessions
TheSession
object is useful for organizing your interactions with User
s.
Different User
s can have different sessions enabling you to neatly segment user
context. It also accepts a location_id
parameter which can specifically
denote where users’ sessions are taking place.
Messages
Sessions are made up ofMessage
objects. You can append them to sessions.
This is pretty straightforward.
Metamessages
Success in LLM applications is dependent on elegant context management, so we provide aMetamessage
object for flexible context storage and construction. Each
Metamessage
is tied to a User
object via the required user_id
argument. Keeping
this separate from the core user-assistant message history ensures the
insights service running ambiently is doing so on authentic ground truth
We’ve found this particularly useful for storing intermediate inferences,
constructing very specific chat histories, and more. Metamessages can optionally be
attached to sessions and/or messages, so constructing historical context for inference is
as easy as possible.
Collections
Collections
are used to organize information about the User
. These can be
thought of as stores for more global data about the User
that spans sessions
while Metamessages
are local to a session and the message they are linked to.
Documents
Documents
are the individual facts that are stored in the Collection
. They
are stored as vector embeddings to allow for a RAG like interface. Using honcho
a developer can query a collection of documents using methods like cosine
similarity search