The Evolution of LLM Application Patterns: From Chat to Executable Workflows
This article examines how LLM applications are moving beyond simple chat interfaces toward executable, composable, and observable workflows. It breaks down four core capabilities—runnable application entities, automatic UI generation, multi-model orchestration, and retrieval-augmented generation over private knowledge with citation—and offers practical design guidance for each, including node definitions, schema-driven rendering, DAG orchestration, and permission-aware retrieval. The goal is to show how developers can turn one-off question answering into reliable, business-ready agent applications while keeping risk under control.
1. The Starting Point: Why “Being Able to Chat” Is Not the Same as “Being Able to Work”
Over the past two years, most LLM deployments have been centered on the chat box: the user asks a question, and the model answers. This pattern has a very low learning curve, but it comes with a structural limitation—the model only outputs text. It does not manage state, does not own the interface, and does not drive the process. As soon as a task requires fetching data, making a judgment, and formatting the output, the chat pattern forces the user to manually carry intermediate results from one step to the next.
Because of this, the industry’s technical direction has become clearer: upgrade one-off question answering into workflow-style applications that are repeatable, composable, and observable. Using an advanced mini-app capability from a cloud vendor’s lab as the technical background (without referring to any specific product), this article abstracts four general capabilities and provides practical design methods for each.
2. Capability One: From a “Chat Window with Preset Instructions” to a “Runnable Program Entity”
In the traditional approach, a role-based assistant is essentially a system prompt plus a chat interface. Its behavior is “answer when asked,” with no execution semantics. The advanced form defines the application as a runnable entity, where a single input triggers three types of actions:
- Interface rendering: return structured results and generate visual components;
- Logic processing: perform retrieval, computation, classification, and aggregation following predefined steps;
- Result output: produce results that are interactive, copyable, and ready for further action.
An illustrative node definition (pseudocode that expresses structure only and does not represent any real interface):
app: book-recommendationnodes:- id: inputtype: formfields: [topic, count, style]- id: searchtype: retrievaldepends_on: input- id: ranktype: llm_judgedepends_on: search- id: rendertype: ui_card_listdepends_on: rank
The key difference is that the prompt changes from “text” into an “orchestration contract.” Developers no longer just describe “who you are”; they must describe what the input is, which nodes exist, how the nodes depend on one another, and how failures fall back.
3. Capability Two: Automatic Generation of Visual Interfaces
The advanced form typically relies on an interface-generation middle layer that maps model output to real controls: buttons, input fields, cards, lists, and tables. Take a recipe-style mini-app as an example: the output is not a block of text with a recipe, but an ingredient-list card that users can check off and adjust quantities on directly.
Engineering-wise, three constraints are recommended:
- Structure first: have the model produce a JSON Schema first, then let the rendering layer convert it into controls, avoiding free-text parsing;
- Controlled component whitelist: allow only a limited set of control types to reduce rendering risk;
- Graceful degradation: fall back to plain text when generation fails, ensuring availability.
{"type": "card_list","items": [{"title": "2 tomatoes", "meta": "about 300g", "action": "adjust"}]}
4. Capability Three: Chaining Multiple Models and Orchestrating Workflows
A single model struggles to handle reasoning, image generation, video generation, and retrieval all at once. The value of a workflow lies in dispatching the most suitable model to each node:
- Text understanding and planning: a general-purpose large language model;
- Image assets: a text-to-image model;
- Dynamic assets: a text-to-video model;
- Factual queries: retrieval services and indexes.
Take a book-recommendation workflow as an example. The nodes can be split into: describe a book → retrieve candidates → generate a summary and recommendation blurb for each item → render structured cards. The user enters a single requirement in the chat box, and the system automatically breaks it down into steps such as fetching data, sentiment/tendency analysis, key-point summarization, and formatted layout, then executes them in order.
There are two common orchestration patterns: a declarative DAG (explicit dependencies, easy to parallelize and retry) and a sequential script (simple and intuitive). The former is more recommended for production, with timeouts, idempotency, node-level retries, and caching added on top.
5. Capability Four: Connecting Private Knowledge Bases and Answer Provenance
Combining the reasoning power of LLMs with a private knowledge base is currently the mainstream path for enterprise adoption. The common approach is to attach one or more knowledge sources (notes, papers, project documents) in the conversation, using retrieval-augmented generation to handle recall and answering.
Engineering essentials:
- Multi-source context: allow multiple documents to be selected as context at the same time, paying attention to the token budget and recall ranking;
- Chunking and indexing: chunk semantically while preserving title hierarchy and paragraph position;
- Enforced citation: require answers to include the source file and fragment location;
- Permission inheritance: retrieval must inherit the original document’s permissions to avoid unauthorized leakage.
A simplified retrieval-augmented flow:
def answer(query, sources, top_k=5):ctx = []for s in sources:ctx.extend(s.search(query, top_k=top_k))ctx = sorted(ctx, key=lambda c: c.score, reverse=True)[:top_k]prompt = build_prompt(query, ctx) # require per-item source labelingreturn llm.generate(prompt), cite(ctx)
When an answer can clearly point to “which part of which document,” credibility and auditability improve significantly. This is also the dividing line for whether enterprise scenarios can scale.
6. Implementation Suggestions on Baidu AI Cloud
To implement similar capabilities on Baidu AI Cloud, you can combine general technical categories: use a container platform to host orchestration services, use a message queue to decouple nodes and smooth out traffic spikes, use object storage to save intermediate artifacts, and use logging services with monitoring and alerting for full-chain tracing; on the model side, dispatch different capabilities by task, and on the knowledge-base side, follow the standard paradigm of chunking, indexing, and permission inheritance. Keep the orchestration layer and the model layer decoupled overall, making it easier to swap components and run canary releases later.
7. Conclusion
Moving from chat to workflows is essentially about transforming the LLM from an “answerer” into an “executor.” By focusing on four main threads—runnable entities, automatic interface generation, multi-model orchestration, and traceable private knowledge—you can build agent applications that deliver real business value while keeping risk under control.
