A text memory meant to be used with conversational language models.
Project description
GoodAI-LTM
GoodAI-LTM brings together all the components necessary for equipping agents with text-based long term memory.
This includes text embedding models, reranking, vector databases, chunking, metadata such as time stamps and
document information, memory and query rewriting (expansion and disambiguation), storage and retrieval.
The package is especially adapted to provide a dialog-centric memory stream for social agents.
- Embedding models: Use OpenAI, Hugging Face Sentence Transformers, or our own locally trainable embeddings.
The trainable embeddings allow multiple embeddings for a query or passage, which can capture different aspects of the text for more accurate retrieval.
- Query-passage match ranking: In addition to similarity-based retrieval, we support models for estimating
query-passage matching after retrieval.
- Vector databases: We currently provide a light-weight local vector database as well as support for FAISS.
Installation
pip install goodai-ltm
Short example
The following code snippet creates an instance of LTM, loads in some text and then retrieves the most relevant text chunks given a query:
from goodai.ltm.mem.auto import AutoTextMemory
mem = AutoTextMemory.create()
mem.add_text("Lorem ipsum dolor sit amet, consectetur adipiscing elit\n")
mem.add_text("Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore\n",
metadata={'timestamp': time.time(), 'type': 'generic'})
r_memories = mem.retrieve(query='dolorem eum fugiat quo voluptas nulla pariatur?', k=3)
Additional information
Visit the Github page: https://github.com/GoodAI/goodai-ltm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goodai-ltm-0.0.21.tar.gz.
File metadata
- Download URL: goodai-ltm-0.0.21.tar.gz
- Upload date:
- Size: 115.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
827e3f1e3595055f25cf3fa73b522512051e70625d528b9c20757d4c9dcd58b0
|
|
| MD5 |
afe2665ce0b83cfcfb41e162bbeab662
|
|
| BLAKE2b-256 |
7575a8c65794333e33fb8529f2bffc4ccf7f7d866292a8f2d35c50d189921bc9
|
File details
Details for the file goodai_ltm-0.0.21-py3-none-any.whl.
File metadata
- Download URL: goodai_ltm-0.0.21-py3-none-any.whl
- Upload date:
- Size: 132.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e951ff21065a50fb27003b4a304b6d2c66c21d56193e5104cb5e963aefd999cc
|
|
| MD5 |
fee4e68087ccd2b20b34232fd455d431
|
|
| BLAKE2b-256 |
14b40bad2d05ad4a3b777014366519449008c93c27f4afecc74d52cf100a2ea3
|