Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Infiniflow Ragflow Conversation Management

From Leeroopedia
Knowledge Sources
Domains RAG, Conversational_AI
Last Updated 2026-02-12 06:00 GMT

Overview

A stateful session management pattern that creates conversations, streams RAG-powered responses via SSE, and maintains message history.

Description

Conversation Management handles the runtime execution of RAG-powered chat. A Conversation entity tracks message history for a session. The async_chat function orchestrates the full RAG pipeline: retrieve relevant chunks, build a prompt with context, stream LLM responses via Server-Sent Events (SSE), and insert citation markers. Multi-turn conversations are supported by maintaining message history and using it for query rewriting.

Usage

Create a conversation after setting up a chat application. Each conversation maintains independent message history and references.

Theoretical Basis

The RAG chat pipeline follows a retrieve-then-generate pattern:

  • Query rewriting: Multi-turn context is used to rewrite the current query for better retrieval
  • Context injection: Retrieved chunks are formatted and injected into the LLM prompt
  • Streaming: SSE enables real-time token-by-token response delivery

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment