InfraNodus API Documentation


All InfraNodus subscribers can use the API to generate AI advice and a knowledge graph from any text. The insights include advanced network graph analytics measures, such as clusters of concepts (topical communities), word rankings, content gaps, and latent concepts. These insights can be used to better understand the data and to augment AI prompts for better RAG results with the underlying knowledge graph data.

Some of the endpoints are also available via RapidAPI, which provides OpenAPI schemas that you can feed to your AI development tools.

Authorization

To authorize, obtain your API token at https://infranodus.com/api-access

Add this API token to your request header:

Authorization: Bearer your_api_token_here

Python example:

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
}

Note: We do provide, at our own discretion, an ability to make several requests for free without using the API key. You won't be able to access all the functions, but you can use it to try the InfraNodus API. For production you absolutely need to get the API key to avoid failures and rate limiting. If you don't have an account, we do offer 14-day free trial.

1. Obtain Graph, Statements, and Graph Summary

Submit text as a string or array of statements (POST) and obtain a graph and statements JSON object, plus a graph summary with insights about topical clusters, main concepts, gaps, and conceptual gateways. Alternatively, specify an existing graph name to generate a knowledge graph JSON and summary for AI RAG workflows.

POST https://infranodus.com/api/v1/graphAndStatements
Query Parameters
doNotSave: boolean (default: true)
addStats: boolean (default: true)
includeStatements: boolean (default: true)
includeGraphSummary: boolean (default: false)
extendedGraphSummary: boolean (default: true)
includeGraph: boolean (default: true)
gapDepth: number (default: 0) // increase up to 3 to iterate through gaps
compactStatements: boolean (default: false)
compactGraph: boolean (default: false)
Privacy Notice

By default (doNotSave=true), your text will NOT be saved. No logs are kept. Processing happens on InfraNodus EU servers (AWS Ireland). If you use AI features (aiTopics), only the concepts in top clusters (not your content) are sent to OpenAI.

Request Body
{
    "name": "name_of_your_graph",
    "text": "text_string_to_process",
    "statements": ["statement 1", "statement 2"],
    "timestamps": [],
    "aiTopics": false,
    "modifyAnalyzedText": "",
    "replaceEntities": false,
    "contextType": "STANDARD",
    "userName": ""
}

If statements is submitted, it overrides text. If neither is specified, InfraNodus retrieves the existing graph by name.

Text Processing Settings (optional)
"contextSettings": {
    "partOfSpeechToProcess": "HASHTAGS_AND_WORDS",
    "doubleSquarebracketsProcessing": "PROCESS_AS_MENTIONS",
    "squareBracketsProcessing": "IGNORE_BRACKETS",
    "mentionsProcessing": "CONNECT_TO_ALL_CONCEPTS"
}
Response

The response is a JSON object with the top-level key entriesAndGraphOfContext, which contains:

  • graph — the knowledge graph as a graphologyGraph object with nodes (concept words with degree, betweenness centrality, community ID), edges (co-occurrence links with weights), and attributes (cluster structure, content gaps, diversity metrics).
  • statements — the original text segments, each annotated with extracted concepts, community assignments, and which topical cluster it best represents.
  • extendedGraphSummary — a structured object with arrays for mainTopics, mainConcepts, contentGaps, conceptualGateways, topRelations, and diversityStatistics.
  • graphSummary — a plain-text version of the summary (when includeGraphSummary=true).
  • diversity_stats — graph structure insights (modularity, bias, diversity, etc.).
  • userName, graphUrl, isPublic — metadata about the graph owner and access.

The graph format follows the InfraNodus schema and is a modified Graphology JSON graph compatible with Graphology, Gephi, and Sigma.Js. See Appendix 3: Response Object Reference for the full structure of every field.

2. Obtain AI-Generated Advice for a Text

Submit plain text and obtain an AI-generated question, statement, or summary that uses the underlying graph structure for precise results.

POST https://infranodus.com/api/v1/graphAndAdvice
Query Parameters
doNotSave: boolean (default: true)
addStats: boolean (default: true)
optimize: string ('develop' | 'reinforce' | 'gap' | 'imagine')
transcend: boolean // do not include graph structure into prompt
includeStatements: boolean (default: false)
includeGraphSummary: boolean (default: false)
extendedGraphSummary: boolean (default: true)
includeGraph: boolean (default: true)
gapDepth: integer (default: 0)
extendedAdvice: boolean (default: false)

Optimize modes:

develop — top nodes from all clusters, helping develop the discourse
reinforce — top nodes from top clusters, reinforcing the discourse
gaps — bridges gaps in the graph structure; uses gapDepth for deeper exploration
latent — finds ideal entry points to connect the discourse to other discourses

Request Body
{
    "name": "name_of_your_graph",
    "text": "text string to process",
    "requestMode": "question",
    "modelToUse": "gpt-4o",
    "pinnedNodes": ["node1", "node2"],
    "prompt": "what is this text about?",
    "promptChatContext": [],
    "aiTopics": false,
    "modifyAnalyzedText": "",
    "replaceEntities": false,
    "stopwords": [],
    "systemPrompt": ""
}

requestMode options: 'question', 'idea', 'fact', 'continue', 'challenge', 'response', 'gptchat', 'summary', 'graph summary', 'reprompt'

Response
{
    "aiAdvice": [
        {
            "text": "AI-generated response text...",
            "finish_reason": "stop"
        }
    ],
    "graph": { "graphologyGraph": {} },
    "statements": [],
    "usage": 338,
    "created_timestamp": 1722261741
}

3. Generate DOT Graph and GraphSummary

Ingest plain text or a Graphology JSON graph and get a compact DOT graph representation plus a graphSummary string, both suitable for forwarding to LLM models as context.

POST https://infranodus.com/api/v1/dotGraph
POST https://infranodus.com/api/v1/dotGraphFromText
Query Parameters
optimize: string ('auto' | 'reinforce' | 'develop' | 'gaps' | 'latent')
includeGraph: boolean (default: false)
includeGraphSummary: boolean (default: true)
extendedGraphSummary: boolean (default: true)
Request Body (for /dotGraphFromText)
{
    "name": "name of the text",
    "text": "apple and oranges are delicious fruits",
    "stopwords": ["car", "tool"],
    "aiTopics": true
}
Response
{
    "graphKeywords": "apple <-> orange [label=\"delicious, fruit\"]...",
    "clusterIds": [],
    "clusterKeywords": "\"delicious orange apple fruit\" and \"lemon make sense\"",
    "allClusters": [
        { "text": "delicious orange apple fruit" },
        { "text": "lemon make sense" }
    ],
    "graphSummary": "",
    "bigrams": [
        "orange <-> delicious",
        "apple <-> orange",
        "delicious <-> fruit"
    ]
}

4. AI-Generated Advice from Knowledge Graph

Submit a knowledge graph in InfraNodus/Graphology format and obtain an AI-generated question or idea that leverages the structural and semantic information.

POST https://infranodus.com/api/v1/graphAiAdvice
Query Parameters
optimize: string ('gaps' | 'reinforce' | 'develop' | 'imagine')
transcend: boolean // go beyond the graph structure
Request Body
{
    "prompt": "What connections exist between these concepts?",
    "userPrompt": [{ "role": "user", "content": "prompt text" }],
    "promptContext": "",
    "promptChatContext": [],
    "requestMode": "question",
    "language": "EN",
    "modelToUse": "gpt-4",
    "pinnedNodes": [],
    "topicsToProcess": [],
    "graph": {
        "nodes": [],
        "edges": [],
        "attributes": {
            "top_nodes": [],
            "top_clusters": [],
            "gaps": [],
            "statementHashtags": []
        }
    },
    "statements": []
}
Response
{
    "aiAdvice": [
        {
            "text": "AI-generated insight...",
            "finish_reason": "stop"
        }
    ],
    "usage": 338,
    "created_timestamp": 1722261741
}

5. List Existing Graphs

Retrieve all graphs created by a user with various filters (favorite, name, date, type, language).

POST https://infranodus.com/api/v1/listGraphs
Request Body
Parameter Type Description
query string Search term(s) to match against contextName and description
type string Filter by contextType (e.g. "CSV", "GOOGLE", "STANDARD")
fromDate string (ISO) Filter graphs created on or after this date
toDate string (ISO) Filter graphs created on or before this date
language string Filter by language code (e.g. "EN", "DE")
favorite boolean Filter by favorite status

Use comma-separated values for OR logic: "csv,google" matches CSV or GOOGLE.

{
    "query": "expert,ontology",
    "type": "STANDARD",
    "language": "EN"
}

6. Search Statements and Build Graph

Submit a search term and get all matching statements, then build a graph from them.

POST https://infranodus.com/api/v1/search
Request Body
{
    "query": "graphrag",
    "contextNames": "",
    "userName": "",
    "maxNodes": 150,
    "showContexts": false
}
Response

Returns a list of statements and a graph in JSON format following the InfraNodus return object schema.

7. Compare Graphs of Multiple Contexts

Submit several contexts (existing graphs, statement arrays, or text strings) and obtain a graph that merges them, shows overlap, or highlights differences.

POST https://infranodus.com/api/v1/compareGraphs
Query Parameters
doNotSave: boolean (default: true)
addStats: boolean (default: true)
includeStatements: boolean (default: false)
includeGraphSummary: boolean (default: false)
includeGraph: boolean (default: true)
mode: string ('merge' | 'overlap' | 'difference')
Request Body
{
    "contexts": [
        { "text": "first text to compare" },
        { "text": "second text to compare" },
        { "name": "existing_graph_name" }
    ]
}

Each context can be provided as text (plain text string), name (existing graph name), or statements (array). For the full specification, see the complete API documentation.

8. AI-Generated Advice for Several Graphs or Their Difference

Submit plain texts, existing contexts, or arrays of statements and obtain AI-generated advice that takes the underlying graph structure (or the difference of the graphs) into account.

POST https://infranodus.com/api/v1/graphsAndAiAdvice
Query Parameters

Same parameters as the graphAndAdvice endpoint (#2), plus the compareMode parameter from the compareGraphs endpoint (#7).

Request Body

Contexts should follow the same format as the compareGraphs endpoint (#7). You can also include body parameters from the graphAndAdvice endpoint (#2).

const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/graphsAndAiAdvice'
  + '?doNotSave=true&addStats=true&optimize=gaps';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    contexts: [
      { text: 'First text to analyze' },
      { text: 'Second text to compare' }
    ],
    requestMode: 'question',
    compareMode: 'difference'
  })
});

const data = await response.json();
console.log(data.aiAdvice);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/graphsAndAiAdvice',
    params={'doNotSave': 'true', 'addStats': 'true', 'optimize': 'gaps'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'contexts': [
            {'text': 'First text to analyze'},
            {'text': 'Second text to compare'}
        ],
        'requestMode': 'question',
        'compareMode': 'difference'
    }
)

data = response.json()
print(data['aiAdvice'])
curl -X POST "https://infranodus.com/api/v1/graphsAndAiAdvice?\
doNotSave=true&addStats=true&optimize=gaps" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "contexts": [
      {"text": "First text to analyze"},
      {"text": "Second text to compare"}
    ],
    "requestMode": "question",
    "compareMode": "difference"
  }'
const url = 'https://infranodus.com/api/v1/graphsAndAiAdvice'
  + '?doNotSave=true&addStats=true&optimize=gaps';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    contexts: [
      { text: 'First text to analyze' },
      { text: 'Second text to compare' }
    ],
    requestMode: 'question',
    compareMode: 'difference'
  })
});

const data = await response.json();
console.log(data.aiAdvice);

9. Build a Graph of Google Search Results

Submit a search query to generate a knowledge graph of the top Google search results. Useful for getting an overview of the current informational supply, finding content gaps, performing SEO optimization, and integrating search results data into LLM workflows.

POST https://infranodus.com/api/v1/import/googleSearchResultsGraph
Query Parameters
doNotSave: boolean (default: false)
// plus other parameters from the graphAndStatements endpoint (#1)
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "doNotAddGraph": false,
    "importCountry": "US",
    "importLanguage": "AUTO"
}
const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/import/googleSearchResultsGraph'
  + '?doNotSave=true&addStats=true&compactGraph=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    importCountry: 'US',
    importLanguage: 'EN'
  })
});

const data = await response.json();
console.log(data.entriesAndGraphOfContext);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchResultsGraph',
    params={'doNotSave': 'true', 'addStats': 'true', 'compactGraph': 'true'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True,
        'importCountry': 'US',
        'importLanguage': 'EN'
    }
)

data = response.json()
print(data['entriesAndGraphOfContext'])
curl -X POST "https://infranodus.com/api/v1/import/googleSearchResultsGraph?\
doNotSave=true&addStats=true&compactGraph=true" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "importCountry": "US",
    "importLanguage": "EN"
  }'
const url = 'https://infranodus.com/api/v1/import/googleSearchResultsGraph'
  + '?doNotSave=true&addStats=true&compactGraph=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    importCountry: 'US',
    importLanguage: 'EN'
  })
});

const data = await response.json();
console.log(data.entriesAndGraphOfContext);
Response
{
    "entriesAndGraphOfContext": {
        "statements": [{
            "content": "Statement content",
            "categories": ["category 1", "category 2"]
        }],
        "graph": {
            "nodes": [],
            "edges": [],
            "graph": { "nodes_to_statements_map": {} }
        }
    }
}

10. AI Advice for Google Search Results

Get AI-generated advice and research questions based on topical clusters or content gaps identified in Google search results for a query.

POST https://infranodus.com/api/v1/import/googleSearchResultsAiAdvice
Query Parameters
doNotSave: boolean (default: false)
// plus other parameters from the graphAndAdvice endpoint (#2)
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question",
    "importCountry": "US",
    "importLanguage": "AUTO"
}
const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/import/googleSearchResultsAiAdvice'
  + '?doNotSave=true&optimize=gaps';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    requestMode: 'question'
  })
});

const data = await response.json();
console.log(data.aiAdvice);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchResultsAiAdvice',
    params={'doNotSave': 'true', 'optimize': 'gaps'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True,
        'requestMode': 'question'
    }
)

data = response.json()
print(data['aiAdvice'])
curl -X POST "https://infranodus.com/api/v1/import/googleSearchResultsAiAdvice?\
doNotSave=true&optimize=gaps" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question"
  }'
const url = 'https://infranodus.com/api/v1/import/googleSearchResultsAiAdvice'
  + '?doNotSave=true&optimize=gaps';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    requestMode: 'question'
  })
});

const data = await response.json();
console.log(data.aiAdvice);
Response

Same structure as the graphAndAdvice endpoint (#2) response.

11. Build a Graph of Search Intent

Submit a search query to generate a knowledge graph of related keywords (from Google's suggested keywords or AdWords recommendations) that people use to search for this topic. Useful for understanding informational demand, finding topical clusters and related keywords, and SEO optimization.

POST https://infranodus.com/api/v1/import/googleSearchIntentGraph
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "doNotAddGraph": false,
    "keywordsSource": "related",
    "importCountry": "US",
    "importLanguage": "AUTO"
}
const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/import/googleSearchIntentGraph'
  + '?doNotSave=true&addStats=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    keywordsSource: 'related',
    importCountry: 'US'
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchIntentGraph',
    params={'doNotSave': 'true', 'addStats': 'true'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True,
        'keywordsSource': 'related',
        'importCountry': 'US'
    }
)

data = response.json()
print(data)
curl -X POST "https://infranodus.com/api/v1/import/googleSearchIntentGraph?\
doNotSave=true&addStats=true" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "keywordsSource": "related",
    "importCountry": "US"
  }'
const url = 'https://infranodus.com/api/v1/import/googleSearchIntentGraph'
  + '?doNotSave=true&addStats=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    keywordsSource: 'related',
    importCountry: 'US'
  })
});

const data = await response.json();
console.log(data);
Response

Returns a list of statements and a graph in JSON format following the InfraNodus return object schema.

12. AI Advice for Search Intent

Get AI-generated advice and research questions based on topical clusters or content gaps identified in suggested Google search queries. Useful for generating ideas based on current informational demand.

POST https://infranodus.com/api/v1/import/googleSearchIntentAiAdvice
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question",
    "keywordsSource": "related"
}
const fetch = require('node-fetch');

const response = await fetch(
  'https://infranodus.com/api/v1/import/googleSearchIntentAiAdvice?doNotSave=true',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer your_api_token_here'
    },
    body: JSON.stringify({
      searchQuery: 'graphrag',
      aiTopics: true,
      requestMode: 'question',
      keywordsSource: 'related'
    })
  }
);

const data = await response.json();
console.log(data.aiAdvice);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchIntentAiAdvice',
    params={'doNotSave': 'true'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True,
        'requestMode': 'question',
        'keywordsSource': 'related'
    }
)

data = response.json()
print(data['aiAdvice'])
curl -X POST "https://infranodus.com/api/v1/import/googleSearchIntentAiAdvice?\
doNotSave=true" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question",
    "keywordsSource": "related"
  }'
const response = await fetch(
  'https://infranodus.com/api/v1/import/googleSearchIntentAiAdvice?doNotSave=true',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer your_api_token_here'
    },
    body: JSON.stringify({
      searchQuery: 'graphrag',
      aiTopics: true,
      requestMode: 'question',
      keywordsSource: 'related'
    })
  }
);

const data = await response.json();
console.log(data.aiAdvice);
Response

Same structure as the graphAndAdvice endpoint (#2) response.

13. Compare Search Results vs. Search Intent

Generate a graph showing relations that exist in search intent but not in search results, along with topical clusters and content gaps. Useful for understanding what people search for but don't find and adjusting content strategy to cater to underserved niches.

POST https://infranodus.com/api/v1/import/googleSearchVsIntentGraph
Query Parameters
compareMode: string ('difference' | 'difference_nodes')
// plus other parameters from the graphAndStatements endpoint (#1)
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true
}
const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/import/googleSearchVsIntentGraph'
  + '?compareMode=difference&doNotSave=true&addStats=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchVsIntentGraph',
    params={'compareMode': 'difference', 'doNotSave': 'true', 'addStats': 'true'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True
    }
)

data = response.json()
print(data)
curl -X POST "https://infranodus.com/api/v1/import/googleSearchVsIntentGraph?\
compareMode=difference&doNotSave=true&addStats=true" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true
  }'
const url = 'https://infranodus.com/api/v1/import/googleSearchVsIntentGraph'
  + '?compareMode=difference&doNotSave=true&addStats=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true
  })
});

const data = await response.json();
console.log(data);

14. AI Advice on Search Results vs. Search Intent

Get AI-generated advice and research questions based on the graph of what people search for but don't find. Useful for generating ideas based on informational demand not catered to by current supply.

POST https://infranodus.com/api/v1/import/googleSearchVsIntentAiAdvice
Query Parameters
compareMode: string ('difference' | 'difference_nodes')
// plus other parameters from the graphAndAdvice endpoint (#2)
Request Body
{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question",
    "keywordsSource": "related"
}
const fetch = require('node-fetch');

const url = 'https://infranodus.com/api/v1/import/googleSearchVsIntentAiAdvice'
  + '?compareMode=difference&doNotSave=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    requestMode: 'question',
    keywordsSource: 'related'
  })
});

const data = await response.json();
console.log(data.aiAdvice);
import requests

response = requests.post(
    'https://infranodus.com/api/v1/import/googleSearchVsIntentAiAdvice',
    params={'compareMode': 'difference', 'doNotSave': 'true'},
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer your_api_token_here'
    },
    json={
        'searchQuery': 'graphrag',
        'aiTopics': True,
        'requestMode': 'question',
        'keywordsSource': 'related'
    }
)

data = response.json()
print(data['aiAdvice'])
curl -X POST "https://infranodus.com/api/v1/import/googleSearchVsIntentAiAdvice?\
compareMode=difference&doNotSave=true" \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQuery": "graphrag",
    "aiTopics": true,
    "requestMode": "question",
    "keywordsSource": "related"
  }'
const url = 'https://infranodus.com/api/v1/import/googleSearchVsIntentAiAdvice'
  + '?compareMode=difference&doNotSave=true';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_token_here'
  },
  body: JSON.stringify({
    searchQuery: 'graphrag',
    aiTopics: true,
    requestMode: 'question',
    keywordsSource: 'related'
  })
});

const data = await response.json();
console.log(data.aiAdvice);
Response

Same structure as the graphAndAdvice endpoint (#2) response.

Appendix 1: AI Request Types

The requestMode parameter controls what kind of insight the model generates. It influences the final prompt sent to the LLM.

Value Description
summary Generates a summary augmented with graph structure and your custom prompt
graph summary Generates summaries for each topical cluster. Use with aiTopics=true for best results
question Generates a question that bridges structural gaps in the graph
paraphrase Extracts the graph's structure and paraphrases main topics in one paragraph
outline Generates a title and article outline based on the graph's structure
continue Generates a statement connecting concepts in the prompt using the graph structure
response Direct response to the prompt, taking graph structure and conversation context into account
idea Generates an innovative idea that bridges structural gaps in the graph
fact Generates a factual statement that bridges structural gaps in the graph
challenge Generates a challenging statement that bridges structural gaps in the graph
reprompt Rewrites your original prompt using context information — useful for GraphRAG prompt augmentation
custom Uses your own prompt from the prompt parameter. The graph data is appended automatically, so adjust your prompt accordingly
transcend Selects topical clusters based on the optimize value (or content gaps by default) and then generates ideas that go beyond the graph structure — while still taking the identified topics and conceptual gateways into account. Useful for exploring how the discourse connects to broader themes and for generating novel perspectives that are informed by the graph but not constrained by it

Appendix 2: Optimize Modes

The optimize query parameter controls how the algorithm selects which parts of the knowledge graph to focus on when generating AI advice. Each mode uses a different strategy based on the graph's topical structure.

Value Description
develop Gets the top nodes from all clusters of the graph, helping develop the current discourse broadly. If pinnedNodes or topicsToProcess are provided, it focuses on those instead.
reinforce Gets the top nodes from the top clusters only, reinforcing the dominant themes of the current discourse.
gaps Identifies structural gaps in the graph and directs the prompt to bridge them. When the graph is diverse, focuses on the most common gap. When highly connected, encourages exploring the least connected topics on the periphery. Use the gapDepth parameter (0–3) to reach deeper, less obvious gaps — higher values select further gaps with smaller topics in focus.
latent Identifies the least represented topical clusters and attempts to bridge them, bringing underdeveloped areas of the discourse into focus.
imagine Identifies the least represented clusters and the ideal entry points into the graph — nodes with the highest ratio of influence (betweenness centrality) to degree. These conceptual gateways can potentially connect the text to other discourses, helping explore beyond the periphery.
optimize Analyzes the level of bias and coherence in the text network structure automatically. If the structure is too biased, it focuses on the least represented topics. If focused or diversified, it develops the content gaps. If dispersed, it develops the most common gap topics. This is the best choice when you want the algorithm to adapt to the text automatically.

Appendix 3: Response Object Reference

This appendix documents the complete structure of the entriesAndGraphOfContext object returned by the graphAndStatements endpoint and shared by most other graph-returning endpoints.

Top-Level Envelope
{
    "entriesAndGraphOfContext": {
        "graph": {},
        "statements": [],
        "extendedGraphSummary": {},
        "graphSummary": "",
        "graphUrl": "",
        "graphName": "",
        "userName": "",
        "isPublic": false,
        "warning": ""
    }
}
FieldTypeDescription
graphobjectThe knowledge graph (see Graph Object below)
statementsarrayText segments with community annotations (see Statements). Empty when includeStatements=false
extendedGraphSummaryobjectStructured summary (see Extended Graph Summary). Included by default
graphSummarystringPlain-text summary of concepts, topics, gaps, gateways, and diversity stats. Only when includeGraphSummary=true
graphUrlstringURL to the graph on InfraNodus (only when saved with doNotSave=false)
graphNamestringThe context name of the saved graph
userNamestringGraph owner name or "anonymous"
isPublicbooleanWhether this is a public graph being viewed
warningstringPresent if AI topic generation timed out or was skipped
Graph Object

The graph field contains:

FieldTypeDescription
graphologyGraphobjectSerialized Graphology graph with nodes, edges, and attributes
statementHashtagsobjectMap of statement IDs to their extracted hashtag arrays
graphologyGraph.attributes

Graph-level analytics and community structure:

FieldTypeDescription
modularitynumberCommunity detection modularity score (0–1). Higher = more distinct clusters
top_nodesstring[]Top concept names ranked by influence (up to 16)
top_influential_nodesarrayTop influential node data
top_clustersarrayTopical clusters (see Clusters)
gapsarrayContent gaps between clusters (see Gaps)
diversity_statsobjectNetwork diversity/bias metrics (see Diversity Stats)
nodes_to_statements_mapobjectMap of node names to arrays of statement IDs they appear in
dotGraphstringDOT-format keyword representation of the full graph
dotGraphByClusterobjectDOT-format representations keyed by cluster ID (also includes pinned, top_nodes, conceptual_gateways)
allClustersarrayCluster summaries: { id, community, text, dotGraph, aiName }
bigramsobjectConnected word pairs keyed by cluster ID
includeGraph=false

When includeGraph=false, nodes, edges, top_nodes, top_clusters, gaps, dotGraph, dotGraphByCluster, allClusters, bigrams, and nodes_to_statements_map are removed from the response.

graphologyGraph.nodes

Each node represents a concept (word or entity) in the graph:

FieldTypeDescription
keystringThe concept word (node identifier)
attributes.degreenumberNumber of connections to other concepts
attributes.bcnumberBetweenness centrality — how much this concept bridges different parts of the graph
attributes.communitystringWhich topical cluster this node belongs to

With compactGraph=true, nodes are reduced to { key, attributes: { bc } }.

graphologyGraph.edges

Each edge represents a co-occurrence relationship between two concepts:

FieldTypeDescription
sourcestringSource node key
targetstringTarget node key
attributes.weightnumberCo-occurrence weight (higher = more frequently appear together)

With compactGraph=true, edges are reduced to { source, target, attributes: { weight } }.

top_clusters (Topical Clusters)

Each entry in top_clusters represents a detected topical community:

FieldTypeDescription
communitystringCluster/community ID
nodesarrayNodes in this cluster: { nodeName: string, bc: number }, sorted by betweenness centrality
numberRationumberFraction of total nodes in this cluster (degree-based influence)
bcRationumberFraction of total betweenness centrality held by this cluster
topStatementIdstringID of the most representative statement for this cluster
aiNamestringAI-generated topic name (when aiTopics=true)
gaps (Content Gaps)

Each gap represents a structural hole between two topical clusters — a potential area for new content or insight:

FieldTypeDescription
fromobjectSource cluster: { community, nodes: [{ nodeName, bc }], aiName? }
toobjectTarget cluster: { community, nodes: [{ nodeName, bc }], aiName? }

Use the gapDepth query parameter (0–3) to cycle through gaps from the most prominent to deeper, less obvious ones.

diversity_stats

Measures how balanced the text's topical structure is:

FieldTypeDescription
diversity_scorestring"biased" | "focused" | "diversified" | "dispersed"
modularity_scorenumberModularity interpretation value
too_focused_on_top_nodesbooleanWhether top concepts dominate disproportionately
too_focused_on_top_clustersbooleanWhether top clusters dominate disproportionately
ratio_of_top_nodes_influence_by_betweennessnumberHow much betweenness the top nodes hold
ratio_of_top_cluster_influence_by_betweennessnumberHow much betweenness the top clusters hold
total_clustersnumberTotal number of detected clusters
fair_influence_by_clusternumberExpected fair betweenness/influence ratio per cluster
top_nodes_entropynumberEntropy of how top nodes are distributed among clusters (higher = more evenly spread)
Statements

Each statement is an input text segment annotated with graph structure:

FieldTypeDescription
idstringStatement ID
contentstringThe statement text
statementHashtagsstring[]Concept words extracted from this statement
statementCommunitiesarrayCommunity IDs of the concepts in this statement
topStatementCommunitystringThe most frequent community in this statement
topStatementOfCommunitystringWhich community this statement best represents ("none" if not a top representative)
categoriesarrayCategories associated with the statement
timestampstringISO date-time
bystringAuthor or source identifier
namestringGraph context name

With compactStatements=true, statements are reduced to: { id, content, categories, topStatementCommunity, topStatementOfCommunity }.

Extended Graph Summary

The extendedGraphSummary is a structured object (included by default) that provides pre-processed analytics:

FieldTypeDescription
mainTopicsstring[]Formatted topic descriptions with influence percentages
mainTopicNamesstring[]Topic names only (AI-generated when available)
mainConceptsstring[]Top concept names
contentGapsstring[]Formatted gap descriptions (e.g. "Topic A → Topic B")
topInfluentialNodesarrayTop influential node data
topRelationsstring[]Top co-occurring concept pairs
topBigramsstring[]Word pair strings (e.g. "concept1 concept2")
topicsToDevelopstring[]DOT-graph suggestions for each cluster
conceptualGatewaysstring[]Nodes that bridge multiple clusters
conceptualGatewaysGrapharrayDOT-graph structure for gateway nodes
diversityStatisticsobjectSame as diversity_stats above, plus the modularity value