Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cognis.vasanth.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The numbered V2 demos are the fastest way to learn the shape of Cognis end-to-end. Each is a self-contained .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

COGNIS_PROVIDER=ollama COGNIS_OLLAMA_MODEL=llama3.1 \
  cargo run -p cognis-examples --example 02_five_line_agent

The set

#NameWhat it showsSource
0101_hello_runnableThe smallest possible Runnable<I, O> impl — what your own chain step looks like.src
0202_five_line_agentAn agent in 5 lines: Client::from_envAgentBuilder::newagent.run.src
0303_custom_graphBypass AgentBuilder and hand-build the graph yourself, then wrap it as an Agent.src
0404_streaming_chatToken-by-token streaming via Client::stream — what wires into a chat UI.src
0505_checkpoint_resumeAttach a Checkpointer, then time-travel through saved supersteps.src
0606_ollama_tool_callingCalculator tool + arithmetic question — the canonical tool-calling agent loop.src
0707_ollama_structured_outputStructuredOutputParser<T> recovering a typed Recipe from free-form LLM text.src
0808_ollama_multi_agentSequential planner → executor handoff for a real task.src
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.