Skip to content
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

Redis-backed Entity Memory #2397

Merged

Conversation

alexiri
Copy link
Contributor

@alexiri alexiri commented Apr 4, 2023

I wanted to be able to persist Entity Memory in a Redis database, so I abstracted ConversationEntityMemory to allow for pluggable Entity stores (d06f90d).

Then I implemented a Entity store that... erm... stores Entities in Redis. By default, Entities will expire from memory after 24 hours, but they'll be persisted for another 3 days every time they're recalled. The idea is to give the AIs a bit of a spaced-repetition memory, but I have yet to see if this is useful. The memory is partitioned by session_id (user ID? chat channel? whatever, really) so entities from one user don't leak to another.

While developing this, I did notice that the Entity summaries are kind of buggy (they summarize AI-generated content and not just information the human gave them, sometimes they add things like "No new information provided. Existing summary remains: As stated previously, X", etc.), but I'll tackle that later. First I wanted to get some input on this idea.

@hwchase17 hwchase17 changed the base branch from master to harrison/entity-store April 7, 2023 05:34
@hwchase17 hwchase17 merged commit 5e83016 into langchain-ai:harrison/entity-store Apr 7, 2023
9 checks passed
dev2049 added a commit that referenced this pull request May 31, 2023
# SQLite-backed Entity Memory

Following the initiative of
#2397 I think it would be
helpful to be able to persist Entity Memory on disk by default

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
vowelparrot pushed a commit that referenced this pull request May 31, 2023
# SQLite-backed Entity Memory

Following the initiative of
#2397 I think it would be
helpful to be able to persist Entity Memory on disk by default

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this pull request Jun 19, 2023
# SQLite-backed Entity Memory

Following the initiative of
langchain-ai#2397 I think it would be
helpful to be able to persist Entity Memory on disk by default

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants