agents.memory_v2.extraction_prompts

Advanced extraction prompt templates for Memory V2 system.

This module provides sophisticated, focused prompt templates for extracting different types of information from conversations and documents, specifically designed for memory-based agents with KG integration.

Classes

ExtractionOrchestrator

Orchestrates multiple extraction types on the same content.

Functions

get_all_extraction_types()

Get list of all available extraction types.

get_extraction_prompt(prompt_type)

Get extraction prompt by type.

Module Contents

class agents.memory_v2.extraction_prompts.ExtractionOrchestrator(llm_config=None)

Orchestrates multiple extraction types on the same content.

Initialize with LLM configuration.

async extract_all(conversation_text, extraction_types=None)

Run multiple extractors on the same conversation.

Parameters:
  • conversation_text (str) – The conversation to analyze

  • extraction_types (list[str] | None) – Which extractors to run (default: all)

Returns:

Dictionary with results from each extractor

Return type:

dict[str, Any]

get_focused_extractors(domain)

Get recommended extractors for a specific domain.

Parameters:

domain (str) – Domain type (e.g., ‘product’, ‘engineering’, ‘general’)

Returns:

List of recommended extraction types

Return type:

list[str]

agents.memory_v2.extraction_prompts.get_all_extraction_types()

Get list of all available extraction types.

Return type:

list[str]

agents.memory_v2.extraction_prompts.get_extraction_prompt(prompt_type)

Get extraction prompt by type.

Parameters:

prompt_type (str) – One of the available prompt types

Returns:

ChatPromptTemplate for the specified extraction type

Raises:

ValueError – If prompt_type is not available

Return type:

langchain_core.prompts.ChatPromptTemplate