GitHub

API Reference

The Functor API provides a comprehensive REST interface for knowledge graph operations, natural language querying, data ingestion, and system monitoring. All endpoints follow RESTful conventions and return JSON responses.

The API reference describes the RESTful APIs you can use to interact with the FAITH-AGENTIC-KG-RAG platform.

Functor provides standard HTTP API interfaces that support multiple programming languages and development environments, with SDKs also available.

Authentication

The Functor API uses API Keys for authentication. An API key is required, which you can create or manage on the API Keys Page (local).

API keys should be provided via the X-API-Key header in HTTP requests.

X-API-Key: YOUR_API_KEY

Playground

The API Playground allows developers to quickly try out API calls. Simply click Try it on any API endpoint display to get started.

  • On the API details page, you can interact directly with the endpoint.
  • You can switch input types and modify parameters.

Call Examples

curl -X POST "http://localhost:8000/api/v1/query" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"query": "What is the relationship between episodic and semantic memory?",
"user_id": "user_123",
"stream": false
}'

API Endpoints

The API is organized into 7 main categories with 70+ endpoints:

Response Format

All responses are JSON objects with consistent structure:

Success Response
{
"answer": "Machine learning is a subset of AI...",
"pipeline_used": "knowledge_graph",
"citations": [...],
"processing_time_ms": 423.5
}
Error Response
{
"detail": "Invalid API key",
"status_code": 401,
"error_type": "authentication_error"
}

HTTP Status Codes

CodeMeaningDescription
200OKRequest succeeded
400Bad RequestInvalid parameters or malformed request
401UnauthorizedMissing or invalid API key
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer encountered an error

Rate Limiting

API requests are rate limited:
  • Query operations: 100 requests per minute
  • Ingestion operations: 20 requests per minute
  • Read operations: 200 requests per minute

SDKs

Official SDKs are available for easier integration: