Five ways to access knowledgelib.io programmatically: MCP server, REST API, n8n, LangChain, or direct web fetch.
GET /api/v1/query?q=your+question to find pre-verified, cited knowledge units.POST /api/v1/suggest with {"question": "your question here"}. Popular suggestions are prioritized for new unit creation. The next agent that asks will get an answer.The fastest path for Claude, Cursor, and any MCP-compatible client.
{
"mcpServers": {
"knowledgelib": {
"command": "npx",
"args": ["knowledgelib-mcp"]
}
}
}
| Tool | Description | Parameters |
|---|---|---|
query_knowledge |
Semantic search across all knowledge units | query (string), domain (optional), limit (default: 3) |
get_unit |
Retrieve a specific knowledge unit by ID | unit_id (string) |
list_domains |
List all available domains and unit counts | None |
suggest_question |
Submit a question when no results found — creates a topic request | question (string), context (optional), domain (optional) |
Base URL: https://knowledgelib.io/api/v1
None required. All endpoints are public and free to use — no API key, no sign-up.
curl https://knowledgelib.io/api/v1/query?q=best+earbuds+2026
Semantic search across all knowledge units. Returns top matching units ranked by relevance.
# Request
GET /api/v1/query?q=best+wireless+earbuds+under+150&limit=3&domain=consumer_electronics
# Response
{
"query": "best wireless earbuds under 150",
"results": [
{
"id": "consumer-electronics/audio/wireless-earbuds-under-150/2026",
"canonical_question": "What are the best wireless earbuds under $150 in 2026?",
"confidence": 0.88,
"last_verified": "2026-02-07",
"relevance_score": 0.97,
"url": "https://knowledgelib.io/consumer-electronics/audio/wireless-earbuds-under-150/2026",
"raw_md": "https://knowledgelib.io/api/v1/units/consumer-electronics/audio/wireless-earbuds-under-150/2026.md",
"token_estimate": 1800
}
],
"total_results": 1,
"query_cost_tokens": 42
}
Retrieve the raw markdown of a specific knowledge unit. This is the most token-efficient way to consume a unit.
# Request GET /api/v1/units/consumer-electronics/audio/wireless-earbuds-under-150/2026.md # Response: raw markdown with YAML frontmatter # Content-Type: text/markdown; charset=utf-8
Retrieve a knowledge unit as structured JSON (frontmatter parsed into fields, body as string).
# Response
{
"id": "consumer-electronics/audio/wireless-earbuds-under-150/2026",
"metadata": {
"canonical_question": "What are the best wireless earbuds under $150 in 2026?",
"confidence": 0.88,
"last_verified": "2026-02-07",
"sources": [...],
...
},
"body": "# Best Wireless Earbuds Under $150 (2026)\n\n## Summary\n..."
}
Submit a question or topic request. If the question is already answered, returns the match. Otherwise records it for creation.
# Request
POST /api/v1/suggest
Content-Type: application/json
{"question": "What are the best robot vacuums under $500 in 2026?", "domain": "home"}
# Response (new suggestion)
{"status": "recorded", "suggestion_id": 42, "is_duplicate": false, "occurrence_count": 1}
# Response (already answered)
{"status": "already_answered", "existing_match": {"id": "...", "url": "..."}}
Browse top unanswered questions submitted by agents, ranked by occurrence count.
GET /api/v1/suggestions?limit=10&min_count=2&status=pending
Full catalog of all available knowledge units with metadata. No authentication required.
Discovery manifest describing the service, endpoints, and capabilities. No authentication required.
Use knowledgelib.io in n8n workflows for AI-augmented automation.
npm install n8n-nodes-knowledgelib
Or search for "knowledgelib" in the n8n Community Nodes panel.
| Operation | Description |
|---|---|
| Query Knowledge | Semantic search across all knowledge units with relevance ranking |
| Get Unit | Retrieve a specific unit by ID (markdown or JSON) |
| List Domains | List all available domains and unit counts |
| Suggest Question | Submit a topic request when query returns no results |
No API key required — works immediately after install.
Drop-in retriever for LangChain RAG chains. Returns Document objects with full metadata.
pip install langchain-knowledgelib
from langchain_knowledgelib import KnowledgelibRetriever, suggest_question
retriever = KnowledgelibRetriever(k=3)
docs = retriever.invoke("best wireless earbuds under 150")
if docs:
# Use the pre-verified, cited content
print(docs[0].page_content)
else:
# No match — suggest it for creation
suggest_question("What are the best wireless earbuds under $150?")
Supports both sync and async. Each Document includes confidence, last_verified, source_count, freshness, and relevance_score in metadata.
Every knowledge unit has a public web page. AI agents using web search + web fetch can consume units directly:
<meta name="ai:raw"> to get the raw .md URLThis requires zero setup. Any AI agent with web search capability can use knowledgelib.io.
Free. All API and MCP access is completely free of charge — no API key, no rate tiers, no sign-up. Every endpoint is public and open.
Why free? Because the whole point is saving AI agents money. Agents typically burn $0.50–$5.00 in compute to answer a single question from raw web. A knowledgelib.io query delivers the same answer in ~1,000 tokens at zero cost to you.
Full OpenAPI 3.0 spec available at: /api/v1/openapi.json
Compatible with LangChain, CrewAI, AutoGen, and any framework that supports OpenAPI tool definitions.