The Ontology Layer · Reference

Discover

Map everything a project knows before you query it.

discover maps everything a project knows before you query it. Call it first: it tells you which sources have data, whether each is fast (indexed) or best-effort (live), and — crucially — whether an empty source is empty because there is nothing there or because its last sync failed.

http
GET /projects/{project_id}/knowledge/discover

Request

No body. The project_id in the path is the only input, plus your auth header.

bash
curl "$ONTOLOGY_URL/projects/$PROJECT_ID/knowledge/discover" \
  -H "X-API-Key: $INTERNAL_SERVICE_KEY"

Response

json
{
  "project_id": "acme-platform",
  "repos": [
    { "repo_id": "acme__platform__main", "git_url": "https://github.com/acme/platform", "branch": "main", "status": "ready" }
  ],
  "sources": [
    { "source": "code", "kind": "semantic", "availability": "indexed", "providers": [], "count": 1284, "description": "Parsed modules and symbols" },
    { "source": "work_items", "kind": "structured", "availability": "indexed", "providers": ["github"], "count": 96, "description": "Issues and work items" }
  ],
  "providers": ["github"],
  "sync": [
    { "internal_project_id": "acme-platform", "provider": "github", "source": "commits", "status": "ok", "items_synced": 3411, "last_synced_at": "2026-09-06T10:04:00Z" }
  ]
}

Fields

  • repos — every repository bound to the project, with its ingestion status.
  • sources — a SourceInfo per available source: its kind, availability, contributing providers, a best-effort count (may be null when counting is costly), and a human description.
  • providers — the sorted union of every provider across all sources.
  • sync — optional per-(provider, source) sync state. This is how you distinguish "no results because the source is empty" from "no results because the credential expired."

Only sources that have something for this project appear. A source whose retriever reports nothing is omitted rather than returned empty.

Next: Search.