CerebeCerebe Docs

Ingest Knowledge

Add content to the knowledge graph with automatic entity and relationship extraction.

Ingest Knowledge

Ingest text content into Cerebe's Knowledge Graph. The system automatically extracts entities and relationships using Graphiti, building a temporal knowledge graph that evolves over time.

Endpoint

POST /api/v1/knowledge/ingest

Request Body

ParameterTypeRequiredDescription
contentstringYesText content to ingest into the knowledge graph
entity_idstringNoEntity to associate the knowledge with
sourcestringNoSource identifier (e.g., onboarding_notes, lesson_plan)
metadataobjectNoAdditional metadata for the ingestion

Examples

from cerebe import AsyncCerebe

client = AsyncCerebe(api_key="ck_live_...")

result = await client.knowledge.ingest(
    content="Alice is a senior engineer at Acme Corp. She mentors Bob, who joined the team in January.",
    entity_id="team_alpha",
    source="onboarding_notes",
)

print(result)
# → {"entities_created": 3, "relationships_created": 2, "status": "completed"}
import Cerebe from '@cerebe/sdk'

const client = new Cerebe({ apiKey: 'ck_live_...' })

const result = await client.knowledge.ingest({
  content: 'Alice is a senior engineer at Acme Corp. She mentors Bob, who joined the team in January.',
  entityId: 'team_alpha',
  source: 'onboarding_notes',
})

console.log(result)
// → { entitiesCreated: 3, relationshipsCreated: 2, status: "completed" }
curl -X POST https://api.cerebe.ai/api/v1/knowledge/ingest \
  -H "X-API-Key: ck_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Alice is a senior engineer at Acme Corp. She mentors Bob, who joined the team in January.",
    "entity_id": "team_alpha",
    "source": "onboarding_notes"
  }'

Response

{
  "entities_created": 3,
  "relationships_created": 2,
  "status": "completed"
}

Status Values

StatusDescription
completedIngestion succeeded
unavailableKnowledge graph service is not available

How It Works

  1. Content Analysis — The text is parsed to identify entities (people, organizations, concepts) and their relationships.
  2. Entity Extraction — Graphiti extracts structured entities with types and properties.
  3. Relationship Mapping — Connections between entities are identified and stored with temporal metadata.
  4. Temporal Tracking — All facts include timestamps, enabling point-in-time queries (e.g., "Who was Bob's mentor in March?").

Error Responses

StatusDescription
401Missing or invalid API key
503Knowledge graph service unavailable

Next Steps

On this page