Example — Agents & LangGraph

Drop Coalent into LangGraph, CrewAI, or any agent loop as a fresh, shared context layer — it's just get(query).

Coalent is the fresh, shared memory for agentic systems. Plugging it in is trivial because the read API is one call — cache.get(query) — so it fits any framework without a special adapter.

LangGraph

A LangGraph node is just a function state -> partial_state, so make_cognition_node gives you one in a line — it reads state["question"] and writes the fresh context to state["context"]:

from coalent import make_cognition_node

graph.add_node("context", make_cognition_node(cache))
graph.add_edge("context", "answer")

Customize the state keys or scope as needed:

make_cognition_node(cache, query_key="user_message", output_key="kb", namespace="acme")

The answer node then prompts your LLM with state["context"] — decision-ready and current. Every step that hits this node shares the same cached, fresh understanding.

MCP

build_mcp_tools returns transport-agnostic tool specs you can bind to any MCP runtime — exposing the cache as a coalent.get_context tool to Claude, Cursor, or any MCP agent:

from coalent import build_mcp_tools

tools = build_mcp_tools(cache)   # [{name, description, handler, input_schema}]
# bind `tools` to your MCP server

The tool returns context, raw, sources, cache_hit, and coverage for each call.

Any other framework — one call

No adapter needed anywhere — it's just get(query). Wrap it as a tool for CrewAI, OpenAI tools, or your own loop:

def knowledge(question: str) -> str:
    """Look up fresh, decision-ready context about the company's knowledge."""
    return cache.get(question).context["understanding"]["summary"]

Need the agent to dig deeper on its own? Give it the escalation affordances too:

def get_sources(question: str) -> str:
    """Get the raw source passages behind an answer."""
    return cache.get(question, strategy="context_raw").raw_text

Keep the shared memory fresh

The win for multi-agent systems is consistency: when a source changes, every agent's next read reflects it — no per-agent cache to bust. Wire invalidation once, from your data layer:

# from your ingestion job, webhook, or write path — see the other examples
cache.source_changed("confluence:98231", text=new_text)

Coalent owns context, not actions. Reads and freshness live here; tool calls that do things (send an email, file a ticket) stay in your agent. Clean separation, easy to reason about.

Next