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.

Memory examples enact the trade-off between recall, cost, and latency. Sources under examples/memory/.
NameScenarioSource
memory_typesRun the same 5-turn conversation through Buffer, Window(2), and TokenBufferMemory(200) — watch which ones still pass the recall test.src
memory_summary_buffer10-turn customer support thread — older turns get LLM-summarized into a running summary so the agent can still recall the original order ID.src
memory_knowledge_graphBot learns facts about Project Atlas through conversation, then is asked to recall them — the KG memory stores triples and the agent queries them.src

How to run

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

Pick a starting point

  • First time? memory_types shows all three variants on the same conversation, side by side.
  • Long sessions? memory_summary_buffer is the right default — buffer keeps recent turns, summary keeps the long-tail facts.
  • Knowledge-graph use cases? memory_knowledge_graph for triple-shaped memory across sessions.

See also

Memory guide

All variants explained, when to reach for each.

Patterns → Stateful chat

Memory + persistence in a real chat backend.