Skip to main content

Documentation Index

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

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

Use URLs with analytical or causal content

URLs pointing to research reports, news articles, or policy documents with explicit cause-and-effect language (e.g., “leads to”, “causes”, “results in”) produce richer and more accurate graphs.
{ "url": "https://imf.org/en/Publications/WEO" }
For documents you have locally, use the /api/v1/causality-graph/file endpoint instead.
curl -X POST "https://api.factagora.com/api/v1/causality-graph/file" \
  -H "Authorization: Bearer fag_your_api_key" \
  -F "file=@analysis.pdf"

Visualize as a directed graph

The edges array is directional: from is the cause, to is the effect. Use this to render a DAG (directed acyclic graph) in your UI.
edges.forEach(edge => {
  graph.addEdge(edge.from, edge.to, { label: edge.label });
});

Filter isolated nodes

Nodes without any edges are likely extraction artifacts. Filter them out before rendering.
const connectedNodeIds = new Set([
  ...edges.map(e => e.from),
  ...edges.map(e => e.to),
]);
const filteredNodes = nodes.filter(n => connectedNodeIds.has(n.id));

Combine with Timeseries

Use Causality Graph alongside Timeseries to answer both “what happened?” and “why did it happen?”.
Timeseries (what happened) → Causality Graph (why it happened)