rag_system.auto_search module
RAG Auto-Search Manager.
Manages per-channel auto-search configuration and provides context injection for automatic RAG searches on user messages.
Adapted for the v3 multi-platform architecture: channel keys use
platform:channel_id composite format.
- class rag_system.auto_search.RAGAutoSearchManager(redis_client)[source]
Bases:
objectPer-channel auto-search configuration backed by Redis.
- Parameters:
redis_client (aioredis.Redis)
- __init__(redis_client)[source]
Initialize the instance.
- Parameters:
redis_client (
Redis) – Redis connection client.- Return type:
None
- async set_channel_config(channel_key, store_names, enabled=True, n_results=3, min_score=0.5)[source]
Set auto-search configuration for a channel.
- async search_for_message(channel_key, message_content, chunk_size=10000, query_embedding=None, user_id='')[source]
Perform auto-search if the channel is configured.
- Parameters:
query_embedding (
list[float] |None) – Pre-computed embedding for message_content. When provided it is forwarded to ChromaDB to skip its internal embedding call.user_id (
str) – The message author. Used to enforce access control oncloud_usr_stores.string (Returns XML-formatted RAG context)
None. (or)
channel_key (str)
message_content (str)
chunk_size (int)
- Return type: