msticpy.aiagents.rag_agents module

Module for MSTICpy documentation utilities and retrieval agent configuration.

Includes functions to find documentation files and to set up retrieval agents that assist security analysts by answering questions based on MSTICpy documentation.

msticpy.aiagents.rag_agents.ask_question(assistant_agent: autogen.agentchat.contrib.retrieve_assistant_agent.RetrieveAssistantAgent, user_proxy_agent: autogen.agentchat.contrib.retrieve_user_proxy_agent.RetrieveUserProxyAgent, question: str) autogen.agentchat.chat.ChatResult

Ask a question using the assistant and user proxy agents.

Parameters:
  • assistant_agent (RetrieveAssistantAgent) – The assistant agent to use.

  • user_proxy_agent (RetrieveUserProxyAgent) – The user proxy agent to use.

  • question (str) – The question to ask.

Returns:

The result of the chat interaction.

Return type:

ChatResult

msticpy.aiagents.rag_agents.find_rst_files() List[str]

Find all .rst files in the docs/source directory of ‘msticpy’ package.

Returns:

List of paths to .rst files in the docs/source directory.

Return type:

list of str

msticpy.aiagents.rag_agents.get_retrieval_assistant_agent(system_message: str = '') autogen.agentchat.contrib.retrieve_assistant_agent.RetrieveAssistantAgent

Create and return a RetrieveAssistantAgent.

Parameters:

system_message (str, optional) – Custom system message for the assistant.

Returns:

Configured RetrieveAssistantAgent instance.

Return type:

RetrieveAssistantAgent

msticpy.aiagents.rag_agents.get_retrieval_user_proxy_agent(customized_prompt: str | None = None) autogen.agentchat.contrib.retrieve_user_proxy_agent.RetrieveUserProxyAgent

Create and return a RetrieveUserProxyAgent.

Parameters:

customized_prompt (Optional[str], optional) – Custom prompt for the assistant agent, by default None.

Returns:

Configured RetrieveUserProxyAgent instance.

Return type:

RetrieveUserProxyAgent

Raises:

MsticpyUserConfigError – Autogen settings not found in msticpyconfig.yaml configuration