Skip to main content
The Engineering Knowledge Graph exposes a REST API built with FastAPI for querying and managing the knowledge graph.

Base URL

When running locally with Docker:
http://localhost:8000

Authentication

The current version does not require authentication. In production deployments, you should add authentication middleware to protect the API endpoints.
This API is designed for internal use within trusted environments. Add authentication before exposing to untrusted networks.

Web Interface

The system includes a web-based chat interface:
GET /
This serves an HTML interface for interactive natural language queries. Access it at http://localhost:8000 when running locally.

Available Endpoints

Query

Process natural language queries

Entities

Get available entities for autocomplete

Reload

Reload configuration data

Health

System health check

Common Response Formats

Success Response

All successful API responses return JSON with appropriate status codes:
{
  "response": "Query result or message",
  "query_type": "downstream",
  "confidence": 0.95
}

Error Response

Errors return standard HTTP status codes with detail messages:
{
  "detail": "Error description"
}

Status Codes

  • 200 - Success
  • 500 - Internal server error

Request Format

All POST requests accept JSON payloads with Content-Type: application/json header.

Example Usage

curl -X POST http://localhost:8000/api/query \
  -H "Content-Type: application/json" \
  -d '{"query": "What does order-service depend on?", "session_id": "demo"}'

FastAPI Documentation

The API also exposes interactive documentation at:
  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc
These provide interactive API testing and detailed schema documentation.

Rate Limiting

The current version does not implement rate limiting. Consider adding rate limiting middleware for production use.

CORS

CORS is not configured by default. Add CORS middleware if you need to access the API from web applications:
from fastapi.middleware.cors import CORSMiddleware

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_methods=["*"],
    allow_headers=["*"],
)

Next Steps

Query Endpoint

Learn about natural language queries

Query Engine

Explore the Python query engine

Build docs developers (and LLMs) love