> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://stelltec.com/rhebok/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://stelltec.com/rhebok/docs/_mcp/server.

# Get index statistics

GET http://127.0.0.1:7331/api/stats

Returns document and chunk counts, counts by source type and by agent,
the embedding model, skipped files, the last `rhebok bench` report, the
hook and MCP tiers, the hook threshold, and memory counts by kind. A
machine that has never indexed answers zeros rather than an error.


Reference: https://stelltec.com/rhebok/docs/api/index/get-stats

## Response

### 200

The index statistics.

- `documents` (integer, required)
- `chunks` (integer, required)
- `by_source` (map from string to integer, required) — Document count per source type.
- `sessions_by_agent` (map from string to integer, required) — Indexed session count per agent id (`claude-code`, `codex`).
- `model` (string, required, nullable) — The embedding model the index was built with, or null.
- `skipped` (list of Skip, required) — Skipped files, without the ones the `ignore` list already covers.
- `skipped_ignored` (integer, required) — How many skipped files the `ignore` list covers.
- `bench` (list of BenchTier, required, nullable)
- `bench_provenance` (BenchProvenance, required, nullable) — What the last bench run measured against, so two runs can be compared.
- `bench_at` (integer, required, nullable) — Unix seconds when the bench report was written.
- `tiers` (StatsTiers, required)
- `hook_threshold` (double, required)
- `memory` (map from string to integer, required) — Memory count per kind (`lesson`, `fact`, `episode`).

## Errors

### 421 Misdirected Request Error

The `Host` header does not name this dashboard (see the rules at the top of this page).

- `error` (string, required) — What went wrong, in plain words.

### 500 Internal Server Error

lbug's `vector` extension could not be loaded. This is a stable state, so `stable` is true and a retry will not help.

- `error` (string, required) — The message, which names the extension directory.
- `stable` (true, required) — Always true. The state will not clear on retry.

### 503 Service Unavailable Error

The index store could not be opened or read right now. A retry can succeed.

- `error` (string, required) — What went wrong, in plain words.

## Types

### Skip

A file the last index run did not index.

- `path` (string, required)
- `kind` (enum, required)
  - Allowed values: `settling`, `empty`, `unreadable`, `scanned`, `failed`
- `detail` (string, required)
- `io` (IoCode, optional)

### BenchTier

One row of the last `rhebok bench` report.

- `tier` (string, required)
- `recall_at_5` (double, required)
- `p50_ms` (integer, required)
- `p95_ms` (integer, required)
- `absent` (list of AbsentRow, required)

### BenchProvenance

What the last bench run measured against, so two runs can be compared.

- `golden_sha256` (string, required)
- `cases` (integer, required)
- `documents` (integer, required, nullable)
- `chunks` (integer, required, nullable)
- `memories` (integer, required, nullable)
- `no_graph` (boolean, required, nullable)
- `project` (string, required, nullable)
- `keep_footprint` (boolean, required, nullable)

### StatsTiers

- `hook` (integer, required) — The quality tier (0-4) the prompt hook uses.
- `mcp` (integer, required) — The quality tier (0-4) MCP search uses.

### IoCode

- `kind` (string, required) — The I/O error kind, for example `PermissionDenied`.
- `os_error` (integer, required, nullable)

### AbsentRow

- `query` (string, required)
- `uri` (string, required)
- `injected` (boolean, required)
- `rank` (integer, required, nullable)

## Examples

### An indexed machine

**Response**

```json
{
  "documents": 641,
  "chunks": 34174,
  "by_source": {
    "markdown": 38,
    "pdf": 4,
    "transcript": 599
  },
  "sessions_by_agent": {
    "claude-code": 571,
    "codex": 28
  },
  "model": "qwen3-embedding:0.6b",
  "skipped": [
    {
      "path": "/Users/me/vault/scans/receipt.pdf",
      "kind": "scanned",
      "detail": "`/Users/me/vault/scans/receipt.pdf` appears to be a scanned PDF with no reliable text layer; skipping (OCR ran and recovered no text)"
    }
  ],
  "skipped_ignored": 3,
  "bench": [
    {
      "tier": "instant",
      "recall_at_5": 0.7,
      "p50_ms": 54,
      "p95_ms": 81,
      "absent": []
    },
    {
      "tier": "fast",
      "recall_at_5": 0.9,
      "p50_ms": 101,
      "p95_ms": 162,
      "absent": []
    }
  ],
  "bench_provenance": {
    "golden_sha256": "eb72714792970bd1c4a0f9d3e5b6a7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4",
    "cases": 222,
    "documents": 641,
    "chunks": 34174,
    "memories": 12,
    "no_graph": false,
    "project": null,
    "keep_footprint": null
  },
  "bench_at": 1764115200,
  "tiers": {
    "hook": 1,
    "mcp": 3
  },
  "hook_threshold": 0.66,
  "memory": {
    "episode": 3,
    "fact": 4,
    "lesson": 5
  }
}
```

**SDK Code**

```python An indexed machine
import requests

url = "http://127.0.0.1:7331/api/stats"

response = requests.get(url)

print(response.json())
```

```javascript An indexed machine
const url = 'http://127.0.0.1:7331/api/stats';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go An indexed machine
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://127.0.0.1:7331/api/stats"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby An indexed machine
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/stats")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java An indexed machine
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://127.0.0.1:7331/api/stats")
  .asString();
```

```php An indexed machine
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://127.0.0.1:7331/api/stats');

echo $response->getBody();
```

```csharp An indexed machine
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/stats");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift An indexed machine
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/stats")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### A machine that has never indexed

**Response**

```json
{
  "documents": 0,
  "chunks": 0,
  "by_source": {},
  "sessions_by_agent": {},
  "model": null,
  "skipped": [],
  "skipped_ignored": 0,
  "bench": null,
  "bench_provenance": null,
  "bench_at": null,
  "tiers": {
    "hook": 1,
    "mcp": 3
  },
  "hook_threshold": 0.66,
  "memory": {}
}
```

**SDK Code**

```python A machine that has never indexed
import requests

url = "http://127.0.0.1:7331/api/stats"

response = requests.get(url)

print(response.json())
```

```javascript A machine that has never indexed
const url = 'http://127.0.0.1:7331/api/stats';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A machine that has never indexed
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://127.0.0.1:7331/api/stats"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A machine that has never indexed
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/stats")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java A machine that has never indexed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://127.0.0.1:7331/api/stats")
  .asString();
```

```php A machine that has never indexed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://127.0.0.1:7331/api/stats');

echo $response->getBody();
```

```csharp A machine that has never indexed
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/stats");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift A machine that has never indexed
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/stats")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```