Memniva documentation
Turn any document or URL into clean Markdown or structured JSON for LLMs, RAG, and agents — from one API.
Introduction
Memniva is a document-and-web conversion API built for AI pipelines. Send a file or a URL and get back clean Markdown — or, with your own JSON schema, typed structured data. It handles the messy parts (layout, tables, OCR, page chrome) so your model gets exactly the context it needs.
- • Documents — PDF, Word, Excel, PowerPoint, CSV, HTML, and images → Markdown.
- • URLs & the web — fetch any page and keep just the main content.
- • OCR — scanned pages and images → text, automatically.
- • JSON extraction — structured data shaped by your schema.
- • Batch — up to 25 files/URLs per call, attach results to a knowledge base.
- • Scheduled URL refresh — keep an ingested URL up to date automatically (Pro).
- • Knowledge bases + chat — group docs your AI can read over MCP/API, and chat with cited answers.
- • Spaces — keep separate projects' conversions and knowledge bases isolated.
- • MCP — the same tools for any MCP-capable LLM client.
Quickstart
- 1. Create an account — free, no card required.
- 2. Generate an API key in Settings → API keys.
- 3. Make your first call:
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/article" \ -F "outputFormat=markdown"
Authentication
Every request authenticates with an API key. Create one in Settings → API keys and send it in the x-api-key header. Keys are scoped to your account and stay valid until you revoke them — keep them server-side.
header
x-api-key: kfa_your_api_key
Convert documents & URLs
POST /api/v1/convert — multipart form. Send exactly one of file (an upload) or url (a web page or document link). Returns Markdown by default, or JSON when outputFormat=json.
Upload a file
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]" \ -F "outputFormat=markdown"
Convert a URL
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/blog/building-with-ai"
JavaScript
javascript
const form = new FormData();
form.set("file", file); // a File or Blob — or use form.set("url", "https://…")
form.set("outputFormat", "markdown");
const res = await fetch("https://memniva.com/api/v1/convert", {
method: "POST",
headers: { "x-api-key": "kfa_your_api_key" },
body: form,
});
const result = await res.json();
console.log(result.markdown ?? result.json);Official SDK
Prefer a typed client? Install @memniva/sdk — zero dependencies, works in Node, Bun, Deno, and the browser.
bash
npm install @memniva/sdk
typescript
import { Memniva } from "@memniva/sdk";
const kit = new Memniva({ apiKey: "kfa_your_api_key" });
// A URL or a local file — all typed.
const doc = await kit.convertUrl("https://example.com/report.pdf", { outputFormat: "json" });
console.log(doc.markdown ?? doc.json);Response
json
{
"id": "cmq...",
"status": "completed",
"cached": false,
"markdown": "# Quarterly Report\n\nRevenue grew **20%** ...",
"json": null
}OCR — scanned docs & images
Images and scanned pages run through OCR automatically. Send a PNG, JPG, or an image-only PDF and you get the recognized text back as Markdown — no special flag, it's part of the normal convert pipeline.
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]"
For higher-fidelity extraction on complex layouts (dense tables, figures), Pro plans can add deepExtract=true for vision-based cleanup and figure descriptions.
JSON extraction
Set outputFormat=json and pass a jsonSchema (stringified) describing the fields you want. You get typed, structured data instead of Markdown — ideal for invoices, forms, and records. Included on Pro.
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]" \ -F "outputFormat=json" \ -F 'jsonSchema={"invoiceNumber":"string","total":"number","dueDate":"string"}'
Bulk conversion
POST /api/v1/batch — send up to 25 file and/or url fields in one request. Returns a per-item results[] array at HTTP 200 even on partial failure; each item is completed, failed, or rate_limited. In the app you can convert many files at once and attach every result straight to a knowledge base.
bash
curl -X POST https://memniva.com/api/v1/batch \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/a" \ -F "url=https://example.com/b" \ -F "[email protected]"
Knowledge bases & chat
Group your converted docs into named knowledge bases, then give any AI model access to all of them at once. A knowledge base is a named collection of reference docs your agent can read on demand. Manage them in your dashboard, or entirely over the API.
Create a knowledge base
bash
curl -X POST https://memniva.com/api/v1/knowledge-bases \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"Product docs"}'Convert and attach in one call
Pass knowledgeBaseId to POST /api/v1/convert to convert a file or URL and attach it to that knowledge base in a single request — no separate attach step. The response echoes data.knowledgeBaseId when attached.
bash
curl -X POST https://memniva.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F [email protected] \ -F knowledgeBaseId=cmk...
Add an existing conversion
Already have a conversion? Attach it by id (the second step of the manual ingest flow).
bash
curl -X POST https://memniva.com/api/v1/knowledge-bases/{id}/documents \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"conversionId":"cmq..."}'Import from Notion & Google Drive
Connect Notion or Google Drive from Ingest → Add from a source and import documents straight into a knowledge base — they run through the same convert→embed pipeline as uploads. This is a dashboard feature (OAuth-based); it isn't part of the API-key REST surface.
Write, append & correct content
Agents can author documents directly into a knowledge base — not just read it. Every write is a versioned document (revertible, never destructive): POST /content creates or replaces a document, /content/append adds to one, and /content/edit makes a surgical correction (find/replace) without resending the whole doc. New content is embedded and searchable within seconds.
bash
# Create (or replace, with "docId") a document
curl -X POST https://memniva.com/api/v1/knowledge-bases/{id}/content \
-H "x-api-key: kfa_your_api_key" -H "Content-Type: application/json" \
-d '{"title":"Release notes","content":"# v2.1\n\n- Faster search"}'
# Append to an existing document
curl -X POST https://memniva.com/api/v1/knowledge-bases/{id}/content/append \
-H "x-api-key: kfa_your_api_key" -H "Content-Type: application/json" \
-d '{"docId":"cmk...","content":"\n- Bug fixes"}'
# Correct one fact in place (new revision, old kept)
curl -X POST https://memniva.com/api/v1/knowledge-bases/{id}/content/edit \
-H "x-api-key: kfa_your_api_key" -H "Content-Type: application/json" \
-d '{"docId":"cmk...","find":"Faster search","replace":"2× faster search"}'The same three, typed, via the SDK:
typescript
import { Memniva } from "@memniva/sdk";
const kit = new Memniva({ apiKey: "kfa_your_api_key" });
// Create a versioned document
const doc = await kit.knowledgeBases.writeContent(kbId, {
title: "Release notes",
content: "# v2.1\n\n- Faster search",
});
// Append to it
await kit.knowledgeBases.appendContent(kbId, "\n- Bug fixes", { docId: doc.docId });
// Correct one fact (find/replace → new revision)
await kit.knowledgeBases.editContent(kbId, {
docId: doc.docId,
find: "Faster search",
replace: "2× faster search",
});Over MCP the same actions are the write_knowledge_base, append_knowledge_base, and edit_knowledge_base tools. In the dashboard chat, just ask in plain language (“add a doc with our refund policy”, “correct the price in the pricing doc”) — the assistant proposes the change and applies it once you confirm.
Search a knowledge base
POST /api/v1/knowledge-bases/{id}/search runs hybrid semantic + keyword retrieval over the attached (non-excluded) documents and returns the most relevant passages with their source and a score — the retrieval half of a RAG answer.
bash
curl -X POST https://memniva.com/api/v1/knowledge-bases/{id}/search \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"query":"what is the refund policy?"}'Read everything (feed your model)
GET /api/v1/knowledge-bases/{id} returns every document in the knowledge base joined into one Markdown content field — the whole category in a single call.
bash
curl https://memniva.com/api/v1/knowledge-bases/{id} \
-H "x-api-key: kfa_your_api_key"Over MCP, use read_knowledge_base with the knowledge base's id or name to give the model all its docs at once, and list_knowledge_bases to enumerate them.
Chat with a knowledge base
Every knowledge base has its own chat in the dashboard. Ask questions and get grounded, extractive answers built only from the docs in that base — each answer cites the exact passages it drew from, so nothing is invented. Conversations are kept as sessions you can revisit and continue.
Spaces
Spaces keep separate projects apart. Each space scopes its own conversions and knowledge bases, so a client's documents never mix with another's. Switch the active space in the app; API and MCP calls can target one by sending the x-space-id header. Rename or delete a space from its settings — deleting a space also removes the knowledge bases and conversions filed inside it.
MCP server
Attach Memniva to any MCP-capable LLM client. It speaks Streamable HTTP at /api/mcp and authenticates with your API key.
Client config
json
{
"mcpServers": {
"memniva": {
"url": "https://memniva.com/api/mcp",
"headers": { "Authorization": "Bearer kfa_your_api_key" }
}
}
}Tools
convert_url— fetch a URL and convert it to Markdown or JSON.list_recent_conversions— list your latest conversions.list_knowledge_bases— list your knowledge bases.read_knowledge_base— read every doc in a knowledge base at once.search_knowledge_base— hybrid semantic + keyword retrieval over a base.write_knowledge_base/append_knowledge_base— author or add to a versioned document.edit_knowledge_base— correct an existing document in place (find/replace → new revision).remember/recall— persist and retrieve facts across sessions.crawl— crawl a site into a searchable knowledge base.
Test it
bash
curl -X POST https://memniva.com/api/mcp \
-H "Authorization: Bearer kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Rate limits & quotas
Each API key is rate limited per minute by plan. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset; a 429 includes Retry-After. Conversions and other actions also count against your monthly plan quotas — an exhausted quota returns 402 with the QUOTA_EXCEEDED error code. Chatbots (public website widgets) and skills (custom tools & preprompts in chat) are managed in the app; their per-plan caps are included below.
| Plan | Requests / min | Conversions / mo | Knowledge bases | Web searches / mo | Chatbots | Skills | Bot replies / mo |
|---|---|---|---|---|---|---|---|
| Free | 10 | 10 | 1 | 25 | 1 | — | 100 |
| Pro | 60 | 2,000 | 25 | 2,000 | 10 | 10 | 2,000 |
| Business | 300 | 20,000 | 1,000 | 20,000 | 50 | 50 | 10,000 |
Data & privacy
- Scoped to you. Conversions, files, and API keys belong to your account; nothing is shared across accounts.
- Caching. Results are cached by content hash, so re-sending the same input returns instantly (
cached: true) without re-processing or re-billing. - Re-convert. The original bytes you upload are stored (deduplicated per account) so you can re-convert a file to another format without re-uploading.
- Safe fetching. URL conversion is SSRF-guarded — internal, private, and cloud-metadata addresses are blocked, and every redirect hop is re-validated.
- In transit. All traffic is HTTPS, fronted by Cloudflare.
Errors
Errors return a JSON body { "error": { "code", "endUserMessage" } } with an HTTP status.
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 422 | VALIDATION_FAILED | Unsupported file or bad input |
| 429 | RATE_LIMITED | Rate limit or monthly quota reached |
| 503 | AI_UNAVAILABLE | An upstream service is temporarily unavailable |