
    iXs                    2   d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	m
Z
 ddlmZ ddlmZ  ej        e          Zddd	i g d
dZddd	ddddddddgd
dZddd	ddddddddgd
dZddd	ddddidgd
dZeeeegZ G d de          Zd#d"ZdS )$uL  Honcho memory plugin — MemoryProvider for Honcho AI-native memory.

Provides cross-session user modeling with dialectic Q&A, semantic search,
peer cards, and persistent conclusions via the Honcho SDK. Honcho provides AI-native cross-session user
modeling with dialectic Q&A, semantic search, peer cards, and conclusions.

The 4 tools (profile, search, context, conclude) are exposed through
the MemoryProvider interface.

Config: Uses the existing Honcho config chain:
  1. $HERMES_HOME/honcho.json (profile-scoped)
  2. ~/.honcho/config.json (legacy global)
  3. Environment variables
    )annotationsN)AnyDictListOptional)MemoryProvider)
tool_errorhoncho_profileu   Retrieve the user's peer card from Honcho — a curated list of key facts about them (name, role, preferences, communication style, patterns). Fast, no LLM reasoning, minimal cost. Use this at conversation start or when you need a quick factual snapshot.object)type
propertiesrequired)namedescription
parametershoncho_searchu   Semantic search over Honcho's stored context about the user. Returns raw excerpts ranked by relevance — no LLM synthesis. Cheaper and faster than honcho_context. Good when you want to find specific past facts and reason over them yourself.stringz&What to search for in Honcho's memory.)r   r   integerz:Token budget for returned context (default 800, max 2000).)query
max_tokensr   honcho_contextu   Ask Honcho a natural language question and get a synthesized answer. Uses Honcho's LLM (dialectic reasoning) — higher cost than honcho_profile or honcho_search. Can query about any peer: the user (default) or the AI assistant.zA natural language question.z4Which peer to query about: 'user' (default) or 'ai'.)r   peerhoncho_concludezWrite a conclusion about the user back to Honcho's memory. Conclusions are persistent facts that build the user's profile. Use when the user states a preference, corrects you, or shares something to remember across sessions.
conclusionz.A factual statement about the user to persist.c                      e Zd ZdZd Zed4d            Zd5dZd Zd	 Z	d6dZ
d7dZd7dZd5dZd8dZd4dZddd9dZd:dZddd;dZd<d Zed=d$            Zddd>d'Zd?d*Zd@d-ZdAd.ZdBd1ZdCd2Zd3S )DHonchoMemoryProviderzHHoncho AI-native memory with dialectic Q&A and persistent user modeling.c                p   d | _         d | _        d| _        d| _        t	          j                    | _        d | _        d | _        d| _	        d | _
        t	          j                    | _        d| _        d| _        d| _        d| _        d | _        d| _        d| _        d| _        d | _        d | _        d| _        d S )N hybridr   
every-turn   iF)_manager_config_session_key_prefetch_result	threadingLock_prefetch_lock_prefetch_thread_sync_thread_recall_mode_first_turn_context_first_turn_lock_turn_count_injection_frequency_context_cadence_dialectic_cadence_reasoning_level_cap_last_context_turn_last_dialectic_turn_session_initialized_lazy_init_kwargs_lazy_init_session_id_cron_skippedselfs    </root/.hermes/hermes-agent/plugins/memory/honcho/__init__.py__init__zHonchoMemoryProvider.__init__z   s     "'n..<@8< % 37  ) 0 0 $0! !"#37!"&$(! %*!1548" #    returnstrc                    dS )Nhoncho r9   s    r;   r   zHonchoMemoryProvider.name   s    xr=   boolc                    	 ddl m} |                                }|j        ot	          |j        p|j                  S # t          $ r Y dS w xY w)z0Check if Honcho is configured. No network calls.r   )HonchoClientConfigF)plugins.memory.honcho.clientrE   from_global_configenabledrC   api_keybase_url	Exception)r:   rE   cfgs      r;   is_availablez!HonchoMemoryProvider.is_available   sj    	GGGGGG$7799C;D4(Cs|#D#DD 	 	 	55	s   ;> 
AAc                >   ddl }ddlm}  ||          dz  }i }|                                r4	  |j        |                                          }n# t          $ r Y nw xY w|                    |           |                     |j	        |d                     dS )zDWrite config to $HERMES_HOME/honcho.json (Honcho SDK native format).r   N)Pathzhoncho.json   )indent)
jsonpathlibrO   existsloads	read_textrK   update
write_textdumps)r:   valueshermes_homerR   rO   config_pathexistings          r;   save_configz HonchoMemoryProvider.save_config   s          d;''-7 	%4:k&;&;&=&=>>   ztz(1===>>>>>s   "A 
A A c                    ddddddddd	gS )
NrI   zHoncho API keyTHONCHO_API_KEYzhttps://app.honcho.dev)keyr   secretenv_varurlbaseUrlz!Honcho base URL (for self-hosted))ra   r   rB   r9   s    r;   get_config_schemaz&HonchoMemoryProvider.get_config_schema   s6    .>$[k  uM  N  N.QRR
 	
r=   r[   configdictNonec                T    ddl }ddlm}  ||                                           dS )z:Run the full Honcho setup wizard after provider selection.r   N)	cmd_setup)typesplugins.memory.honcho.clirk   SimpleNamespace)r:   r[   rg   rl   rk   s        r;   
post_setupzHonchoMemoryProvider.post_setup   s?    777777	%''))*****r=   
session_idc                b   	 |                     dd          }|                     dd          }|dv s|dk    r%t                              d||           d| _        d	S d
dlm}m} d
dlm} |	                                }|j
        r|j        s#|j        st                              d           d	S |                     d          }	|	r|j        s|	|_        || _        |j        | _        t                              d| j                   	 |j        pi }
|
                     dd          | _        t'          |
                     dd                    | _        t'          |
                     dd                    | _        |
                     d          }|r|dv r|| _        n2# t.          $ r%}t                              d|           Y d	}~nd	}~ww xY w| j        dk    rc|j        r+t                              d            | j        ||fi | d	S || _        || _        || _        t                              d           d	S  | j        ||fi | d	S # t8          $ r t                              d           Y d	S t.          $ r-}t                              d|           d	| _        Y d	}~d	S d	}~ww xY w)zInitialize Honcho session manager.

        Handles: cron guard, recall_mode, session name resolution,
        peer memory mode, SOUL.md ai_peer sync, memory file migration,
        and pre-warming context at init.
        agent_contextr   platformcli)cronflushru   zBHoncho skipped: cron/flush context (agent_context=%s, platform=%s)TNr   )rE   get_honcho_clientHonchoSessionManageru)   Honcho not configured — plugin inactiveuser_idzHoncho recall_mode: %sinjectionFrequencyr    contextCadencer!   dialecticCadencereasoningLevelCap)minimallowmidhighz,Honcho cost-awareness config parse error: %stoolsuG   Honcho tools-only mode — eager session init (initOnSessionStart=true)uG   Honcho tools-only mode — deferring session init until first tool callu3   honcho-ai package not installed — plugin inactivezHoncho init failed: %s)getloggerdebugr8   rF   rE   rw   plugins.memory.honcho.sessionry   rG   rH   rI   rJ   	peer_namer#   recall_moder+   rawr/   intr0   r1   r2   rK   init_on_session_start_do_session_initr6   r7   ImportErrorwarningr"   )r:   rp   kwargsrr   rs   rE   rw   ry   rL   _gw_user_idr   capes                r;   
initializezHonchoMemoryProvider.initialize   s-   H	!"JJ;;Mzz*e44H 111X5G5Ga*H6 6 6%)"ZZZZZZZZJJJJJJ$7799C; s{ cl HIII !**Y//K ,3= , +DL !$DLL143DEEE	Pgm,/GG4H,,W,W)(+CGG4Da,H,H(I(I%*-cgg6H!.L.L*M*M'gg122 43"CCC03D- P P PKQOOOOOOOOP  G++,  LL!jkkk)D)#zDDVDDDF)/&-7*"fggg "D!#z<<V<<<<< 	P 	P 	PLLNOOOOOO 	! 	! 	!NN3Q777 DMMMMMMM	!sc   AI AI 0AI 	BF  I  
G*G
I 
G>I /I  I $J.8	J."J))J.c                   ddl m} ddlm}  ||          } ||||j                  | _        |                    d          }|                    ||          p|pd| _        t          
                    d| j                   | j                            | j                  }d	| _        	 |j        s`dd
lm}	 t!           |	            dz            }
| j                            | j        |
           t          
                    d| j                   n2# t$          $ r%}t          
                    d|           Y d}~nd}~ww xY w| j        dv r	 | j                            | j                   | j                            | j        d           t          
                    d| j                   dS # t$          $ r&}t          
                    d|           Y d}~dS d}~ww xY wdS )zBShared session initialization logic for both eager and lazy paths.r   )rw   rx   )rA   rg   context_tokenssession_title)r   rp   hermes-defaultzHoncho session key resolved: %sT)get_hermes_homememoriesz:Honcho memory file migration attempted for new session: %sz(Honcho memory file migration skipped: %sNcontextr   z#What should I know about this user?z/Honcho pre-warm threads started for session: %szHoncho pre-warm failed: %s)rF   rw   r   ry   r   r"   r   resolve_session_namer$   r   r   get_or_creater5   messageshermes_constantsr   r?   migrate_memory_filesrK   r+   prefetch_contextprefetch_dialectic)r:   rL   rp   r   rw   ry   clientr   sessionr   mem_dirr   s               r;   r   z%HonchoMemoryProvider._do_session_init  sJ   BBBBBBFFFFFF""3'',,-
 
 
 

?33$$=Z$XX    	
 	68IJJJ ---d.?@@$(!	H# n<<<<<<oo//*<==2243DgNNNY[_[lmmm 	H 	H 	HLLCQGGGGGGGG	H  555>..t/@AAA001BDijjjNPTPabbbbb > > >91=========> 65s2   ,A'D 
ED>>EAF1 1
G!;GG!c                *   | j         r	| j        rdS | j        rdS | j        r| j        sdS 	  | j        | j        | j        pdfi | j         d| _        d| _        | j         duS # t          $ r&}t          	                    d|           Y d}~dS d}~ww xY w)zLazily initialize the Honcho session (for tools-only mode).

        Returns True if the manager is ready, False otherwise.
        TFr   Nz#Honcho lazy session init failed: %s)
r"   r5   r8   r#   r6   r   r7   rK   r   r   )r:   r   s     r;   _ensure_sessionz$HonchoMemoryProvider._ensure_session@  s    
 = 	T6 	4 	5| 	4#9 	5	!D!*>.>  (   &*D")-D&=,, 	 	 	NN@!DDD55555	s   6A" "
B,BBctxc                   g }|                     dd          }|r|                    d|            |                     dd          }|r|                    d|            |                     dd          }|r|                    d|            |                     dd          }|r|                    d	|            |sdS d
                    |          S )zEFormat the prefetch context dict into a readable system prompt block.representationr   z## User Representation
cardz## User Peer Card
ai_representationz## AI Self-Representation
ai_cardz## AI Identity Card


)r   appendjoin)r:   r   partsrepr   ai_repr   s          r;   _format_first_turn_contextz/HonchoMemoryProvider._format_first_turn_contextZ  s   gg&++ 	;LL9C99:::wwvr"" 	7LL5t55666,b11 	ALL?v??@@@'')R(( 	<LL:::;;; 	2{{5!!!r=   c                   | j         rdS | j        r| j        s| j        dk    r
| j        r	 dS dS d}| j        dv r| j        5  | j        x	 | j                            | j                  }|r|                     |          nd| _        n9# t          $ r,}t                              d|           d| _        Y d}~nd}~ww xY w| j        }ddd           n# 1 swxY w Y   | j        dk    rd}n| j        dk    rd	}nd
}|r| d| S |S )a$  Return system prompt text, adapted by recall_mode.

        B4: On the FIRST call, fetch and bake the full Honcho context
        (user representation, peer card, AI representation, continuity synthesis).
        Subsequent calls return the cached block for prompt caching stability.
        r   r   z# Honcho Memory
Active (tools-only mode). Use honcho_profile, honcho_search, honcho_context, and honcho_conclude tools to access user memory.r   Nz*Honcho first-turn context fetch failed: %sr   u   # Honcho Memory
Active (context-injection mode). Relevant user context is automatically injected before each turn. No memory tools are available — context is managed automatically.u  # Honcho Memory
Active (tools-only mode). Use honcho_profile for a quick factual snapshot, honcho_search for raw excerpts, honcho_context for synthesized answers, honcho_conclude to save facts about the user. No automatic context injection — you must use tools to access memory.a  # Honcho Memory
Active (hybrid mode). Relevant context is auto-injected AND memory tools are available. Use honcho_profile for a quick factual snapshot, honcho_search for raw excerpts, honcho_context for synthesized answers, honcho_conclude to save facts about the user.r   )r8   r"   r$   r+   r#   r-   r,   get_prefetch_contextr   rK   r   r   )r:   first_turn_blockr   r   headers        r;   system_prompt_blockz(HonchoMemoryProvider.system_prompt_blockr  s     	2} 	D$5 	 G+++W 
 2  555& 	< 	<+36"m@@ARSS[^3f43R3RSV3W3W3Wdf00$ 6 6 6%QSTUUU350000006 $(#; 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	))) F '))Z F@   	544"2444s<   C
=BC
B>"B94C9B>>
CCCr   )rp   r   c               j   | j         rdS | j        dk    rdS | j        dk    r| j        dk    rdS | j        r4| j                                        r| j                            d           | j        5  | j        }d| _        ddd           n# 1 swxY w Y   |sdS | 	                    |          }d| S )	u   Return prefetched dialectic context from background thread.

        B1: Returns empty when recall_mode is "tools" (no injection).
        B5: Respects injection_frequency — "first-turn" returns cached/empty after turn 0.
        Port #3265: Truncates to context_tokens budget.
        r   r   z
first-turnr   g      @timeoutNz## Honcho Context
)
r8   r+   r/   r.   r)   is_aliver   r(   r%   _truncate_to_budget)r:   r   rp   results       r;   prefetchzHonchoMemoryProvider.prefetch  s&     	2 ''2 $449IA9M9M2  	4T%:%C%C%E%E 	4!&&s&333  	' 	'*F$&D!	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	'  	2 ))&11-V---s   1BBBtextc                    | j         r| j         j        s|S | j         j        dz  }t          |          |k    r|S |d|         }|                    d          }||dz  k    r
|d|         }|dz   S )z9Truncate text to fit within context_tokens budget if set.   N g?u    …)r#   r   lenrfind)r:   r   budget_chars	truncated
last_spaces        r;   r   z(HonchoMemoryProvider._truncate_to_budget  s    | 	4<#> 	K|2Q6t99$$K,'	__S))
s***!+:+.I6!!r=   c                    j         rdS  j        r	 j        rsdS  j        dk    rdS  j        dk    rH j         j        z
   j        k     r0t                              d j         j         j        z
             dS  j         _         fd}t          j
        |dd           _         j                                          j        dk    s j         j        z
   j        k    rb j         _        	  j                             j                   dS # t           $ r&}t                              d	|           Y d}~dS d}~ww xY wdS )
zFire a background dialectic query for the upcoming turn.

        B5: Checks cadence before firing background threads.
        Nr   r!   zCHoncho dialectic prefetch skipped: cadence %d, turns since last: %dc                 6   	 j                             j        d          } | r=|                                 r+j        5  | _        d d d            d S # 1 swxY w Y   d S d S d S # t          $ r&}t                              d|           Y d }~d S d }~ww xY w)Nuserr   zHoncho prefetch failed: %s)	r"   dialectic_queryr$   stripr(   r%   rK   r   r   )r   r   r   r:   s     r;   _runz1HonchoMemoryProvider.queue_prefetch.<locals>._run  s   >66%u6 7    7fllnn 7, 7 706-7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 77 7 7 7  > > >91=========>s;   ?A( A
A( AA( AA( (
B2BBTzhoncho-prefetchtargetdaemonr   z"Honcho context prefetch failed: %s)r8   r"   r$   r+   r1   r.   r4   r   r   r&   Threadr)   startr0   r3   r   rK   )r:   r   rp   r   r   s   ``   r;   queue_prefetchz#HonchoMemoryProvider.queue_prefetch  s   
  	F} 	D$5 	U 	F ''F "Q&& 4#<<@WWWb!4d6FIb6bd d d$($4!		> 		> 		> 		> 		> 		> !* 0+<!
 !
 !
 	##%%%  A%%$*:T=T*TY]Yn)n)n&*&6D#F..t/@%HHHHH F F FA1EEEEEEEEEF	 *o)ns   5 D 
E!EEturn_numberr   messagec                    || _         dS )z;Track turn count for cadence and injection_frequency logic.N)r.   )r:   r   r   r   s       r;   on_turn_startz"HonchoMemoryProvider.on_turn_start  s    &r=   contentlimit	list[str]c                l   t          |           |k    r| gS d}t          |          }g }| }d}|r|r|n||z
  }t          |          |k    r|                    |r|n||z              n|d|         }|                    d          }	|	|dz  k     r |                    d          }	|	dk    r|	dz  }	|	|dz  k     r|                    d	          }	|	|dz  k     r|}	|d|	                                         }
||	d                                         }|s||
z   }
|                    |
           d
}||S )aR  Split content into chunks that fit within the Honcho message limit.

        Splits at paragraph boundaries when possible, falling back to
        sentence boundaries, then word boundaries. Each continuation
        chunk is prefixed with "[continued] " so Honcho's representation
        engine can reconstruct the full message.
        z[continued] TNr   g333333?z. r   rP   r   F)r   r   r   rstriplstrip)r   r   prefix
prefix_lenchunks	remainingfirst	effectivesegmentcutchunks              r;   _chunk_messagez#HonchoMemoryProvider._chunk_message  s}    w<<5  9[[
	 	!&>EJ,>I9~~**5Hiify6HIII

+G --''CY_$$mmD))!881HCY_$$mmC((Y_$$dsdO**,,E!#$$..00I 'MM%   E1  	4 r=   user_contentassistant_contentc               Z     j         rdS  j        r j        sdS  j        r j        j        nd fd} j        r4 j                                        r j                            d           t          j	        |dd           _         j        
                                 dS )	zRecord the conversation turn in Honcho (non-blocking).

        Messages exceeding the Honcho API limit (default 25k chars) are
        split into multiple messages with continuation markers.
        Nia  c                    	 j                             j                  }                               D ]}|                     d|                                         D ]}|                     d|           j                             |            d S # t          $ r&}t                              d|           Y d }~d S d }~ww xY w)Nr   	assistantzHoncho sync_turn failed: %s)	r"   r   r$   r   add_message_flush_sessionrK   r   r   )r   r   r   r   	msg_limitr:   r   s      r;   _syncz-HonchoMemoryProvider.sync_turn.<locals>._syncJ  s    ?-55d6GHH!00yII 7 7E''6666!001BINN < <E''U;;;;,,W55555 ? ? ?:A>>>>>>>>>?s   BB 
C&CC      @r   Tzhoncho-syncr   )r8   r"   r$   r#   message_max_charsr*   r   r   r&   r   r   )r:   r   r   rp   r   r   s   ```  @r;   	sync_turnzHonchoMemoryProvider.sync_turn=  s      	F} 	D$5 	F6:lMDL22			? 		? 		? 		? 		? 		? 		? 		?  	0!2!;!;!=!= 	0""3"///%,M
 
 
 	!!!!!r=   actionr   c                     |dk    s|dk    ssdS  j         rdS  j        r j        sdS  fd}t          j        |dd          }|                                 dS )z:Mirror built-in user profile writes as Honcho conclusions.addr   Nc                     	 j                             j                   d S # t          $ r&} t                              d|            Y d } ~ d S d } ~ ww xY w)NzHoncho memory mirror failed: %s)r"   create_conclusionr$   rK   r   r   )r   r   r:   s    r;   _writez4HonchoMemoryProvider.on_memory_write.<locals>._writee  st    C//0A7KKKKK C C C>BBBBBBBBBCs    % 
AAATzhoncho-memwriter   )r8   r"   r$   r&   r   r   )r:   r   r   r   r   ts   `  `  r;   on_memory_writez$HonchoMemoryProvider.on_memory_write\  s    U??f..g.F 	F} 	D$5 	F	C 	C 	C 	C 	C 	C F4>OPPP						r=   r   List[Dict[str, Any]]c                :   | j         rdS | j        sdS | j        r4| j                                        r| j                            d           	 | j                                         dS # t          $ r&}t                              d|           Y d}~dS d}~ww xY w)z4Flush all pending messages to Honcho on session end.Ng      $@r   z#Honcho session-end flush failed: %s)	r8   r"   r*   r   r   	flush_allrK   r   r   )r:   r   r   s      r;   on_session_endz#HonchoMemoryProvider.on_session_endn  s     	F} 	F 	1!2!;!;!=!= 	1""4"000	CM##%%%%% 	C 	C 	CLL>BBBBBBBBB	Cs   A* *
B4BBc                V    | j         rg S | j        dk    rg S t          t                    S )zeReturn tool schemas, respecting recall_mode.

        B1: context-only mode hides all tools.
        r   )r8   r+   listALL_TOOL_SCHEMASr9   s    r;   get_tool_schemasz%HonchoMemoryProvider.get_tool_schemas|  s6    
  	I	))I$%%%r=   	tool_nameargsc                \   | j         rt          d          S | j        s#|                                 st          d          S | j        r| j        st          d          S 	 |dk    rM| j                            | j                  }|st          j        ddi          S t          j        d|i          S |dk    r|	                    dd	          }|st          d
          S t          t          |	                    dd                    d          }| j                            | j        ||          }|st          j        ddi          S t          j        d|i          S |dk    rw|	                    dd	          }|st          d
          S |	                    dd          }| j                            | j        ||          }t          j        d|pdi          S |dk    rq|	                    dd	          }	|	st          d          S | j                            | j        |	          }
|
rt          j        dd|	 i          S t          d          S t          d|           S # t          $ r;}t                               d||           t          d| d|           cY d}~S d}~ww xY w)zFHandle a Honcho tool call, with lazy session init for tools-only mode.z$Honcho is not active (cron context).z(Honcho session could not be initialized.z&Honcho is not active for this session.r
   r   zNo profile facts available yet.r   r   r   z!Missing required parameter: queryr   i   i  )r   zNo relevant context found.r   r   r   r   zNo result from Honcho.r   r   z&Missing required parameter: conclusionzConclusion saved: zFailed to save conclusion.zUnknown tool: zHoncho tool %s failed: %szHoncho z	 failed: N)r8   r	   r5   r   r"   r$   get_peer_cardrR   rY   r   minr   search_contextr   r   rK   r   error)r:   r  r	  r   r   r   r   r   r   r   okr   s               r;   handle_tool_callz%HonchoMemoryProvider.handle_tool_call  s    	FDEEE ( 	N'')) N!"LMMM} 	HD$5 	HFGGG*	A,,,}2243DEE U:x1R&STTTz8T"2333o--"-- K%&IJJJ TXXlC%@%@!A!A4HH
55%u 6    P:x1M&NOOOz8V"4555..."-- K%&IJJJxx//66%u4 7   z8V-O7O"PQQQ///!XXlB77
! P%&NOOO]44T5F
SS U:x1Rj1R1R&STTT!">???:y::;;; 	A 	A 	ALL4iCCC?	??A??@@@@@@@@	As\   <I& I& 2,I& A*I& 
I&  ,I& AI& ,I& 
:I& I& I& &
J+00J& J+&J+c                    | j         | j        fD ].}|r*|                                r|                    d           /| j        r-	 | j                                         d S # t          $ r Y d S w xY wd S )Nr   r   )r)   r*   r   r   r"   r  rK   )r:   r   s     r;   shutdownzHonchoMemoryProvider.shutdown  s    '):; 	$ 	$A $QZZ\\ $s###= 	'')))))   	 	s   A! !
A/.A/N)r>   r?   )r>   rC   )r[   r?   rg   rh   r>   ri   )rp   r?   r>   ri   )r   rh   r>   r?   )r   r?   rp   r?   r>   r?   )r   r?   r>   r?   )r   r?   rp   r?   r>   ri   )r   r   r   r?   r>   ri   )r   r?   r   r   r>   r   )r   r?   r   r?   rp   r?   r>   ri   )r   r?   r   r?   r   r?   r>   ri   )r   r   r>   ri   )r>   r   )r  r?   r	  rh   r>   r?   r>   ri   )__name__
__module____qualname____doc__r<   propertyr   rM   r^   rf   ro   r   r   r   r   r   r   r   r   r   staticmethodr   r   r   r  r  r  r  rB   r=   r;   r   r   w   s$       RR# # #B    X   ? ? ?
 
 
+ + + +O! O! O! O!b*> *> *> *>X   4" " " "0< < < <| 9; . . . . . .>" " " " ?A -F -F -F -F -F -F^' ' ' ' * * * \*X Y[ " " " " " ">   $C C C C	& 	& 	& 	&7A 7A 7A 7Ar	 	 	 	 	 	r=   r   r>   ri   c                H    |                      t                                 dS )z,Register Honcho as a memory provider plugin.N)register_memory_providerr   )r   s    r;   registerr    s#      !5!7!788888r=   r  )r  
__future__r   rR   loggingr&   typingr   r   r   r   agent.memory_providerr   tools.registryr	   	getLoggerr  r   PROFILE_SCHEMASEARCH_SCHEMACONTEXT_SCHEMACONCLUDE_SCHEMAr  r   r  rB   r=   r;   <module>r'     s    # " " " " "       , , , , , , , , , , , , 0 0 0 0 0 0 % % % % % %		8	$	$ 	T
 $22FF	 	 	X  !G 
 "[ 	
 	
 I  2 	L
  != 
 !U 	
 	
 I  0 	1  O 
 "N	 	 * #M>?S R	 R	 R	 R	 R	> R	 R	 R	r9 9 9 9 9 9r=   