The MindCache backend runs on http://localhost:8000 by default. All endpoints return JSON. The extension communicates with the backend exclusively through src/services/BackendClient.ts.
Ingests and indexes a visited web page. Accepts client-side extracted content or triggers server-side download.
{
"url": "https://example.com/ai-memory-article"
}When the extension's content script extracts content via Defuddle, the backend skips server-side HTTP download and extraction:
{
"url": "https://example.com/ai-memory-article",
"title": "Local AI Personal Memory Systems",
"dwell_time": 42.5,
"auto_extract": true,
"extracted_content": "## AI Memory Systems\n\nThis article discusses...",
"extracted_content_html": "<h2>AI Memory Systems</h2><p>This article discusses...</p>",
"description": "A deep dive into local AI memory systems",
"author": "Jane Doe",
"site_name": "Example Blog",
"published_date": "2026-05-29",
"language": "en",
"schema_org": {"@type": "Article", "headline": "..."},
"meta_tags": [{"name": "keywords", "content": "ai, memory"}],
"keywords": ["ai", "memory", "vector"],
"highlights": [{"text": "key passage", "content": "<em>key passage</em>", "xpath": "/html/body/p[1]"}],
"selection": "selected text in markdown",
"selection_html": "<p>selected text in HTML</p>"
}| Field | Type | Default | Description |
|---|---|---|---|
url |
string | required | Full URL (must start with http:// or https://) |
title |
string | null | Page title from browser tab |
dwell_time |
float | null | Time spent on page in seconds |
extracted_content |
string | null | Client-extracted markdown body (skips server download) |
extracted_content_html |
string | null | Client-extracted HTML body |
description |
string | null | Meta description |
author |
string | null | Author name |
site_name |
string | null | Site name from OpenGraph |
published_date |
string | null | ISO date string |
language |
string | null | Page language code |
schema_org |
object | null | JSON-LD schema.org data |
meta_tags |
array | null | Array of {name, property, content} objects |
keywords |
array | null | Client-extracted keyword list |
auto_extract |
bool | true | When false and no content, skip processing entirely |
highlights |
array | null | Highlighted text fragments {text, content, xpath} |
selection |
string | null | User-selected text (context menu) |
selection_html |
string | null | HTML of selection |
New document (201):
{
"status": "success",
"message": "Web page processed and semantically indexed successfully.",
"document_id": 4,
"title": "Local AI Personal Memory Systems",
"domain": "example.com"
}Duplicate URL (201) — Visit recorded, content already indexed; quality_score and dwell_time updated:
{
"status": "duplicate",
"message": "URL visit recorded. Page content was already indexed.",
"document_id": 4,
"title": "Local AI Personal Memory Systems",
"domain": "example.com"
}Recorded without content (201) — When auto_extract is false:
{
"status": "recorded",
"message": "Visit recorded without content extraction (auto_extract is off).",
"document_id": null,
"title": null,
"domain": "example.com"
}Skipped as noise (201) — Knowledge quality score < 2 or platform search page:
{
"status": "skipped",
"message": "Web Page Skipped from indexing because it was identified as noise (e.g. insufficient information content).",
"document_id": null,
"title": "Google Search: best vector database for rag",
"domain": "google.com"
}-
400 — Invalid URL (malformed or non-HTTP scheme):
{ "detail": "URL 'ftp://invalid' is invalid: Only HTTP and HTTPS protocols are supported." } -
422 — Extraction failure (page unreachable or no readable text):
{ "detail": "Failed to extract content from https://example.com/empty: Webpage has no parseable text content." }
Searches history using natural language query matching with optional time filtering. Executes hybrid retrieval: FAISS vector search + BM25 lexical search + keyword matching + click boosting.
{
"query": "local vector database search",
"limit": 5,
"generate_summary": true,
"start_time": "2026-05-01T00:00:00Z",
"end_time": "2026-05-31T23:59:59Z"
}| Field | Type | Default | Description |
|---|---|---|---|
query |
string | required | Natural language search query (min 1 char) |
limit |
int | 5 | Max results (1-50) |
generate_summary |
bool | false | Generate AI collective summary of results |
start_time |
ISO timestamp | optional | Filter results visited after this time |
end_time |
ISO timestamp | optional | Filter results visited before this time |
{
"query": "local vector database search",
"results": [
{
"id": 4,
"url": "https://example.com/ai-memory-article",
"domain": "example.com",
"title": "Local AI Personal Memory Systems",
"summary": "This article discusses running browser memory databases locally.",
"score": 0.892,
"published_date": "2026-05-29T00:00:00",
"last_visited_at": "2026-05-30T11:42:00",
"total_dwell_time": 120.5,
"keywords": [
{ "keyword": "vector", "score": 0.91 },
{ "keyword": "database", "score": 0.85 }
],
"source_type": "Generic"
}
],
"ai_summary": "Your visited history contains an article about local browser memory databases. It details running vector indices locally to preserve privacy [1]."
}| Field | Type | Description |
|---|---|---|
id |
int | Document ID |
url |
string | Page URL |
domain |
string | Extracted domain |
title |
string | Page title |
summary |
string | AI-generated summary |
score |
float | Combined relevance score (0-1) |
published_date |
ISO datetime | Article publish date |
last_visited_at |
ISO datetime | Most recent visit |
total_dwell_time |
float | Accumulated dwell time |
keywords |
array | Extracted keywords with scores |
source_type |
string | Generic, GitHub, YouTube, Reddit, X, PDF |
Records a click signal for search result ranking optimization. Boosts clicked documents by +0.10 per click (capped at +0.30) for future identical queries.
{
"query": "local vector database",
"document_id": 4
}{
"status": "success",
"message": "Click signal recorded for query 'local vector database' on document 4."
}Lists indexed documents ordered by updated timestamp descending.
| Parameter | Default | Max | Description |
|---|---|---|---|
skip |
0 | — | Skip N records |
limit |
20 | 100 | Max records to return |
Response (200): Array of document objects with keywords, entities, and visit history:
[
{
"id": 4,
"url": "https://example.com/ai-memory-article",
"domain": "example.com",
"title": "Local AI Personal Memory Systems",
"author": "John Doe",
"published_date": "2026-05-29T00:00:00",
"extracted_content": "Full parsed page content...",
"source_type": "Generic",
"platform_metadata": null,
"summary": "This article discusses running browser memory databases locally.",
"total_dwell_time": 120.5,
"created_at": "2026-05-30T11:40:00",
"updated_at": "2026-05-30T11:42:00",
"keywords": [
{ "keyword": "vector", "score": 0.91 }
],
"entities": [
{ "name": "FAISS", "type": "Technology" },
{ "name": "Meta", "type": "Company" }
],
"visit_history": ["2026-05-30T11:40:00", "2026-05-30T11:42:00"]
}
]Retrieves full extracted content, metadata, entities, keywords, and visit history for a specific document.
- 200: Single document object matching the list format above
- 404:
{ "detail": "Document with ID 99 was not found" }
Removes a webpage from SQLite (cascade deletes keywords, entities, visits, clicks) and removes its vectors from FAISS index and BM25 index.
Response (200):
{ "message": "Document ID 4 was successfully deleted from local memory." }Generates an AI summary for a document using Ollama. Checks Ollama health first. Updates the document's summary field.
Response (200):
{
"message": "Summary generated successfully.",
"summary": "This article discusses running browser memory databases locally..."
}Returns entities, keywords, and relationships for knowledge graph visualization. Used by the InteractiveKnowledgeGraph component in the settings dashboard.
| Parameter | Default | Max | Description |
|---|---|---|---|
limit |
100 | 500 | Max documents to include |
min_keyword_freq |
2 | 10 | Min keyword frequency for node inclusion |
{
"nodes": {
"documents": [
{
"id": "doc_4",
"label": "Local AI Personal Memory Systems",
"type": "document",
"url": "https://example.com/ai-memory-article",
"domain": "example.com",
"source_type": "Generic",
"updated_at": "2026-05-30T11:42:00",
"visit_count": 2
}
],
"entities": [
{ "id": "ent_0", "label": "FAISS", "type": "entity", "entity_type": "Technology", "document_count": 3 },
{ "id": "ent_1", "label": "Meta", "type": "entity", "entity_type": "Company", "document_count": 2 }
],
"keywords": [
{ "id": "kw_vector", "label": "vector", "type": "keyword", "document_count": 5 }
]
},
"edges": [
{ "source": "doc_4", "target": "kw_vector", "type": "has_keyword" },
{ "source": "doc_4", "target": "ent_0", "type": "has_entity" },
{ "source": "ent_0", "target": "ent_1", "type": "co_occurs", "weight": 2 }
],
"stats": {
"document_count": 10,
"entity_count": 15,
"keyword_count": 8,
"edge_count": 45
}
}| Type | Meaning |
|---|---|
has_keyword |
Document references a keyword |
has_entity |
Document mentions an entity |
co_occurs |
Two entities/keywords appear in the same document |
Checks diagnostic status of all system components — database, FAISS index, and the embedding model.
{
"status": "healthy",
"components": {
"database": { "status": "connected", "documents_count": 128 },
"faiss_index": { "status": "initialized", "vectors_count": 256 },
"embedding": { "status": "ready", "model": "google/embeddinggemma-2", "dimension": 768, "reindexing": false }
}
}Possible status values: "healthy" (all components online) or "degraded" (some components offline).
Response (200):
{
"app": "MindCache Backend",
"status": "Online",
"documentation": "/docs"
}BackendClient in the extension encapsulates request handling:
- Configurability: Reads base URL from
useSettingsStoredynamically - Fail-safe: Background ingestion catches and discards server errors silently. Popup and settings display friendly offline alerts
- Retry: Up to 2 retries with exponential backoff (300ms, 600ms) on server errors. Bypassed on 4xx responses and health checks
- Validation: Rejects malformed JSON responses, preventing backend format issues from breaking the UI
- Error formatting:
BackendClientErrorwithstatusanddetailsproperties for structured error handling
{
"embedding": { "model": "google/embeddinggemma-2", "dimension": 768, "status": "ready", "device": "cuda" },
"generation": { "provider": "openai", "model": "gpt", "endpoint": "https://example.com/v1", "allow_remote": true, "api_key_set": true }
}embedding.status is ready or not_downloaded. The API key is never returned.
Body: provider (disabled, transformers, ollama, openai), model, endpoint, allow_remote and api_key. Omit api_key or send null to keep the saved key, or send "" to remove it. Remote endpoints need allow_remote and HTTPS.
Body { "prompt": "..." }. Returns { "text": "..." }.
Body { "task": "embedding" | "generation" } starts a background download and returns 202. Poll GET /ai/downloads for downloading, completed or failed. A completed embedding download starts re-indexing when the index needs it.
These routes are for the desktop app and web app. Browser extensions cannot call them.
POST body: { "path": "/home/me/notes", "exclude_globs": ["*.tmp"] }. The path must be an absolute, existing directory, not the filesystem root, and must not overlap a folder that is already watched (409). Returns the folder and starts a scan.
PATCH accepts enabled and exclude_globs. DELETE removes the folder from the index only; files on disk are never touched. A folder that cannot be reached is marked unavailable and keeps its index.
Indexed files with status of pending, indexed, partial (keyword search works, embedding missing), skipped (unreadable or blank) or failed, plus error and chunk_count.
The one search used by the extension, the web app and the desktop app. It searches indexed files, saved web pages, notes and uploads together.
| Parameter | Meaning |
|---|---|
q |
Query text, up to 500 characters |
limit |
1 to 100 results, default 20 |
mode |
fast matches words only and answers in milliseconds. full (default) adds matching by meaning. Clients ask for fast first and replace it with full |
kind |
Comma-separated filter of page, file, note, upload |
location is the file path, the page URL, or for uploads the backend path of the original; notes have an empty location. open_url is what a browser can open: the page URL, /files/{id}/raw for files, or the upload download. terms lists the words to highlight.
{
"mode": "full",
"terms": ["mitochondria", "energy"],
"results": [
{
"kind": "file",
"id": 3,
"title": "cells.md",
"location": "/home/me/notes/cells.md",
"folder": "/home/me/notes",
"ext": ".md",
"size": 1204,
"when": "2026-11-26T07:43:42",
"open_url": "/files/3/raw",
"score": 0.03279,
"reasons": ["keyword", "semantic"],
"passages": [{ "text": "The mitochondria produces energy…", "start": 0 }]
}
]
}Pages add domain instead of folder, ext and size. Semantic matches below a cosine similarity of 0.70 are dropped, so a query with no related content returns nothing.
Returns an indexed file so a web page can open it, since browsers do not open file:// links from http:// pages. Only files inside a watched folder are served. Text and source files are sent as text/plain, PDFs inline, and everything else as a download, always with nosniff and a sandbox policy.
Body {"reveal": false}. Opens the file in the computer's default app, or with "reveal": true its folder in the file manager.
Browser capture settings shared by every client: auto_tracking, auto_extract, delay_seconds (1 to 3600) and excluded_domains. configured is false until the first save, which lets an extension with existing local choices upload them instead of adopting the defaults. The extension polls this endpoint, so a change made in the web app or desktop app reaches the browser within a minute.
The paired extension can call every endpoint except /pairing.
Queues one file again.
{
"files": { "indexed": 120, "partial": 3 },
"queued": 4,
"paused": false,
"files_per_minute": 42.0,
"eta_seconds": 6,
"current": 17,
"vectors": 410,
"embedding": "ready"
}