Borrowing it
Nothing to install: this file belongs to tternquist/marklogic-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tternquist/marklogic-mcp/master/.claude/skills/marklogic-rag/SKILL.mdgit clone --depth 1 https://github.com/tternquist/marklogic-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag)<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-rag/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tternquist/marklogic-mcp/marklogic-rag"><img src="https://agentmods.dev/badge/skills/tternquist/marklogic-mcp/marklogic-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00151 | $0.02840 |
| Opus 5.5 | $0.00060 | $0.01136 |
| Sonnet 5.5 | $0.00030 | $0.00568 |
| Haiku 4.5 | $0.00015 | $0.00284 |
Grade A, and why
marklogic-rag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RAG on MarkLogic 12
Requires MarkLogic 12+. Check for an existing vector view first with ml_views_list
and ml_schema_get_tde.
Pick a paradigm
| Situation | Approach |
|---|---|
| No embeddings, fast prototype | Lexical RAG |
| Embeddings available, simple queries | Pure vector (cosine) |
| Mixed vocabulary + semantic queries | ANN hybrid (ANN + BM25) |
| Taxonomy / knowledge graph available | Graph + Lexical |
| Highest precision, full infrastructure | Graph + Vector |
The graph layer composes with any paradigm — it only supplies a URI scope filter, so apply it before the search or ANN step.
1. Storing embeddings
Store the embedding as a JSON array of floats in an embedding field, sibling to the
content fields. Carry embeddingModel, embeddingDim, and — when chunking —
chunkIndex, chunkText, sourceUri.
Chunking strategy by domain: legal contracts → by clause; news articles → whole-document or paragraph; product manuals → by section.
⚠ Generate embeddings in your application tier, not in MarkLogic.
xdmp.httpPost to external HTTPS embedding APIs commonly fails with
tlsv1 unrecognized name (an SSL SNI limitation in MarkLogic's Java SSL client).
Produce the float array outside, then store it with flux_import or ml_document_put.
2. The TDE vector column
{
"template": {
"context": "/",
"collections": ["my-collection"],
"rows": [{
"schemaName": "my_schema",
"viewName": "my_view",
"columns": [
{ "name": "uri", "scalarType": "string", "val": "xdmp:node-uri(.)" },
{ "name": "content", "scalarType": "string", "val": "chunkText" },
{ "name": "embedding", "scalarType": "vector", "val": "array-node('embedding')",
"dimension": 1536, "invalidValues": "reject" }
]
}]
}
}
Five rules that each cause a distinct failure:
"scalarType": "vector"— not"vec:vector", not"scalar". Either of those givesTDE-INVALIDTEMPLATENODEVAL."val": "array-node('embedding')"— plain"val": "embedding"atomises the array into N individual number nodes and throwsXDMP-CAST."dimension"is required and must be a JSON number, not a string."1536"can fail withXDMP-CAST: Invalid cast: null cast as vec:vector(dim:1536)and no obvious message that the type is wrong."invalidValues": "reject"— skips malformed documents instead of failing the whole view.- Column ordering can trigger the same null-cast failure. A
datescalar column immediately before the vector column has been observed to produce the same null-cast error as the dimension typo, even when the vector itself is valid. This is a template-construction interaction, not a documented MarkLogic rule — if a minimal single-column vector template works but a multi-column one fails, isolate the cause by moving the vector column away from other scalar columns before assuming the vector spec itself is wrong.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +54 lines 3a4a1be32c54
- 2mo ago First seen · 161 lines · 151 tokens per session scan A e861253f0d8a
marklogic-rag is a skill published in the GitHub repository tternquist/marklogic-mcp (4 stars, last pushed 1mo ago), licensed MIT. It adds 151 tokens to every session and 2,840 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
marklogic-rag compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| marklogic-ragtternquist/marklogic-mcp | Skill | 4 | 1mo ago | MIT | A | 151 | Claude Code |
| chromaNousResearch/hermes-agent | Skill | 261k | yesterday | MIT | A | 12 | Claude Code, Codex |
| embeddingsruvnet/ruflo | Skill | 81k | yesterday | MIT | A | 62 | Claude Code |
| rag-pineconedavila7/claude-code-templates | Skill | 33k | yesterday | MIT | A | 65 | Claude Code, Codex |
| similarity-search-patternsforyourhealth111-pixel/Vibe-Skills | Skill | 3.8k | 3d ago | Apache-2.0 | A | 30 | Claude Code, Codex |
| pgvector-semantic-searchtimescale/pg-aiguide | Skill | 1.9k | 3d ago | Apache-2.0 | A | 190 | Cursor |
| postgres-hybrid-text-searchtimescale/pg-aiguide | Skill | 1.9k | 3d ago | Apache-2.0 | A | 162 | Cursor |