> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wistx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Research

> Deep research tool for DevOps, infrastructure, compliance, FinOps, and platform engineering knowledge

> Deep research tool for DevOps, infrastructure, compliance, FinOps, and platform engineering knowledge

<Info>
  **Base URL:** The API playground uses `http://localhost:8000` for local development.
  Switch to `https://api.wistx.ai` for production by selecting the server from the dropdown above.
</Info>

## Endpoint

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.wistx.ai/v1/knowledge/research \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "query": "What are the best practices for securing RDS databases?",
      "domains": ["compliance", "security"],
      "content_types": ["guide", "best_practice"],
      "include_cross_domain": true,
      "include_global": true,
      "format": "structured",
      "max_results": 20
    }'
  ```

  ```python Python theme={null}
  import requests

  api_key = "YOUR_API_KEY"
  url = "https://api.wistx.ai/v1/knowledge/research"

  response = requests.post(
      url,
      headers={
          "Authorization": f"Bearer {api_key}",
          "Content-Type": "application/json"
      },
      json={
          "query": "What are the best practices for securing RDS databases?",
          "domains": ["compliance", "security"],
          "content_types": ["guide", "best_practice"],
          "include_cross_domain": True,
          "include_global": True,
          "format": "structured",
          "max_results": 20
      }
  )

  data = response.json()
  print(data)
  ```

  ```javascript JavaScript theme={null}
  const apiKey = "YOUR_API_KEY";
  const url = "https://api.wistx.ai/v1/knowledge/research";

  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      query: "What are the best practices for securing RDS databases?",
      domains: ["compliance", "security"],
      content_types: ["guide", "best_practice"],
      include_cross_domain: true,
      include_global: true,
      format: "structured",
      max_results: 20
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      apiKey := "YOUR_API_KEY"
      url := "https://api.wistx.ai/v1/knowledge/research"

      payload := map[string]interface{}{
          "query": "What are the best practices for securing RDS databases?",
          "domains": []string{"compliance", "security"},
          "content_types": []string{"guide", "best_practice"},
          "include_cross_domain": true,
          "include_global": true,
          "format": "structured",
          "max_results": 20,
      }

      jsonData, _ := json.Marshal(payload)
      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  api_key = "YOUR_API_KEY"
  url = URI("https://api.wistx.ai/v1/knowledge/research")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(url)
  request["Authorization"] = "Bearer #{api_key}"
  request["Content-Type"] = "application/json"
  request.body = {
    query: "What are the best practices for securing RDS databases?",
    domains: ["compliance", "security"],
    content_types: ["guide", "best_practice"],
    include_cross_domain: true,
    include_global: true,
    format: "structured",
    max_results: 20
  }.to_json

  response = http.request(request)
  puts JSON.parse(response.body)
  ```

  ```php PHP theme={null}
  <?php

  $apiKey = "YOUR_API_KEY";
  $url = "https://api.wistx.ai/v1/knowledge/research";

  $data = [
      "query" => "What are the best practices for securing RDS databases?",
      "domains" => ["compliance", "security"],
      "content_types" => ["guide", "best_practice"],
      "include_cross_domain" => true,
      "include_global" => true,
      "format" => "structured",
      "max_results" => 20
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer " . $apiKey,
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ```

  ```java Java theme={null}
  import java.net.HttpURLConnection;
  import java.net.URL;
  import java.io.OutputStream;
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import com.google.gson.Gson;
  import com.google.gson.JsonObject;

  public class KnowledgeResearch {
      public static void main(String[] args) throws Exception {
          String apiKey = "YOUR_API_KEY";
          URL url = new URL("https://api.wistx.ai/v1/knowledge/research");
          
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          conn.setRequestMethod("POST");
          conn.setRequestProperty("Authorization", "Bearer " + apiKey);
          conn.setRequestProperty("Content-Type", "application/json");
          conn.setDoOutput(true);
          
          JsonObject payload = new JsonObject();
          payload.addProperty("query", "What are the best practices for securing RDS databases?");
          payload.addProperty("include_cross_domain", true);
          payload.addProperty("include_global", true);
          payload.addProperty("format", "structured");
          payload.addProperty("max_results", 20);
          
          Gson gson = new Gson();
          String[] domains = {"compliance", "security"};
          String[] contentTypes = {"guide", "best_practice"};
          payload.add("domains", gson.toJsonTree(domains));
          payload.add("content_types", gson.toJsonTree(contentTypes));
          
          try (OutputStream os = conn.getOutputStream()) {
              byte[] input = gson.toJson(payload).getBytes("utf-8");
              os.write(input, 0, input.length);
          }
          
          BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
          StringBuilder response = new StringBuilder();
          String responseLine;
          while ((responseLine = br.readLine()) != null) {
              response.append(responseLine.trim());
          }
          System.out.println(response.toString());
      }
  }
  ```
</CodeGroup>

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`
</ParamField>

## Request Body

<ParamField body="query" type="string" required>
  Research query in natural language. Should be specific and detailed for best results.

  **Minimum length:** 10 characters\
  **Maximum length:** 10,000 characters
</ParamField>

<ParamField body="domains" type="array[string]">
  Filter results by knowledge domains.

  **Options:**

  * `compliance` - Compliance standards and requirements
  * `finops` - Financial operations and cost optimization
  * `devops` - DevOps practices and methodologies
  * `infrastructure` - Infrastructure patterns and designs
  * `security` - Security best practices
  * `architecture` - Architecture patterns and designs
  * `cloud` - Cloud-specific guidance
  * `automation` - Automation strategies
  * `platform` - Platform engineering
  * `sre` - Site Reliability Engineering

  **Default:** `[]` (all domains)\
  **Maximum:** 20 items
</ParamField>

<ParamField body="content_types" type="array[string]">
  Filter results by content type.

  **Options:**

  * `guide` - Step-by-step guides
  * `pattern` - Design patterns
  * `strategy` - Strategic guidance
  * `checklist` - Checklists and procedures
  * `reference` - Reference documentation
  * `best_practice` - Best practices

  **Default:** `[]` (all content types)\
  **Maximum:** 20 items
</ParamField>

<ParamField body="include_cross_domain" type="boolean">
  Include cross-domain relationships and impacts in results. Shows how compliance, cost, and security intersect.

  **Default:** `true`
</ParamField>

<ParamField body="include_global" type="boolean">
  Include global/shared knowledge base content. Set to `false` to search only user's indexed content.

  **Default:** `true`
</ParamField>

<ParamField body="format" type="string">
  Response format for the research results.

  **Options:**

  * `structured` - Structured JSON format (default)
  * `markdown` - Markdown format optimized for LLM consumption
  * `executive_summary` - High-level summary format

  **Default:** `structured`
</ParamField>

<ParamField body="max_results" type="integer">
  Maximum number of results to return.

  **Minimum:** 1\
  **Maximum:** 100\
  **Default:** 20
</ParamField>

## Response

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "data": {
      "results": [
        {
          "article_id": "kb_abc123",
          "domain": "security",
          "subdomain": "database_security",
          "content_type": "best_practice",
          "title": "RDS Database Security Best Practices",
          "summary": "Comprehensive guide to securing RDS databases including encryption, access control, and monitoring...",
          "content": "Full article content...",
          "tags": ["rds", "encryption", "iam", "monitoring"],
          "categories": ["database", "security"],
          "industries": ["finance", "healthcare"],
          "cloud_providers": ["aws"],
          "services": ["rds", "kms", "cloudwatch"],
          "cross_domain_impacts": {
            "compliance": {
              "standards": ["PCI-DSS", "HIPAA"],
              "controls": ["PCI-DSS-3.4", "HIPAA-164.312"]
            },
            "cost": {
              "impact": "Encryption adds minimal cost (~5% overhead)",
              "optimization": "Use KMS customer-managed keys for better cost control"
            }
          },
          "source_url": "https://docs.aws.amazon.com/rds/...",
          "quality_score": 0.95
        }
      ],
      "research_summary": {
        "total_found": 45,
        "domains_covered": ["security", "compliance", "infrastructure"],
        "key_insights": [
          "Encryption at rest and in transit is critical for RDS security",
          "IAM-based access control reduces attack surface",
          "Continuous monitoring detects anomalies early"
        ]
      },
      "metadata": {
        "query_time_ms": 456,
        "filters_applied": {
          "domains": ["compliance", "security"],
          "content_types": ["guide", "best_practice"]
        }
      }
    },
    "metadata": {
      "request_id": "req_abc123",
      "timestamp": 1704067200.0,
      "query_time_ms": 456
    }
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid request parameters",
      "details": "Query must be at least 10 characters"
    },
    "metadata": {
      "request_id": "req_abc123",
      "timestamp": 1704067200.0
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid authorization header. Expected 'Bearer {api_key}'"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid or expired token"
  }
  ```

  ```json 429 Too Many Requests theme={null}
  {
    "error": {
      "code": "QUOTA_EXCEEDED",
      "message": "Query quota exceeded",
      "details": {
        "limit_type": "queries_per_month",
        "current": 50,
        "limit": 50
      }
    },
    "metadata": {
      "request_id": "req_abc123",
      "timestamp": 1704067200.0
    }
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": {
      "code": "INTERNAL_ERROR",
      "message": "An unexpected error occurred",
      "details": null
    },
    "metadata": {
      "request_id": "req_abc123",
      "timestamp": 1704067200.0
    }
  }
  ```

  ```json 503 Service Unavailable theme={null}
  {
    "error": {
      "code": "DATABASE_ERROR",
      "message": "Database connection failed",
      "details": "Connection timeout"
    },
    "metadata": {
      "request_id": "req_abc123",
      "timestamp": 1704067200.0
    }
  }
  ```
</ResponseExample>

### Response Fields

<ResponseField name="data" type="object" required>
  Response data containing research results and summary.

  <Expandable title="Data properties">
    <ResponseField name="results" type="array[object]" required>
      List of knowledge articles matching the research query.

      <Expandable title="Article object properties">
        <ResponseField name="article_id" type="string" required>
          Unique identifier for the knowledge article.
        </ResponseField>

        <ResponseField name="domain" type="string" required>
          Primary knowledge domain (e.g., `security`, `compliance`).
        </ResponseField>

        <ResponseField name="subdomain" type="string" required>
          More specific subdomain classification.
        </ResponseField>

        <ResponseField name="content_type" type="string" required>
          Type of content (e.g., `guide`, `best_practice`).
        </ResponseField>

        <ResponseField name="title" type="string" required>
          Article title.
        </ResponseField>

        <ResponseField name="summary" type="string" required>
          Brief summary of the article content.
        </ResponseField>

        <ResponseField name="content" type="string">
          Full article content (may be truncated for long articles).
        </ResponseField>

        <ResponseField name="tags" type="array[string]" required>
          Relevant tags for categorization.
        </ResponseField>

        <ResponseField name="categories" type="array[string]" required>
          Article categories.
        </ResponseField>

        <ResponseField name="industries" type="array[string]" required>
          Applicable industries (e.g., `finance`, `healthcare`).
        </ResponseField>

        <ResponseField name="cloud_providers" type="array[string]" required>
          Relevant cloud providers (e.g., `aws`, `gcp`, `azure`).
        </ResponseField>

        <ResponseField name="services" type="array[string]" required>
          Relevant cloud services mentioned.
        </ResponseField>

        <ResponseField name="cross_domain_impacts" type="object">
          Cross-domain relationships showing compliance, cost, and security impacts (included if `include_cross_domain` is `true`).

          <Expandable title="Cross-domain impacts properties">
            <ResponseField name="compliance" type="object">
              Related compliance standards and controls.
            </ResponseField>

            <ResponseField name="cost" type="object">
              Cost implications and optimization opportunities.
            </ResponseField>

            <ResponseField name="security" type="object">
              Security considerations and impacts.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="source_url" type="string">
          Source URL for the article.
        </ResponseField>

        <ResponseField name="quality_score" type="number">
          Quality score (0.0 to 1.0) indicating article reliability and relevance.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="research_summary" type="object" required>
      Summary of the research results.

      <Expandable title="Research summary properties">
        <ResponseField name="total_found" type="integer" required>
          Total number of articles found matching the query.
        </ResponseField>

        <ResponseField name="domains_covered" type="array[string]" required>
          List of domains covered in the results.
        </ResponseField>

        <ResponseField name="key_insights" type="array[string]" required>
          Key insights extracted from the research results.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Query metadata including filters applied and performance metrics.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="metadata" type="object" required>
  Response metadata including request ID and timestamp.

  <Expandable title="Metadata properties">
    <ResponseField name="request_id" type="string" required>
      Unique request identifier for tracking and debugging.
    </ResponseField>

    <ResponseField name="timestamp" type="number" required>
      Unix timestamp of the response.
    </ResponseField>

    <ResponseField name="query_time_ms" type="integer" required>
      Query execution time in milliseconds.
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

### Research FinOps Best Practices

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.wistx.ai/v1/knowledge/research \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "query": "What are the best practices for optimizing cloud costs in AWS?",
      "domains": ["finops"],
      "content_types": ["best_practice", "guide"],
      "max_results": 15
    }'
  ```

  ```python Python theme={null}
  response = requests.post(
      "https://api.wistx.ai/v1/knowledge/research",
      headers={"Authorization": f"Bearer {api_key}"},
      json={
          "query": "What are the best practices for optimizing cloud costs in AWS?",
          "domains": ["finops"],
          "content_types": ["best_practice", "guide"],
          "max_results": 15
      }
  )
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wistx.ai/v1/knowledge/research", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      query: "What are the best practices for optimizing cloud costs in AWS?",
      domains: ["finops"],
      content_types: ["best_practice", "guide"],
      max_results: 15
    })
  });
  ```
</CodeGroup>

## Rate Limits

* **Professional Plan:** 2,000 queries/month
* **Team Plan:** 10,000 queries/month
* **Enterprise Plan:** Unlimited queries/month

## Related Endpoints

* [Compliance Requirements](/api-reference/compliance) - Get compliance requirements
* [Indexing](/api-reference/indexing) - Index repositories and documentation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.