# RAG System Builder Streaming Responses

> Sub-skill of rag-system-builder: Streaming Responses.

- Skill: `vamseeachanta/rag-system-builder-streaming-responses-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/rag-system-builder-streaming-responses-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/rag-system-builder-streaming-responses-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/rag-system-builder-streaming-responses-2

---


# Streaming Responses

## Streaming Responses


For better UX with long answers:

```python
def query_streaming(self, question, top_k=5):
    """Stream RAG response for real-time display."""
    context = self.get_context(question, top_k)
    prompt = self.build_prompt(context, question)

    # Anthropic streaming
    with anthropic.Anthropic().messages.stream(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        messages=[{"role": "user", "content": prompt}]
    ) as stream:
        for text in stream.text_stream:
            yield text
```

