Skip to main content

Prerequisites

Step 1: Create an Index

Indexes organize your entities into separate namespaces. Create one for your project:
curl -X POST https://neode.ai/api/indexes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "name": "My Knowledge Base",
    "description": "Facts about technology companies"
  }'
Save the index_id from the response - you’ll need it for storing triples.

Step 2: Store Your First Triple

A triple represents a fact as subject-predicate-object. Let’s store a fact about Tesla:
curl -X POST https://neode.ai/api/triples \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "subject": "Tesla",
    "predicate": "founded_by",
    "object": "Elon Musk",
    "object_type": "entity",
    "confidence": 0.95,
    "index_id": "YOUR_INDEX_ID"
  }'
Object Types:
  • Use "entity" when the object is another entity (person, company, place)
  • Use "literal" for values like dates, numbers, or descriptions

Step 3: Query Your Knowledge

Retrieve triples about a specific subject:
curl "https://neode.ai/api/triples?subject=Tesla" \
  -H "Authorization: Bearer YOUR_API_KEY"

Step 4: Generate Triples with AI

Use AI to automatically extract knowledge from natural language:
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 SpaceX and its achievements",
    "index_id": "YOUR_INDEX_ID",
    "web_search": true,
    "triple_count": 10
  }'
AI generation uses credits. Check your balance in the dashboard.

Next Steps