autogen.agentchat.contrib.capabilities.teachability.MemoStore
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.
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’ |
Instance Methods
add_input_output_pair
Adds an input-output pair to the vector DB.
Parameters:Name | Description |
---|---|
input_text | Type: str |
output_text | Type: str |
get_nearest_memo
Retrieves the nearest memo to the given query text.
Parameters:Name | Description |
---|---|
query_text | Type: str |
get_related_memos
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 |
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.