Skip to main content

Overview

Neode can automatically generate triples from natural language using AI. Just describe what you want to know, and Neode extracts structured facts.

Basic Generation

curl -X POST "https://neode.ai/api/triples/generate?format=json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "query": "Extract key facts about Tesla and its products",
    "index_id": "YOUR_INDEX_ID",
    "triple_count": 10
  }'
Response:
{
  "success": true,
  "data": [
    {
      "id": "uuid-1",
      "subject": "Tesla",
      "predicate": "founded_year",
      "object": "2003",
      "object_type": "literal",
      "confidence": 0.95
    },
    {
      "id": "uuid-2",
      "subject": "Tesla",
      "predicate": "headquarters_in",
      "object": "Austin, Texas",
      "object_type": "entity",
      "confidence": 0.95
    }
    // ... more triples
  ],
  "count": 10,
  "provider": "openai",
  "credits_used": 2,
  "balance_remaining": 98
}
Enable web search for real-time information:
curl -X POST "https://neode.ai/api/triples/generate?format=json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "query": "What are the latest SpaceX Starship test flight results?",
    "index_id": "YOUR_INDEX_ID",
    "web_search": true,
    "triple_count": 15
  }'
Web search is great for:
  • Current events and news
  • Recent product releases
  • Updated statistics
  • Real-time information

Streaming vs JSON

Returns complete response after generation:
curl -X POST "https://neode.ai/api/triples/generate?format=json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{ ... }'

Streaming Format (Default)

Streams results as they’re generated (good for UIs):
curl -X POST "https://neode.ai/api/triples/generate" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{ ... }'

Request Parameters

ParameterTypeRequiredDescription
querystringYesNatural language description of what to extract
index_idUUIDYesIndex for entity disambiguation
graph_idUUIDNoGraph to store triples in
web_searchbooleanNoEnable web search (default: true)
triple_countintegerNoTarget number of triples (default: 10, max: 50)
predicatesstring[]NoRestrict to specific predicate types

Controlling Output

Specify Triple Count

{
  "query": "Facts about Elon Musk's companies",
  "index_id": "YOUR_INDEX_ID",
  "triple_count": 20
}

Restrict Predicates

Focus on specific relationship types:
{
  "query": "Information about tech companies",
  "index_id": "YOUR_INDEX_ID",
  "predicates": ["founded_by", "headquarters_in", "industry", "founded_year"]
}

Add to a Graph

Store generated triples in a specific graph:
{
  "query": "SpaceX Starship specifications",
  "index_id": "YOUR_INDEX_ID",
  "graph_id": "YOUR_GRAPH_ID",
  "triple_count": 10
}

Credits and Pricing

OperationCredits
Generation without web search
Generation with web search
Check your balance:
curl "https://neode.ai/api/credits" \
  -H "Authorization: Bearer YOUR_API_KEY"

Insufficient Credits

When credits are low, you’ll receive:
{
  "success": false,
  "error": "Insufficient credits",
  "balance_cents": 3,
  "required_cents": 5,
  "buy_credits_url": "https://neode.ai/dashboard/settings/billing"
}

Query Tips

Be Specific

// Good - specific and focused
{
  "query": "Extract financial metrics from Tesla's Q4 2025 earnings report"
}

// Avoid - too broad
{
  "query": "Tell me about Tesla"
}

Provide Context

{
  "query": "Key milestones in SpaceX's Starship development program, including test flights and regulatory approvals"
}

Ask for What You Need

{
  "query": "Technical specifications of the iPhone 15 Pro including processor, camera, and battery details"
}

Example Use Cases

Research Assistant

{
  "query": "Summarize the key findings from recent studies on GPT-4 capabilities and limitations",
  "web_search": true,
  "triple_count": 15
}

Competitive Intelligence

{
  "query": "Compare features and pricing of major cloud providers: AWS, Azure, and Google Cloud",
  "web_search": true,
  "triple_count": 20
}

Knowledge Base Building

{
  "query": "Extract biographical information about Nobel Prize winners in Physics from 2020-2025",
  "web_search": true,
  "triple_count": 30
}

News Monitoring

{
  "query": "Latest developments in AI regulation and policy in the European Union",
  "web_search": true,
  "triple_count": 10
}

Error Handling

Rate Limits

If you hit rate limits:
{
  "success": false,
  "error": "Rate limit exceeded",
  "retry_after": 60
}

Invalid Requests

{
  "success": false,
  "error": "index_id is required"
}

API Reference

See the complete Generation API documentation.