|  | @@ -18,7 +18,7 @@ from pqai_agent.data_models.agent_configuration import AgentConfiguration
 | 
	
		
			
				|  |  |  from pqai_agent.data_models.service_module import ServiceModule
 | 
	
		
			
				|  |  |  from pqai_agent.history_dialogue_service import HistoryDialogueService
 | 
	
		
			
				|  |  |  from pqai_agent.user_manager import MySQLUserManager, MySQLUserRelationManager
 | 
	
		
			
				|  |  | -from pqai_agent.utils.db_utils import create_sql_engine
 | 
	
		
			
				|  |  | +from pqai_agent.utils.db_utils import create_ai_agent_db_engine
 | 
	
		
			
				|  |  |  from pqai_agent.utils.prompt_utils import format_agent_profile, format_user_profile
 | 
	
		
			
				|  |  |  from pqai_agent_server.const import AgentApiConst
 | 
	
		
			
				|  |  |  from pqai_agent_server.const.status_enum import TestTaskStatus
 | 
	
	
		
			
				|  | @@ -677,25 +677,27 @@ if __name__ == '__main__':
 | 
	
		
			
				|  |  |      logging_service.setup_root_logger(level=logging_level, logfile_name='agent_api_server.log')
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      # set db config
 | 
	
		
			
				|  |  | +    agent_db_config = config['database']['ai_agent']
 | 
	
		
			
				|  |  | +    growth_db_config = config['database']['growth']
 | 
	
		
			
				|  |  |      user_db_config = config['storage']['user']
 | 
	
		
			
				|  |  |      staff_db_config = config['storage']['staff']
 | 
	
		
			
				|  |  |      agent_state_db_config = config['storage']['agent_state']
 | 
	
		
			
				|  |  |      chat_history_db_config = config['storage']['chat_history']
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      # init user manager
 | 
	
		
			
				|  |  | -    user_manager = MySQLUserManager(user_db_config['mysql'], user_db_config['table'], staff_db_config['table'])
 | 
	
		
			
				|  |  | +    user_manager = MySQLUserManager(agent_db_config, growth_db_config, staff_db_config['table'])
 | 
	
		
			
				|  |  |      app.user_manager = user_manager
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      # init session manager
 | 
	
		
			
				|  |  |      session_manager = MySQLSessionManager(
 | 
	
		
			
				|  |  | -        db_config=user_db_config['mysql'],
 | 
	
		
			
				|  |  | +        db_config=agent_db_config,
 | 
	
		
			
				|  |  |          staff_table=staff_db_config['table'],
 | 
	
		
			
				|  |  |          user_table=user_db_config['table'],
 | 
	
		
			
				|  |  |          agent_state_table=agent_state_db_config['table'],
 | 
	
		
			
				|  |  |          chat_history_table=chat_history_db_config['table']
 | 
	
		
			
				|  |  |      )
 | 
	
		
			
				|  |  |      app.session_manager = session_manager
 | 
	
		
			
				|  |  | -    agent_db_engine = create_sql_engine(config['storage']['agent_state']['mysql'])
 | 
	
		
			
				|  |  | +    agent_db_engine = create_ai_agent_db_engine(config['database']['ai_agent'])
 | 
	
		
			
				|  |  |      app.session_maker = sessionmaker(bind=agent_db_engine)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      dataset_service = DatasetService(session_maker=sessionmaker(bind=agent_db_engine))
 | 
	
	
		
			
				|  | @@ -707,7 +709,7 @@ if __name__ == '__main__':
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      wecom_db_config = config['storage']['user_relation']
 | 
	
		
			
				|  |  |      user_relation_manager = MySQLUserRelationManager(
 | 
	
		
			
				|  |  | -        user_db_config['mysql'], wecom_db_config['mysql'],
 | 
	
		
			
				|  |  | +        agent_db_config, growth_db_config,
 | 
	
		
			
				|  |  |          config['storage']['staff']['table'],
 | 
	
		
			
				|  |  |          user_db_config['table'],
 | 
	
		
			
				|  |  |          wecom_db_config['table']['staff'],
 |