Deterministic RAG Chunking for Pinecone
Transform raw HTML or Markdown documents into Pinecone-ready JSON records complete with chunk_index, total_chunks, section_heading, and document_id metadata.
Why engineering teams use EdgeDocAPI
- Output schema maps cleanly to Pinecone vector metadata fields
- Prevents embedding truncation by enforcing strict max_tokens ceilings
- Reproducible deterministic chunk boundaries across re-indexing runs
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 '{"html":"<article><h1>Pinecone Guide</h1><p>Index clean semantic chunks for high recall.</p></article>","max_tokens":384,"overlap":48,"source":{"document_id":"kb-101","url":"https://example.com/kb/101"}}'import requests
resp = requests.post(
"https://api.docopsapi.com/v1/rag-chunk",
headers={"Authorization": "Bearer edk_live_YOUR_API_KEY"},
json={
"html": "<article><h1>Pinecone Guide</h1><p>Index clean semantic chunks for high recall.</p></article>",
"max_tokens": 384,
"overlap": 48,
"source": {
"document_id": "kb-101",
"url": "https://example.com/kb/101"
}
},
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({
"html": "<article><h1>Pinecone Guide</h1><p>Index clean semantic chunks for high recall.</p></article>",
"max_tokens": 384,
"overlap": 48,
"source": {
"document_id": "kb-101",
"url": "https://example.com/kb/101"
}
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);