Overview

AI Algo Hub provides two ways to access algorithm knowledge programmatically:

  • JavaScript Client API - Available on every page via window.AIAlgoHubAPI
  • REST API - HTTP endpoints for server-side integration (when running the API server)

JavaScript Client API

Available globally on every page as window.AIAlgoHubAPI.

Search Algorithms

// Search by keyword
const results = AIAlgoHubAPI.search("gradient boosting");
// Returns: [{title, url, category, tags, description}, ...]

// Get all algorithms
const all = AIAlgoHubAPI.getAlgorithms();

// Filter by category
const dl = AIAlgoHubAPI.getByCategory("deep learning");
const ml = AIAlgoHubAPI.getByCategory("supervised");

Get Algorithm Recommendations

// Describe your problem, get algorithm recommendations
AIAlgoHubAPI.recommend("classification");
// Returns: ["XGBoost", "Random Forest", "Logistic Regression", "SVM"]

AIAlgoHubAPI.recommend("nlp");
// Returns: ["Transformers", "LSTM", "BERT", "RAG"]

AIAlgoHubAPI.recommend("vision");
// Returns: ["CNN", "Vision Transformer", "ResNet", "EfficientNet"]

AIAlgoHubAPI.recommend("tabular");
// Returns: ["XGBoost", "LightGBM", "CatBoost", "Random Forest"]

AIAlgoHubAPI.recommend("anomaly");
// Returns: ["Isolation Forest", "Autoencoder", "DBSCAN", "GMM"]

REST API Endpoints

Start the API server: node api/server.js --port 3000

Search

GET /api/search?q=xgboost&category=ml-algorithms&level=advanced

# Response:
{
  "results": [
    {
      "id": "xgboost-gradient-boosting",
      "title": "XGBoost / Gradient Boosting",
      "category": "ml-algorithms",
      "level": "advanced",
      "description": "Sequential ensemble that corrects previous errors",
      "url": "ml-algorithms.html#xgboost",
      "score": 0.95
    }
  ],
  "total": 1,
  "query": "xgboost"
}

Get Algorithm Details

GET /api/algorithm/random-forest

# Response:
{
  "id": "random-forest",
  "title": "Random Forest",
  "type": "supervised",
  "tasks": ["classification", "regression"],
  "complexity": { "train": "O(n*m*log(n)*T)", "predict": "O(m*log(n)*T)" },
  "hyperparameters": ["n_estimators", "max_depth", "max_features"],
  "pros": ["Robust", "Handles missing data", "Feature importance"],
  "cons": ["Less interpretable", "Large memory"],
  "when_to_use": "General purpose, minimal tuning needed",
  "when_not_to_use": "Need highest accuracy (use XGBoost instead)",
  "related": ["decision-trees", "xgboost", "adaboost"]
}

Algorithm Recommendation

POST /api/recommend
Content-Type: application/json

{
  "problem": "classification",
  "data_type": "tabular",
  "data_size": "medium",
  "priority": "accuracy"
}

# Response:
{
  "recommendations": [
    { "rank": 1, "algorithm": "XGBoost", "reason": "Best for tabular classification" },
    { "rank": 2, "algorithm": "Random Forest", "reason": "Robust with minimal tuning" },
    { "rank": 3, "algorithm": "Logistic Regression", "reason": "Interpretable baseline" }
  ]
}

Learning Path

GET /api/learning-path/deep-learning?from=beginner

# Response:
{
  "path": [
    { "step": 1, "module": "Ch. 0-3", "topic": "Statistics & Data Foundations", "level": "beginner" },
    { "step": 2, "module": "Ch. 8-10", "topic": "Linear Models", "level": "intermediate" },
    { "step": 3, "module": "Ch. 16", "topic": "Neural Networks & Backprop", "level": "intermediate" },
    { "step": 4, "module": "Ch. 26-29", "topic": "Deep Learning Track", "level": "advanced" }
  ]
}

Agent Context

GET /api/agent/context

# Response: Platform overview with available capabilities,
# categories, and usage instructions for AI agents.

For AI Agents

AI Algo Hub is designed for both human developers and AI coding agents. Agents can:

  • Search - Find the right algorithm for a given problem
  • Learn - Get detailed knowledge about any algorithm
  • Recommend - Get algorithm recommendations based on problem constraints
  • Reference - Access code examples and best practices

Agent Quick Start

// Step 1: Search for relevant algorithms
const results = AIAlgoHubAPI.search("time series forecasting");

// Step 2: Get recommendations
const recs = AIAlgoHubAPI.recommend("timeseries");

// Step 3: Use the knowledge to write better code
// The agent now knows to try LSTM, ARIMA, or XGBoost with lag features

Structured Data Attributes

Every page includes machine-readable metadata:

  • data-level - Difficulty level on each article element
  • .agent-context - Hidden div with category info and API endpoints
  • .callout-tip with "Agent Instruction" - Direct guidance for AI agents

Rate Limits & Authentication

The API is currently open with no authentication required. Rate limits:

EndpointRate Limit
GET /api/search60 requests/minute
GET /api/algorithm/:id120 requests/minute
POST /api/recommend30 requests/minute
GET /api/agent/*60 requests/minute