A multi-agent context sharing method,
system, and medium are disclosed, comprising:
parsing the context content output by a first agent to generate corresponding
metadata; associating the context content with the corresponding
metadata and storing it in a
distributed cache; establishing a topic set indexed by a session identifier in the
distributed cache and adding the topic identifiers to the topic set; responding to a task to be executed by a second agent, obtaining the topic set corresponding to the current session identifier, reading the topic descriptions corresponding to each topic identifier in the topic set, and generating a
list of topic descriptions; inputting the task to be executed and the corresponding
list of topic descriptions into a large
language model, receiving the topic identifier set returned by the large
language model as the target topic identifiers semantically related to the task to be executed; and reading the corresponding context content from the
distributed cache according to the target topic identifiers, associating the context content with the task to be executed, and inputting it into the second agent.