"We demonstrate through ablation that the components of our agent architecture—observation, planning, and reflection—each contribute critically to the believability of agent behavior"
One of the novel components was a "architecture that makes it possible for generative agents to remember, retrieve, reflect, interact with other agents" - this is what we tried to recreate
So now that we have this retriever, how is it used in memory?
There are two key methods: `add_memory` and `summarize_related_memories`
When an agent makes an observation, it stores the memory:
1. a LLM scores the memory’s importance (1 for mundane, 10 for poignant) 2. Observation and importance are stored within the retrieval system
When an agent responds to an observation:
1. Generates query(s) for retriever, which fetches documents based on salience, recency, and importance. 2. Summarizes the retrieved information 3. Updates the last_accessed_time for the used documents.
So let’s now see this in action! We can simulate what happens by feeding observations to the agent and seeing how the summary of the agent is updated over time
Here we do a simple update of only a few observations
We can take this to the extreme even more and update with ~20 or so observations (a full day’s worth)
We can then “interview” the agent before and after the day - notice the change in the agent’s responses!
Finally, we can create a simulation of two agents talking to each other.
This is a far cry from the ~20 or so agents the paper simulated, but it's still interesting to see the conversation + interview them before and after
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Prompt Templates are a key building block, so I'm excited to announce a small but powerful update to them in @LangChainAI:
🥳Partial Prompts🥳
Can partial with values OR functions, which means this can be used to easily inject up-to-date information in prompts
🧵
The first use case is pretty self explanatory:
Imagine you've got a prompt template which takes as input multiple variables
Your pipeline gets some variables early on, and others later on
Rather than waiting for all variables to arrive before formatting, you can now partial!
The next use case is more exciting
It's somewhat common practice to include something like "The date is {current_date}" at the start of the prompt, to hint to the LLM what it should and shouldn't know
That date is not static, but it's also annoying to have as an input variable
Can be used to:
🍴 route questions between MULTIPLE indexes
⛓️ do chain-of-thought reasoning with proprietary indexes
🔧 combine proprietary data with tool usage