HANAMLRAGAgent

class hana_ai.agents.hanaml_rag_agent.HANAMLRAGAgent(tools: List[Tool], llm: Any, memory_window: int = 10, long_term_db: str = None, long_term_memory_limit: int = 1000, skip_large_data_threshold: int = 100000, chunk_size: int = 500, chunk_overlap: int = 50, forget_percentage: float = 0.1, max_iterations: int = 20, cross_encoder: CrossEncoder = None, embedding_service: Embeddings = None, rerank_candidates: int = 20, rerank_k: int = 3, score_threshold: float = 0.5, vector_store_type='hanadb', hana_vector_table: str = None, vectorstore_path: str = 'chat_history_vectorstore', drop_existing_hana_vector_table: bool = False, verbose: bool = False, session_id: str = 'global_session', **kwargs)

A chatbot that integrates short-term and long-term memory systems using RAG (Retrieval-Augmented Generation).

Methods

chat(user_input)

Main chat method to handle user input and return response.

clear_long_term_memory()

Safely clear long-term memory by clearing the vectorstore and database.

clear_short_term_memory()

Clear short-term memory by resetting the conversation history.

delete_message_long_term_store(message_id)

Delete a specific message by its

delete_message_long_term_store(message_id) None

Delete a specific message by its

Parameters:
message_idstr

The ID of the message to delete from long-term memory.

clear_long_term_memory()

Safely clear long-term memory by clearing the vectorstore and database. Avoids index errors in SQLChatMessageHistory implementation.

clear_short_term_memory()

Clear short-term memory by resetting the conversation history. This is a placeholder for actual implementation.

chat(user_input: str) str

Main chat method to handle user input and return response.

Parameters:
user_inputstr

The input question or statement from the user.