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.
Available Endpoints
- 1. Obtain Graph, Statements, and Graph Summary
- 2. Obtain AI-Generated Advice for a Text
- 3. Generate DOT Graph and GraphSummary
- 4. AI-Generated Advice from Knowledge Graph
- 5. List Existing Graphs
- 6. Search Statements and Build Graph
- 7. Compare Graphs of Multiple Contexts
- 8. AI Advice for Several Graphs or Their Difference
- 9. Build a Graph of Google Search Results
- 10. AI Advice for Google Search Results
- 11. Build a Graph of Search Intent
- 12. AI Advice for Search Intent
- 13. Compare Search Results vs. Search Intent
- 14. AI Advice on Search Results vs. Search Intent
- Appendix 1: AI Request Types
- Appendix 2: Optimize Modes
- Appendix 3: Response Object Reference
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.
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 agraphologyGraphobject withnodes(concept words with degree, betweenness centrality, community ID),edges(co-occurrence links with weights), andattributes(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 formainTopics,mainConcepts,contentGaps,conceptualGateways,topRelations, anddiversityStatistics.graphSummary— a plain-text version of the summary (whenincludeGraphSummary=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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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": ""
}
}
| Field | Type | Description |
|---|---|---|
graph | object | The knowledge graph (see Graph Object below) |
statements | array | Text segments with community annotations (see Statements). Empty when includeStatements=false |
extendedGraphSummary | object | Structured summary (see Extended Graph Summary). Included by default |
graphSummary | string | Plain-text summary of concepts, topics, gaps, gateways, and diversity stats. Only when includeGraphSummary=true |
graphUrl | string | URL to the graph on InfraNodus (only when saved with doNotSave=false) |
graphName | string | The context name of the saved graph |
userName | string | Graph owner name or "anonymous" |
isPublic | boolean | Whether this is a public graph being viewed |
warning | string | Present if AI topic generation timed out or was skipped |
Graph Object
The graph field contains:
| Field | Type | Description |
|---|---|---|
graphologyGraph | object | Serialized Graphology graph with nodes, edges, and attributes |
statementHashtags | object | Map of statement IDs to their extracted hashtag arrays |
graphologyGraph.attributes
Graph-level analytics and community structure:
| Field | Type | Description |
|---|---|---|
modularity | number | Community detection modularity score (0–1). Higher = more distinct clusters |
top_nodes | string[] | Top concept names ranked by influence (up to 16) |
top_influential_nodes | array | Top influential node data |
top_clusters | array | Topical clusters (see Clusters) |
gaps | array | Content gaps between clusters (see Gaps) |
diversity_stats | object | Network diversity/bias metrics (see Diversity Stats) |
nodes_to_statements_map | object | Map of node names to arrays of statement IDs they appear in |
dotGraph | string | DOT-format keyword representation of the full graph |
dotGraphByCluster | object | DOT-format representations keyed by cluster ID (also includes pinned, top_nodes, conceptual_gateways) |
allClusters | array | Cluster summaries: { id, community, text, dotGraph, aiName } |
bigrams | object | Connected 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:
| Field | Type | Description |
|---|---|---|
key | string | The concept word (node identifier) |
attributes.degree | number | Number of connections to other concepts |
attributes.bc | number | Betweenness centrality — how much this concept bridges different parts of the graph |
attributes.community | string | Which 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:
| Field | Type | Description |
|---|---|---|
source | string | Source node key |
target | string | Target node key |
attributes.weight | number | Co-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:
| Field | Type | Description |
|---|---|---|
community | string | Cluster/community ID |
nodes | array | Nodes in this cluster: { nodeName: string, bc: number }, sorted by betweenness centrality |
numberRatio | number | Fraction of total nodes in this cluster (degree-based influence) |
bcRatio | number | Fraction of total betweenness centrality held by this cluster |
topStatementId | string | ID of the most representative statement for this cluster |
aiName | string | AI-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:
| Field | Type | Description |
|---|---|---|
from | object | Source cluster: { community, nodes: [{ nodeName, bc }], aiName? } |
to | object | Target 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:
| Field | Type | Description |
|---|---|---|
diversity_score | string | "biased" | "focused" | "diversified" | "dispersed" |
modularity_score | number | Modularity interpretation value |
too_focused_on_top_nodes | boolean | Whether top concepts dominate disproportionately |
too_focused_on_top_clusters | boolean | Whether top clusters dominate disproportionately |
ratio_of_top_nodes_influence_by_betweenness | number | How much betweenness the top nodes hold |
ratio_of_top_cluster_influence_by_betweenness | number | How much betweenness the top clusters hold |
total_clusters | number | Total number of detected clusters |
fair_influence_by_cluster | number | Expected fair betweenness/influence ratio per cluster |
top_nodes_entropy | number | Entropy of how top nodes are distributed among clusters (higher = more evenly spread) |
Statements
Each statement is an input text segment annotated with graph structure:
| Field | Type | Description |
|---|---|---|
id | string | Statement ID |
content | string | The statement text |
statementHashtags | string[] | Concept words extracted from this statement |
statementCommunities | array | Community IDs of the concepts in this statement |
topStatementCommunity | string | The most frequent community in this statement |
topStatementOfCommunity | string | Which community this statement best represents ("none" if not a top representative) |
categories | array | Categories associated with the statement |
timestamp | string | ISO date-time |
by | string | Author or source identifier |
name | string | Graph 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:
| Field | Type | Description |
|---|---|---|
mainTopics | string[] | Formatted topic descriptions with influence percentages |
mainTopicNames | string[] | Topic names only (AI-generated when available) |
mainConcepts | string[] | Top concept names |
contentGaps | string[] | Formatted gap descriptions (e.g. "Topic A → Topic B") |
topInfluentialNodes | array | Top influential node data |
topRelations | string[] | Top co-occurring concept pairs |
topBigrams | string[] | Word pair strings (e.g. "concept1 concept2") |
topicsToDevelop | string[] | DOT-graph suggestions for each cluster |
conceptualGateways | string[] | Nodes that bridge multiple clusters |
conceptualGatewaysGraph | array | DOT-graph structure for gateway nodes |
diversityStatistics | object | Same as diversity_stats above, plus the modularity value |