Object model concepts

It would be really handy to have some high-level explanation of the API object model. I’m inferring from the docs and what I’ve looked at from the code, but stuff like:

Agent:User = 1:many. Or is it best-practice to instantiate a unique Agent for each user?

Agent:Session = 1:many. Although again, this may depend on whether a new Agent is instantiated every time a new session starts, like when the same user shows up.

User:Session = 1:many, but might be restricted if sessions are persistent, ie. in that case the same user would always just resume the same session by tying them to the existing session_id in the DB.

Memory - How is this mapped to sessions and/or different users and/or agents? In my application, I want memory to be scoped to a User, but shared across Agents and Sessions (ie. personalized chatbot with long-term memory of the specific user).

It’s really not clear how these top-level objects relate to one-another, or how they CAN relate to one another for different use-cases. I’m not sure answering this here is what I’m asking for - a better description in the docs would probably make more sense.

Thanks for considering!

Hi @Adam,
Thank you for your suggestion. Your feedback is highly valuable to us.
We will surely look into this.

Thank you again

So for now, is the correct way to have memory persist across sessions for the same user to make the session_id the same? In that case, is there any way to delimit actual sessions, ie. essentially when a user “shows up again”, which I realize is subjective, but assume it’s tied to a login or something. It seems the Agno console only groups Sessions by session_id. Is it possible to tie a different session_id to the existing memories for a user?

Hey @Adam! I’d love to point you to our source code for storage and memory—it should give you a clearer picture of what we save in each and how everything ties together. Hope this helps make things easier to understand, and of course, feel free to reach out if you have any questions! Happy to help.