44// Copyright © 2025 Huly Labs. Use of this source code is governed by the MIT license.
55use std:: collections:: HashSet ;
66use std:: fs;
7- use std:: sync:: { Arc , RwLock } ;
7+ use std:: sync:: Arc ;
88
99use indicium:: simple:: { Indexable , SearchIndex } ;
1010use rig:: agent:: AgentBuilder ;
@@ -33,11 +33,11 @@ macro_rules! create_tool {
3333 ( $func_name: ident, $tool_name: ident) => {
3434 paste:: paste! {
3535 pub struct [ <$func_name Tool >] {
36- manager: Arc <RwLock <MemoryManager >>,
36+ manager: Arc <tokio :: sync :: RwLock <MemoryManager >>,
3737 }
3838
3939 impl [ <$func_name Tool >] {
40- pub ( self ) fn new( manager: Arc <RwLock <MemoryManager >>) -> Self {
40+ pub ( self ) fn new( manager: Arc <tokio :: sync :: RwLock <MemoryManager >>) -> Self {
4141 Self { manager }
4242 }
4343 }
@@ -63,7 +63,7 @@ macro_rules! create_tool {
6363 }
6464
6565 async fn call( & self , args: Self :: Args ) -> Result <Self :: Output , Self :: Error > {
66- self . manager. write( ) . unwrap ( ) . call_tool( & self . name( ) , args)
66+ self . manager. write( ) . await . call_tool( & self . name( ) , args)
6767 }
6868
6969 fn name( & self ) -> String {
@@ -374,7 +374,7 @@ create_tool!(MemoryOpenNodes, open_nodes);
374374
375375pub ( crate ) fn add_memory_tools < M > (
376376 agent_builder : AgentBuilder < M > ,
377- memory : Arc < RwLock < MemoryManager > > ,
377+ memory : Arc < tokio :: sync :: RwLock < MemoryManager > > ,
378378) -> AgentBuilder < M >
379379where
380380 M : CompletionModel ,
0 commit comments