Skip to content

[Feature] Implement Streaming Responses for Reduced Perceived Latency #825

Description

@knoxiboy

Description
RAG pipelines are slow because they involve embedding generation, vector retrieval, and LLM generation. Waiting for the entire response to be generated before displaying it leads to poor UX.

Implementation

  1. Update the LLM integration in bots/ (e.g., Langchain or OpenAI SDK) to use streaming mode.
  2. Modify the FastAPI backend/ to return a StreamingResponse or Server-Sent Events (SSE).
  3. Update the React frontend/ chat component to append incoming chunks to the chat bubble in real-time, creating a typewriter effect.
  4. Ensure error handling gracefully manages interrupted streams.

Level: Advanced
Affected Files: backend/api.py, bots/assistant.py, frontend/components/Chat/

Metadata

Metadata

Assignees

No one assigned

    Labels

    gssocGirlScript Summer of Code 2026 issue/PR

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions