Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goodai-ltm-0.2.0.tar.gz (128.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goodai_ltm-0.2.0-py3-none-any.whl (147.7 kB view details)

Uploaded Python 3

File details

Details for the file goodai-ltm-0.2.0.tar.gz.

File metadata

  • Download URL: goodai-ltm-0.2.0.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for goodai-ltm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 13f61f9184db5e1c227673ada345d0a993ceb40a6a0557e03ab3d1342ed9ec37
MD5 2484e76bf1114beaab7a8a3d5f3a8c9f
BLAKE2b-256 fe524cd2e3f3caf4c406e7b6710a7d362976f6d6b6ae49f377fd5ae0351acf80

See more details on using hashes here.

File details

Details for the file goodai_ltm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: goodai_ltm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 147.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for goodai_ltm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5853c8424b976264277184228c7d1b961f79e459d62e8c92b8a2ec45590334e1
MD5 2d09a5f049b6303cea074a5a4ea7e3ec
BLAKE2b-256 afc5bb6d27f2b1d0c1126c6da966bf1b792cf91d31e695a8d001e945ccb6bbb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page