mcpField
C
create-knowledgebase

create-knowledgebase

github.com/bolna-aiData & databases367 installsUpdated 3d ago
Repository

About create-knowledgebase

A Bolna skill for creating and managing knowledge bases from PDFs or URLs. It supports multilingual retrieval settings and provides vector IDs for connecting processed sources to Bolna agents.

Key features

  1. 01Create knowledge bases from PDFs or URLs
  2. 02Check processing status and list sources
  3. 03Tune chunking and retrieval settings
  4. 04Enable multilingual retrieval
  5. 05Delete knowledge bases

Use cases

  1. 01Ground an agent in a product manual
  2. 02Use website documentation as an agent source
  3. 03Retrieve from non-English documents
  4. 04Adjust retrieval breadth for agent responses

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bolna-ai/skills --skill create-knowledgebase

After installing, type/create-knowledgebasein Claude Code to confirm it loaded.

Bundled filesscripts/create_knowledgebase.py

Details

From the project README

Create Bolna Knowledgebase

Endpoints

  • Create: POST https://api.bolna.ai/knowledgebase
  • Get: GET https://api.bolna.ai/knowledgebase/{rag_id}
  • List: GET https://api.bolna.ai/knowledgebase/all
  • Delete: DELETE https://api.bolna.ai/knowledgebase/{rag_id}

Use Authorization: Bearer $BOLNA_API_KEY.

Create from PDF

curl --request POST \
  --url https://api.bolna.ai/knowledgebase \
  --header "Authorization: Bearer $BOLNA_API_KEY" \
  --form 'file=@"/path/to/file.pdf"' \
  --form 'chunk_size=512' \
  --form 'similarity_top_k=15' \
  --form 'overlapping=128' \
  --form 'language_support=multilingual'

PDF max size is documented as 20 MB. Use language_support=multilingual for non-English documents or cross-lingual retrieval.

Create from URL

curl --request POST \
  --url https://api.bolna.ai/knowledgebase \
  --header "Authorization: Bearer $BOLNA_API_KEY" \
  --form 'url=https://example.com/docs' \
  --form 'chunk_size=512' \
  --form 'similarity_top_k=15' \
  --form 'overlapping=128'

Response fields

  • rag_id: knowledgebase ID used for get/delete operations.
  • file_name: PDF name or URL source name.
  • status: processing, processed, or error.
  • source_type: pdf or url.
  • language_support: multilingual or null.

List responses include vector_id, which is what an agent uses for RAG wiring.

Poll until processed

curl --request GET \
  --url "https://api.bolna.ai/knowledgebase/$RAG_ID" \
  --header "Authorization: Bearer $BOLNA_API_KEY"

Do not attach a knowledgebase to an agent until it is processed.

Wire into an agent

When creating or updating an agent, configure the LLM as a knowledgebase agent and include the processed vector IDs in the vector store provider config. Use create-agent for the full agent shape.

Delete

curl --request DELETE \
  --url "https://api.bolna.ai/knowledgebase/$RAG_ID" \
  --header "Authorization: Bearer $BOLNA_API_KEY"

Confirm deletion first; agents using the vector may stop answering from that source.

Wire into a Bolna agent

In the agent config, use agent_type: "knowledgebase_agent" and attach the vector_id (one or more):

{
  "llm_agent": {
    "agent_type": "knowledgebase_agent",
    "agent_flow_type": "streaming",
    "llm_config": { "provider": "openai", "model": "gpt-4o", "max_tokens": 200, "temperature": 0.3 },
    "vector_store": {
      "provider": "lancedb",
      "provider_config": {
        "vector_ids": ["<vector_id_1>", "<vector_id_2>"],
        "similarity_top_k": 8
      }
    }
  }
}

For graph agents, attach per-node via rag_config on individual nodes — see bolna-graph-agents/references/edges-and-routing.md and the example in bolna-graph-agents/assets/full-example.json.

Script

python3 create-knowledgebase/scripts/create_knowledgebase.py \
  --file /path/to/manual.pdf \
  --multilingual

Tuning

KnobDefaultEffect
chunk_size512Larger chunks = more context per retrieval, less precise matching.
overlapping128Overlap between chunks. Higher prevents missing answers that straddle boundaries.
similarity_top_k15How many chunks to retrieve. Lower for tight answers, higher for broader synthesis.
language_supportnullSet to multilingual for non-English docs or cross-lingual retrieval.

See also

  • create-agent — knowledgebase_agent example with vector wiring.
  • bolna-graph-agents — per-node RAG via rag_config.
  • https://raw.githubusercontent.com/bolna-ai/skills/main/references/prompting-tips.md — anti-hallucination guidance when answering from retrieved chunks.

Comments

Markdown supported