before_cat_recalls_procedural_memories
Intervene before the Cat searches among the action it knows.
Allows intercepting when the Cat queries the memories using the embedded user's input.
The hook is executed just before the Cat searches for the meaningful context in both memories and stores it in the Working Memory.
The hook returns the values for maximum number (k) of items to retrieve from memory and the score threshold applied to the query in the vector memory (items with score under the threshold are not retrieved) It also returns the embedded query (embedding) and the conditions on recall (metadata).
đ Arguments
Name | Type | Description |
---|---|---|
procedural_recall_config |
dict |
Dictionary with data needed to recall tools from procedural memory. |
cat |
StrayCat | Cheshire Cat instance, allows you to use the framework components. |
The default value of procedural_recall_config
is:
{
"embedding": recall_query_embedding, # embedding of the recall query
"k": 3, # number of memories to retrieve
"threshold": 0.7, # similarity threshold to retrieve memories
"metadata": None, # dictionary of metadata to filter memories
}
âŠī¸ Return
Type: dict
Edited dictionary that will be fed as a query to the Vector db.