The numbered V2 demos are the fastest way to learn the shape of Cognis end-to-end. Each is a self-containedDocumentation Index
Fetch the complete documentation index at: https://cognis.vasanth.xyz/llms.txt
Use this file to discover all available pages before exploring further.
.rs file under examples/v2/. The LLM-backed demos (02, 03, 04, 06, 07, 08) read COGNIS_PROVIDER from the env — set it to ollama for local, or any of the other providers. Demos 01 and 05 are pure-Rust offline (no provider needed).
How to run
The set
| # | Name | What it shows | Source |
|---|---|---|---|
| 01 | 01_hello_runnable | The smallest possible Runnable<I, O> impl — what your own chain step looks like. | src |
| 02 | 02_five_line_agent | An agent in 5 lines: Client::from_env → AgentBuilder::new → agent.run. | src |
| 03 | 03_custom_graph | Bypass AgentBuilder and hand-build the graph yourself, then wrap it as an Agent. | src |
| 04 | 04_streaming_chat | Token-by-token streaming via Client::stream — what wires into a chat UI. | src |
| 05 | 05_checkpoint_resume | Attach a Checkpointer, then time-travel through saved supersteps. | src |
| 06 | 06_ollama_tool_calling | Calculator tool + arithmetic question — the canonical tool-calling agent loop. | src |
| 07 | 07_ollama_structured_output | StructuredOutputParser<T> recovering a typed Recipe from free-form LLM text. | src |
| 08 | 08_ollama_multi_agent | Sequential planner → executor handoff for a real task. | src |
Recommended order
Read in number order for the full guided tour. If you’re impatient, jump to whichever maps to your use case:- Building a chat agent? → 02, then 06 for tools, then 07 for structured output.
- Building a graph workflow? → 01, then 03, then 05 for checkpoints.
- Building multi-agent? → 02, then 08.
- Building a streaming UI? → 04, then Patterns → Streaming UI.
See also
Quickstart guide
The narrative walkthrough of demo 02.
Examples → Agents
More agent patterns beyond the V2 set.
Examples → Graphs
More graph patterns beyond demo 03.
Patterns
Larger applications that combine multiple V2 demos.