backend: http
working_dir: .reme
thread_pool_max_workers: 64

mcp:
  transport: sse
  host: "0.0.0.0"
  port: 8001

http:
  host: "0.0.0.0"
  port: 8002
  timeout_keep_alive: 600
  limit_concurrency: 64

flows:
  retrieve_task_memory:
    flow_content: BuildQuery() >> MemoryRetrieval() >> RerankMemory() >> RewriteMemory()
    description: "Retrieves the most relevant top-k memory experiences from historical data based on the current query to enhance task-solving capabilities"
    parameters:
      type: object
      properties:
        query:
          type: string
          description: "The search query string for retrieving relevant memories. Either query or messages must be provided."
        messages:
          type: array
          description: "A list of conversation messages to build the query from. Either query or messages must be provided."
        enable_llm_build:
          type: boolean
          description: "Whether to use LLM to build query from messages (default: true)."
        top_k:
          type: integer
          description: "Number of top results to retrieve (default: 5)."
        threshold_score:
          type: number
          description: "Optional minimum score threshold for filtering retrieved memories."
        enable_llm_rerank:
          type: boolean
          description: "Whether to enable LLM-based reranking (default: false)."
        enable_score_filter:
          type: boolean
          description: "Whether to enable score-based filtering (default: false)."
        min_score_threshold:
          type: number
          description: "Minimum combined score threshold for filtering memories (default: 0.3)."
        enable_llm_rewrite:
          type: boolean
          description: "Whether to use LLM to rewrite context messages (default: false)."
      required: []

  summary_task_memory:
    flow_content: TrajectoryPreprocess() >> (SuccessExtraction()|FailureExtraction()|ComparativeExtraction()) >> MemoryValidation() >> MemoryDeduplication()
    description: "Summarizes conversation trajectories or messages into structured memory representations for long-term storage"
    parameters:
      type: object
      properties:
        trajectories:
          type: array
          description: "A list of conversation trajectory information, including message content and score."
        success_threshold:
          type: number
          description: "Score threshold for classifying trajectories as successful (default: 1.0)."
        enable_soft_comparison:
          type: boolean
          description: "Whether to enable soft comparison between highest and lowest scoring trajectories (default: true)."
        enable_similarity_comparison:
          type: boolean
          description: "Whether to enable similarity-based comparison between success and failure trajectories (default: false)."
        max_similarity_sequences:
          type: integer
          description: "Maximum number of sequences to compare for similarity (default: 5)."
        similarity_threshold:
          type: number
          description: "Similarity threshold for comparing trajectories (default: 0.5)."
        max_similarity_pairs:
          type: integer
          description: "Maximum number of similar pairs to extract from comparison (default: 3)."
        validation_threshold:
          type: number
          description: "Minimum validation score threshold for accepting task memories (default: 0.5)."
        max_existing_task_memories:
          type: integer
          description: "Maximum number of existing task memories to check for deduplication (default: 1000)."
      required:
        - trajectories

  add_task_memory:
    flow_content: MemoryAddition()
    description: "Add task memories to the vector store"
    parameters:
      type: object
      properties:
        memory_list:
          type: array
          description: "A list of task memory to add to the vector store."
      required:
        - memory_list

  delete_task_memory:
    flow_content: MemoryDeletion()
    description: "Delete task memories when utility/freq < utility_threshold and freq >= freq_threshold"
    parameters:
      type: object
      properties:
        freq_threshold:
          type: integer
          description: "The retrieved frequency threshold for deleting task memory."
        utility_threshold:
          type: number
          description: "The utility/freq threshold for deleting task memory."
      required:
        - freq_threshold
        - utility_threshold

  record_task_memory:
    flow_content: UpdateMemoryMetadata()
    description: "Update the freq & utility attributes of retrieved task memories"
    parameters:
      type: object
      properties:
        memory_list:
          type: array
          description: "A list of retrieved task memory corresponding to the current task."
        update_utility:
          type: boolean
          description: "Whether to update the utility attribute of the retrieved task memory."
      required:
        - memory_list
        - update_utility

  load_memory:
    flow_content: LoadMemory()
    description: "Load memories from disk into the vector store"
    parameters:
      type: object
      properties:
        load_file_path:
          type: string
          description: "The path to the memories file."
        clear_existing:
          type: boolean
          description: "If True, clears existing memories before loading (default: False)."
      required:
        - load_file_path

  dump_memory:
    flow_content: DumpMemory()
    description: "Dump the vector store memories to disk"
    parameters:
      type: object
      properties:
        dump_file_path:
          type: string
          description: "The path to the memories file."
      required:
        - dump_file_path

  test:
    flow_content: TestOp()
    description: "test"

#  curl -X POST http://localhost:8002/simple_chat \
#    -H "Content-Type: application/json" \
#    -d '{
#    "query": "hello"
#  }'
  simple_chat:
    flow_content: SimpleChat()
    description: "test"

  stream_chat:
    flow_content: StreamChat()
    description: "test"
    stream: true

llms:
  default:
    backend: openai
    model_name: qwen3.5-plus
    request_interval: 1
#    temperature: 0.0001

embedding_models:
  default:
    backend: openai
    model_name: text-embedding-v4
    dimensions: 1024
    enable_cache: false

vector_stores:
  default:
    backend: chroma
    #    backend: local
    collection_name: reme
    embedding_model: default

token_counters:
  default:
    backend: base

  hf:
    backend: hf
    model_name: Qwen/Qwen3-Coder-30B-A3B-Instruct
    use_mirror: true

