About Cerefox
Cerefox is an MCP server published by fstamatelopoulos in the RAG category: personal knowledge base with hybrid search and read/write access for AI agents. Conduid read 19 tools from its source: cerefox_delete_document, cerefox_delete_relation, cerefox_edit, cerefox_get_audit_log, cerefox_get_document, cerefox_get_help and 13 more. No package is published for it, so it installs from a source checkout.
The repository has 20 stars and 6 forks, and its last commit was on 30 Nov 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include ai-knowledge-base, hybrid-search, pgvector, rag, semantic-search and supabase.
Install
git clone https://github.com/fstamatelopoulos/cerefoxTools (19)
cerefox_delete_documentSOFT-delete a document: it leaves search results and lands in the trash, recoverable until a human purges it (or, if the operator has turned on trash auto-purge, until it has been in the trash longer than the retention period; a delete reports any such purges it triggered). Requires expected_content_hash — the content_hash of the document AS YOU READ IT — so a delete always follows a read; if the document changed in between, the call fails with a conflict and you should re-read before deciding again. A mistaken delete can be undone with cerefox_restore_document; permanent purge is human-only (web UI). ALWAYS tell your user what you deleted and why. Pass a short reason — it is recorded in the audit log for the human reviewing the trash. Prefer this over ingesting empty/placeholder content when a document should go away.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document to soft-delete. |
| expected_content_hash * | string | The content_hash of the document as you read it (returned by cerefox_get_document, cerefox_search, and cerefox_metadata_search). Required: a delete must follow a read. A stale hash fails with a conflict — re-read, reconsider, retry with the new hash. |
| reason | string | Why this document is being deleted. Recorded in the audit log entry, where it is the main thing the human reviewing the trash has to go on. Short and specific beats long. |
cerefox_delete_relationRemove a typed relation between two documents. Symmetric types remove both directions. Lifecycle status set by an earlier relation is NOT reverted.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| rel_type * | string | Relation type to remove |
| source_id * | string | UUID of the source document |
| target_id * | string | UUID of the target document |
cerefox_editChange parts of a document without resending the whole thing: one or many operations applied ATOMICALLY in one write. Operations: insert (same positions as cerefox_insert), replace_section (swap a section's body, heading kept), delete_section (remove a section, scope body_only or heading_and_body), rename_section (change a heading's text, leaving its body and position untouched — for headings that go stale, like a dated one). Use one call for changes that belong together — a half-applied edit is impossible, so a row and the total it feeds cannot disagree. Operations apply in order and each sees the previous one's result. To change a single line, replace_section on its smallest enclosing heading. Requires expected_content_hash; returns the new hash, not the document.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| author_type | string | Honoured on the CLI only, where a human ran the command; over MCP the write is always recorded as an agent write regardless of what is passed. |
| document_id * | string | UUID of the document to edit |
| expected_content_hash * | string | content_hash of the version you are basing these edits on. Required — no last-write-wins. |
| operations * | array | Operations applied in order, all-or-nothing. If any fails (bad anchor, ambiguity), nothing is written. |
cerefox_get_audit_logRetrieve audit log entries showing who changed what and when. Supports filtering by document, author, operation type, and time range. Returns entries with document titles, author attribution, size changes, and descriptions.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| by_author | string | Filter: only entries written by this author name (optional) |
| document_id | string | Filter by document UUID (optional) |
| limit | integer | Maximum number of entries to return (default: 50, max: 200) |
| operation | string | Filter by operation type: ${AUDIT_OPERATIONS.join(", ")} (optional) |
| since | string | ISO timestamp lower bound for temporal queries (optional) |
cerefox_get_documentRetrieve a document at one of three zoom levels: the whole reconstructed content (default), its heading structure with outline=true (much cheaper, and the headings are the anchors the edit tools take), or one section's text with section="## Heading" (what a replace_section on that anchor would overwrite — read it before replacing a section you did not write). Pass version_id to retrieve an archived version; omit it (or pass null) for the current version. Version UUIDs are returned by cerefox_list_versions. Every non-archived response carries the document's current content_hash — pass it back as expected_content_hash when updating (optimistic concurrency).| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document to retrieve |
| outline | boolean | Return the document's STRUCTURE instead of its content: heading paths, levels and per-section sizes, plus content_hash and total size. Far cheaper than a full read. Every heading listed is addressable by cerefox_insert / cerefox_edit: pass the bare heading line (e.g. '## Daily Logs') when it occurs once in the document, and only the full ' > ' path shown here when the same heading text repeats. Use this before editing a document you have not read. |
| section | string | Return ONE section's text instead of the whole document: the anchor heading, exactly as cerefox_insert / cerefox_edit take it (bare heading line when unique, ' > ' path when it repeats). What comes back is precisely the text a replace_section on this anchor would overwrite, so read it before replacing a section you did not write. The heading itself is returned separately, because replace_section keeps it. Cannot be combined with outline. |
| section_part | string | Only when the target section HAS CHILD SECTIONS, and it means the same here as on the edit tools: own_body = up to the first child, subtree = everything nested underneath. The read refuses without it for exactly the cases the write refuses, so that what you read is what you would replace. Omit it otherwise; you will be told (with both options) whenever it is needed. |
| version_id | string | UUID of a specific archived version to retrieve (optional) |
cerefox_get_helpRetrieve Cerefox's own agent-usage guidance (the AGENT_QUICK_REFERENCE.md content). Call with no arguments to get the full reference + a section index. Call with `topic` to get a single section (case-insensitive substring match against H2 headings). Use this whenever you're uncertain about Cerefox conventions — link forms, project-membership semantics, update workflows, etc.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| topic | string | Optional. Case-insensitive substring against H2 headings (e.g. "links", "update", "metadata"). Omit for the full reference. |
cerefox_get_neighborsWalk the relation graph outward from a document along ONE relation type. Use after cerefox_get_relations shows which types exist. depth > 1 follows chains (useful for follows / reply_to); cycles terminate safely. Optional from_time / to_time filter neighbours by their creation time.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| depth | integer | How many hops to follow (1–5, default 1) |
| document_id * | string | UUID of the starting document |
| from_time | string | ISO-8601: only neighbours created on/after |
| limit | integer | Max documents to return (default 50, max 200) |
| rel_type * | string | The single relation type to traverse |
| to_time | string | ISO-8601: only neighbours created on/before |
cerefox_get_relationsList every relation touching a document, in both directions (→ outbound, ← inbound). Shows each neighbour's title and lifecycle status, so an agent can tell whether retrieved knowledge has been superseded or contradicted.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document |
cerefox_ingestSave a note or document to the Cerefox knowledge base. Updating an existing document REPLACES its whole content, so every unchanged character has to be reproduced exactly. Prefer cerefox_insert / cerefox_edit for any change to part of a document, and especially where the untouched content cannot be checked by reading it — document IDs, hashes, numeric tables, indexes and registries. Drifting prose is obvious on review; one wrong character in a UUID is not, and it silently breaks the reference.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| content * | string | Markdown content |
| document_id | string | UUID of an existing document to update. When provided, updates that specific document regardless of update_if_exists. Returns an error if the document does not exist. Workflow: cerefox_search → note the [id: ...] → pass here for deterministic update. |
| expected_content_hash | string | REQUIRED on content updates (optimistic concurrency): the content_hash of the document version you based your edit on, as returned by cerefox_get_document / cerefox_search / cerefox_metadata_search. If the document changed since you read it, the update fails with a conflict — re-read, merge, retry with the new hash. Not needed when creating a new document. |
| expected_metadata_revision | integer | Optional, with metadata on an update: the metadata_revision you read (cerefox_get_document / cerefox_metadata_search). The write fails if the metadata changed since. |
| last_write_wins | boolean | Explicitly skip the concurrency check and overwrite regardless of concurrent changes (default: false). Use ONLY when an external source of truth makes conflicts meaningless (e.g. re-syncing from files). Recorded in the audit log. |
| metadata | object | JSON metadata (optional). On an UPDATE it is MERGED into the existing metadata: keys you pass are set, a null value removes that key, keys you omit are kept. To change only metadata, use cerefox_set_document_metadata instead. |
| project_name | string | Optional: single project name (created if absent). On update: non-destructive add — ensures this membership exists; preserves other memberships an operator may have added via the web UI. For explicit set-the-full-list semantics, use project_names (list) instead, or call cerefox_set_document_projects. |
| project_names | array | Optional: explicit list of project names (each created if absent). Full-set semantics — on update this REPLACES the document's project memberships with exactly this set. Use when you want to set multiple projects at once or deliberately change the membership list. Wins over project_name when both are passed. |
| source | string | Origin label (default: "agent") |
| title * | string | Document title |
| update_if_exists | boolean | When true, update an existing document with the same title instead of creating a new one (default: false). Ignored when document_id is provided. |
cerefox_insertAdd text to a document without resending the whole thing. Purely additive: it cannot remove or overwrite existing content, so it is the safe way to append. Positions: end_of_document (a plain append), end_of_section (add to the end of a section's body — the most common mid-document add), after_heading (lead-in text), before_heading (a new block above a section). Anchors are the exact heading line ('## Intake') or a parent path ('## Intake > ### Notes') when a heading appears more than once. Requires expected_content_hash; returns the new hash, not the document.| Parameter | Type | Description |
|---|---|---|
| anchor_heading | string | Exact heading line, or a ' > ' path for a heading that appears more than once. Required unless position is end_of_document. |
| author | any | |
| author_type | string | Honoured on the CLI only, where a human ran the command; over MCP the write is always recorded as an agent write regardless of what is passed. |
| document_id * | string | UUID of the document to add to |
| expected_content_hash * | string | content_hash of the version you are basing this on. Required — no last-write-wins. |
| position * | string | Where to insert. end_of_document needs no anchor; the other three require anchor_heading. |
| section_part | string | Only for end_of_section when the target section HAS CHILD SECTIONS: own_body = before the first child, subtree = after everything nested under it. These can be far apart, so the tool refuses rather than choosing. Omit it otherwise; you will be told (with both options) whenever it is needed. |
| text * | string | Markdown to insert. Sent as-is; blank-line separation is handled for you. |
cerefox_list_metadata_keysList all metadata keys currently in use across documents in the Cerefox knowledge base. Returns each key with its document count and up to 5 example values.| Parameter | Type | Description |
|---|---|---|
| author | any |
cerefox_list_projectsList all projects with their names and IDs. Use this to discover available projects before filtering by project_name in other tools.| Parameter | Type | Description |
|---|---|---|
| author | any |
cerefox_list_versionsList all archived versions of a document, newest first. Returns version_id (use with cerefox_get_document), version_number, source, chunk_count, total_chars, and created_at.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document whose version history to list |
cerefox_metadata_searchFind or list documents by metadata key-value criteria without a text search term. Use to discover documents tagged with specific attributes, browse by taxonomy, retrieve messages/tasks by type and status, or list all documents in a project (pass project_name alone). At least one of metadata_filter, project_name, updated_since, or created_since must be supplied; results are ordered newest-updated first.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| created_since | string | ISO-8601 timestamp; only docs created on/after (optional) |
| include_content | boolean | Include full document text (default false) |
| limit | integer | Max results (default 10) |
| max_bytes | integer | Soft cap on total response bytes when include_content is true. Defaults to server maximum (200000). |
| metadata_filter | object | Key-value pairs; ALL must match (AND semantics). Example: {"type": "decision", "status": "active"}. Call cerefox_list_metadata_keys first to discover available keys. Optional — omit (or pass {}) to list by project_name / time range alone. |
| project_name | string | Restrict to a project by name. Sufficient on its own to list that project's documents (optional). |
| updated_since | string | ISO-8601 timestamp; only docs updated on/after (optional) |
cerefox_restore_documentRestore a soft-deleted document from the trash — the inverse of cerefox_delete_document. The document becomes searchable again; the restore is recorded in the audit log with your identity. Restoring a document that is not deleted is a reported no-op. Pass a short reason — like a delete's reason, it is what the human reviewing the audit trail goes on. Permanent purge has no agent surface: once a human purges a document from the web UI, it is gone and cannot be restored.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the soft-deleted document to restore. |
| reason | string | Why this document is being restored. Recorded in the audit-log entry. Short and specific beats long. |
cerefox_searchSearch the Cerefox personal knowledge base (hybrid FTS + semantic). Three result shapes: documents (the default; small ones whole, large ones as their matched sections), documents with only their best-matching passages (content: "matches"; the cheapest way to find the right document before reading it with cerefox_get_document), or ranked chunks (mode: "hybrid", "fts" or "semantic"; for when the passage itself is the answer).| Parameter | Type | Description |
|---|---|---|
| alpha | number | Hybrid fusion weight 0–1 (default 0.7): 1 = pure semantic, 0 = pure keyword. |
| author | any | |
| content | string | What each document result carries, with mode "docs" (default: "full"). full: the whole document when it is under 20,000 characters, else its matched sections with their neighbors. matches: the same documents in the same order, each with only its best-matching passages, best first, up to max_passage_chars, and a note saying what was left out. Use "matches" to find which document to read, then read it (or one section of it) with cerefox_get_document. Needs server schema 0.23.0. |
| match_count | integer | Maximum number of documents to return (default: 5, maximum: 200) |
| max_bytes | integer | Optional response size budget in bytes. Results are dropped whole until the budget is satisfied; a truncated flag is set when results are dropped. Defaults to the server maximum (200000). Pass a smaller value if your context window is limited. Values above the server maximum are silently capped. |
| max_passage_chars | integer | With content "matches": the most passage text one document carries, in characters (default ${DEFAULT_PASSAGE_CHARS}, range ${MIN_PASSAGE_CHARS}-${MAX_PASSAGE_CHARS}). Whole passages are kept, best first, while they fit; the best one is always kept, and if it alone is longer it is cut to an excerpt around the query's terms (or to its opening when none occur in it, which may miss what matched: keep it at or above the store's chunk size, 4000 by default, when that matters). |
| metadata_filter | object | Optional JSONB containment filter. Only documents whose metadata contains ALL specified key-value pairs are returned. Example: {"type": "decision", "status": "active"}. Call cerefox_list_metadata_keys first to discover available keys and values. Omit to search all documents. |
| min_score | number | Minimum cosine similarity for vector-side results (default: server-configured, 0.5 OpenAI / 0.6 local embedder; in semantic mode, none unless given). |
| min_term_coverage | number | Keyword OR-fallback confidence bar 0–1 (default: server-configured, else 0.66): fraction of the query's meaningful terms a result must match to count as a confident hit; weaker matches return flagged below-confidence. 0 = any matching term. Needs schema ≥ 0.9.1. |
| mode | string | Search mode (default: docs, documents). hybrid: ranked chunks, keywords and meaning combined; fts: ranked chunks by keywords only (no embedding); semantic: ranked chunks by meaning only, for when the wording may differ from the documents' (no keyword matching, no confidence threshold unless min_score is given). Any other value is an error. |
| project_name | string | Filter results to a specific project by name (optional) |
| query * | string | Natural-language search query |
cerefox_set_document_metadataChange a document's metadata WITHOUT resending its content. MERGES by default: the keys you pass are set, every other key is left alone — so you do not need to read the document first, and you cannot accidentally drop tags another agent set. To REMOVE a key, pass it with a null value ({"stale_key": null}). Pass replace: true to set the metadata to exactly the object given, discarding everything else (rare; it requires expected_metadata_revision or last_write_wins). To make a merge fail if anyone changed the metadata since you read it, pass expected_metadata_revision. Content, chunks and embeddings are untouched and no new version is created. Use this instead of cerefox_ingest whenever only the tags are changing.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document to tag. |
| expected_metadata_revision | integer | The metadata_revision you read (from cerefox_get_document or cerefox_metadata_search). Optional on a merge: when given, the write fails if the metadata changed since. Required with replace: true. |
| last_write_wins | boolean | Replace without a metadata_revision, regardless of concurrent changes (default false). Recorded in the audit log. Use only when an external source of truth makes conflicts meaningless. |
| metadata * | object | Keys to set. Values are JSON strings by convention (a metadata_filter matches JSONB as strings, so a boolean true will not match "true"). A null value REMOVES that key. Keys you do not mention are left alone unless replace is true. |
| replace | boolean | Set the metadata to EXACTLY this object, discarding any key not listed. Defaults to false (merge). Use only when you mean to reset a document's tags wholesale. Requires expected_metadata_revision (or last_write_wins). |
cerefox_set_document_projectsSet the document's project memberships to EXACTLY the given list. Destructive replace: any existing memberships not in this list are removed. Pass an empty list to clear all project memberships. Projects are looked up by name (case-insensitive); missing projects are created. Logged as update-metadata in the audit log — content is untouched. Use cerefox_ingest with project_names if you want to set memberships AND update content in one call. Use this tool when you only need to change project membership without re-writing the document body.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| document_id * | string | UUID of the document. Get this from a prior cerefox_search result (the [id: ...] tag after the title). |
| project_names * | array | Explicit list of project names. Each created if absent. Order is preserved. Empty list = remove from all projects. |
cerefox_set_relationLink two documents with a typed, directed relation (source → target). Known types with behavior: ${KNOWN_TYPES}. Symmetric types (related_to,contradicts, duplicates) write both directions. `supersedes` marks the target superseded; `contradicts` marks both stale. Any other type string is accepted and stored, just without special behavior. Re-setting the same edge updates it.| Parameter | Type | Description |
|---|---|---|
| author | any | |
| metadata | object | Optional JSON context for the edge (note, confidence, …) |
| rel_type * | string | Relation type, e.g. one of: ${KNOWN_TYPES}. Free text is allowed. |
| source_id * | string | UUID of the source document |
| target_id * | string | UUID of the target document |
Security checks
- ✓README presentThe repository's README runs to about 1.6K words.
5 checks have not been run yet.
README
The repository's README runs to about 1.6K words. The original in the repository is authoritative.
Read full README