Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mareforma.com/llms.txt

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

View on GitHub

examples/02_compounding_agents/
Agent A analyses two independent datasets, citing the same upstream evidence. Agent B queries the graph before asserting — finds the REPLICATED findings and builds a DERIVED synthesis on top.

Run

pip install langchain-core
cd examples/02_compounding_agents
python 02_compounding_agents.py
No API key required. To use a real LLM:
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools=[query_graph, assert_finding])

Key pattern

@tool
def query_graph(topic: str, min_support: str = "PRELIMINARY") -> str:
    results = graph.query(topic, min_support=min_support)
    return json.dumps([r["text"] for r in results])

@tool
def assert_finding(text: str, classification: str, supports: list[str]) -> str:
    return graph.assert_claim(
        text, classification=classification, supports=supports,
        generated_by="agent/synthesiser",
    )