Skip to main content

Teachability

Teachability uses a vector database to give an agent the ability to remember user teachings, where the user is any caller (human or not) sending messages to the teachable agent.
Teachability is designed to be composable with other agent capabilities.
To make any conversable agent teachable, instantiate both the agent and the Teachability class, then pass the agent to teachability.add_to_agent(agent).
Note that teachable agents in a group chat must be given unique path_to_db_dir values.
When adding Teachability to an agent, the following are modified:
- The agent’s system message is appended with a note about the agent’s new ability.
- A hook is added to the agent’s process_last_received_message hookable method, and the hook potentially modifies the last of the received messages to include earlier teachings related to the message.
Added teachings do not propagate into the stored message history.
If new user teachings are detected, they are added to new memos in the vector database.
Parameters:

Instance Methods

add_to_agent

Adds teachability to the given agent. Parameters:

prepopulate_db

Adds a few arbitrary memos to the DB.

process_last_received_message

Appends any relevant memos to the message text, and stores any apparent teachings in new memos.
Uses TextAnalyzerAgent to make decisions about memo storage and retrieval.
Parameters: