RAG Chunker for LangChain
Split Markdown, plain text, or raw HTML into clean, heading-aware semantic chunks ready for LangChain Document loaders and vector embeddings.
Why engineering teams use EdgeDocAPI
- Respects Markdown headings (# .. ######) and attaches section_heading to every chunk
- Configurable max_tokens (32–8192) and deterministic token overlap
- Zero server infrastructure to manage — call directly from Python or TypeScript
Copy-Paste Integration (/v1/rag-chunk)
curl -X POST https://api.docopsapi.com/v1/rag-chunk \
-H "Authorization: Bearer edk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"# Architecture\n\nCloudflare Workers run close to users.\n\n## Storage\n\nDurable Objects provide strong consistency.","format":"markdown","max_tokens":512,"overlap":64,"source":{"document_id":"arch-v2"}}'import requests
resp = requests.post(
"https://api.docopsapi.com/v1/rag-chunk",
headers={"Authorization": "Bearer edk_live_YOUR_API_KEY"},
json={
"content": "# Architecture\n\nCloudflare Workers run close to users.\n\n## Storage\n\nDurable Objects provide strong consistency.",
"format": "markdown",
"max_tokens": 512,
"overlap": 64,
"source": {
"document_id": "arch-v2"
}
},
timeout=15,
)
resp.raise_for_status()
print(resp.json())const res = await fetch("https://api.docopsapi.com/v1/rag-chunk", {
method: "POST",
headers: {
"Authorization": "Bearer edk_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"content": "# Architecture\n\nCloudflare Workers run close to users.\n\n## Storage\n\nDurable Objects provide strong consistency.",
"format": "markdown",
"max_tokens": 512,
"overlap": 64,
"source": {
"document_id": "arch-v2"
}
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);