MemoStoreProvides 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.
Name | Description |
---|---|
verbosity | Type: int | None Default: 0 |
reset | Type: bool | None Default: False |
path_to_db_dir | Type: str | None Default: ’./tmp/teachable_agent_db’ |
Adds an input-output pair to the vector DB.
Parameters:Name | Description |
---|---|
input_text | Type: str |
output_text | Type: str |
Retrieves the nearest memo to the given query text.
Parameters:Name | Description |
---|---|
query_text | Type: str |
Retrieves memos that are related to the given query text within the specified distance threshold.
Parameters:Name | Description |
---|---|
query_text | Type: str |
n_results | Type: int |
threshold | Type: int | float |
Prints the contents of MemoStore.
Adds a few arbitrary examples to the vector DB, just to make retrieval less trivial.
Forces immediate deletion of the DB’s contents, in memory and on disk.