Skip to showcase
Organic LLM

Organic LLM is a UI lab and cognition lab for chat: memory, grounded tools, and streaming interfaces that stay inspectable.

Next.jsReactAI SDKClerkSupabaseMem0TailwindCSSQdrantElevenLabsRedis

Anatomy of a Response

A transparent walkthrough of one assistant turn: how Organic LLM packs context, routes tools, streams tokens, and renders the same structured UI you see in chat — using a recorded trace, not a live model call.

Conversation

Summarize the latest thinking on retrieval-augmented generation and show me a diagram of how it works.

Stage 1

Input

When someone hits send, the server gets their message, the model they chose, which tools are enabled, and any files they attached.

Model for this turn

Auto
organic-llm/auto
GPT-6 Astra
openai/gpt-6-astra
GPT-6.1 Sol
openai/gpt-6.1-sol
GPT-6 Luna
openai/gpt-6-luna
GPT OSS [120b]
openai/gpt-oss-120b
GPT OSS [20b]
openai/gpt-oss-20b
Gemini 3.1 Pro
google/gemini-3.1-pro-preview
Gemini 3.8 Flash
google/gemini-3.8-flash
Gemini 3 Flash
google/gemini-3-flash
Gemini 3.5 Flash Lite
google/gemini-3.5-flash-lite
Gemini 2.5 Flash Lite
google/gemini-2.5-flash-lite
Claude Opus 5.5
anthropic/claude-opus-5.5
Claude Sonnet 5.5
anthropic/claude-sonnet-5.5
Claude Haiku 5.5
anthropic/claude-haiku-5.5
Claude Fable 5.1
anthropic/claude-fable-5.1
Sonar Pro
perplexity/sonar-pro
Sonar Reasoning Pro
perplexity/sonar-reasoning-pro
Kimi K3
moonshotai/kimi-k3
Kimi K2.7 Code
moonshotai/kimi-k2.7-code
Kimi K2.6
moonshotai/kimi-k2.6
DeepSeek v4 Pro
deepseek/deepseek-v4-pro
DeepSeek v4.1 Flash
deepseek/deepseek-v4.1-flash

Enabled tools

Web search
Memory search
Chat history
Mermaid
Stage 2

Context load

The server assembles a compact context pack: recent turns plus a rolling summary. Older turns stay in the UI but are omitted from the model window when they would blow the token budget.

Incoming turn

Summarize the latest thinking on retrieval-augmented generation and show me a diagram of how it works.

Context Window

  1. Load thread
    14 latest messages hydrated from storage
  2. Rolling conversation summary
    ~420 tokens attached
  3. Memories merged into pack
    • Diagram-friendly explanations~48 tok
    • RAG latency vs quality focus~52 tok

Window budget

Context Window6,840 / 128,000 tok

Reserved for completion: 4,096 tok · Last-N turns in view: 8

Stage 3

Memory search

Mem0-style retrieval runs against persisted memories. High-relevance snippets are injected into the system context. Low-score or stale rows are dropped so the answer stays grounded and small.

Queryretrieval augmented generation preferences diagramtop-8

Injected into context

  • 91% match

    User prefers concise technical explanations with diagrams when learning new ML topics.

  • 84% match

    User is comparing RAG architectures for a product doc and cares about latency vs quality.

Filtered out

  • 31% match

    User once asked for a plain-text summary of RAG without diagrams; low relevance to this diagram-heavy query.

    Score 0.31 below threshold 0.55

  • 62% match

    Older note: user wanted bullet lists for RAG tradeoffs (latency vs quality) from a prior thread.

    Superseded by newer memory on same topic

Stage 4

Tool routing

The model emits parallel tool calls: refresh the public literature with web search, then materialize structure as a Mermaid diagram. Each call is validated before execution.

Planner

User asked for latest thinking (web) and a diagram (Mermaid). Memory already loaded; run web_search then make_mermaid_diagram.

Tool calls

  • Memory searchcall_mem_001
    Server38 ms

    retrieval augmented generation preferences diagram

  • Web searchcall_web_002
    Server410 ms

    retrieval augmented generation survey 2025 2026 agentic RAG

  • Mermaidcall_mmd_003
    Server120 ms

    Flowchart: user query through embedding, retrieval, rerank, injection, LLM answer.

Stage 5

Token budget & streaming

Streaming keeps time-to-first-token low while a completion budget protects cost. A short system reminder nudges the model to land cleanly before the buffer runs out.

Token meter

Prompt footprint ~6920 tokMax completion 2048 tok

Stream buffer target ~900 chars for smooth UI updates.

Live tail (aiAction stream)

Planning response…

Searching memories for RAG preferences…

Searching the web...

Creating diagram...

Streaming answer…

Graceful finish hint

You are near the end of the allotted completion length. Conclude with at most two short paragraphs and avoid opening new tool calls.
Stage 6

Structured card render

Tool JSON becomes first-class UI: Exa rows as glass cards, memory hits as scored rows, and Mermaid as an acknowledged diagram plus inline rendering in markdown.

Raw markdown
## RAG in one pass

Modern **retrieval-augmented generation** couples a parametric LM with a non-parametric index. Agentic variants add planning loops, but the core contract stays: *retrieve → compress → condition → generate*.

```mermaid
flowchart LR
  Q1["User query"] --> E1["Embed"]
  E1 --> R1["Retrieve top K"]
  R1 --> X1["Rerank and filter"]
  X1 --> I1["Inject into prompt"]
  I1 --> L1["LLM"]
  L1 --> A1["Answer"]
```

The diagram mirrors the tool-generated flowchart so you can compare raw fences with the diagram card.
Rendered

RAG in one pass

Modern retrieval-augmented generation couples a parametric LM with a non-parametric index. Agentic variants add planning loops, but the core contract stays: retrieve → compress → condition → generate.

The diagram mirrors the tool-generated flowchart so you can compare raw fences with the diagram card.

Tool cards
Stage 7

Optional TTS

For read-aloud, citations and code fences are softened into speakable prose. Playback uses the same glass dock styling as chat, but audio here is a short pre-rendered clip—no ElevenLabs call in the browser.

Before preprocessing
## RAG in one pass Modern **retrieval-augmented generation** ... ```mermaid flowchart LR ...```
After preprocessing
RAG in one pass. Modern retrieval augmented generation couples a language model with an external index. The diagram branch reads: query, embed, retrieve top results, rerank, inject into the prompt, then answer.
Recorded playback