-
-
Notifications
You must be signed in to change notification settings - Fork 50
[Agent] Introduce "session" - POC #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I'd say it's not the agent, that needs the ID, but the MessageBag. The message bag represents the conversations of a specific user/interaction. It is the subject we want to persist. |
Agree but you need to define the id of the agent at the agent level then pass it into the message bag, without it, you'll be not able to "tie together" both the agent and the messages 🤔 |
@Guikingone but you're referring to differentiating various agent configurations not instances of the same agent per User, right? Would a name of the agent solve that concern? |
dba7145
to
f753481
Compare
My POV is the following:
Regarding the technical implementation, to be fair, I have two approaches in mind:
The first approach seems "the way to do it" in my mind, each agent is unique, we might want to reuse messages linked to this one, it should "store" its identifier. The second one is tied to the chat in a way that any agent that "connect" to this chat can retrieve the chat history, IMO, that's an issue as we sometimes prefer to link to a specific agent (due to messages concerns, etc). Either way, I just pushed a "new version" of the POC, feel free to explore it (it doesn't change the "public API") 🙂 |
Why this doesn't make sense to me is because I still see the On top we already have a state object, that we can persist and hydrate - which is the |
Ah, got it, didn't thought about the kernel reboot (especially during container compilation), I was focused on the approach via the examples, not the "framework usage" one. Of course, it make sense now, I was wrong, completely wrong, I'll check the idea of having the UUID at the bag level, it should be easier to handle in the store, etc. Sorry for the dead end discussion, wasn't on the "right path" 🙁 |
@Guikingone nooo, all good, you're on a streak anyhow :D |
Hi 👋🏻
A small POC for the "session" that we discussed in #239, this PR is a WIP (and even more than a WIP, an open discussion 😅 ).
Here's the current state:
If we want to store "multiple sessions" depending on the agents, we can't interact with the bag (as it's not persisted), the only way is to do it at the store level, thing is, how?
Well, one way is to "initialize" the store with a session, the question is: Is it mandatory every time we initialize a store?
If so then we can just change the constructor of
InMemoryStore
and it's done, easy, simple, not much work, thing is, we'll be blocked if we want to handle multiple agents at the same time in the same store (parallel handling, etc).So here's my take, not perfect, open to discuss about it, it's a POC after all 😄
PS: At the end, this API calls will be hidden when using the bundle, the main concern is the "OOP without Sf" usage.
PS II: The interface is inspired by the one from
Cache
for tags, the behavior is not the same but the idea still there.