Skip to main content

MemoStore

Provides memory storage and retrieval for a teachable agent, using a vector database.
Each DB entry (called a memo) is a pair of strings: an input text and an output text.
The input text might be a question, or a task to perform.
The output text might be an answer to the question, or advice on how to perform the task.
Vector embeddings are currently supplied by Chroma’s default Sentence Transformers.
Parameters:

Instance Methods

add_input_output_pair

Adds an input-output pair to the vector DB. Parameters:

get_nearest_memo

Retrieves the nearest memo to the given query text. Parameters:
Retrieves memos that are related to the given query text within the specified distance threshold. Parameters:

list_memos

Prints the contents of MemoStore.

prepopulate

Adds a few arbitrary examples to the vector DB, just to make retrieval less trivial.

reset_db

Forces immediate deletion of the DB’s contents, in memory and on disk.