Skip to main content
Kapso ships two backends for querying the knowledge graph. Which one you want depends on what you indexed.

Which backend should I use?

Set it with knowledge_search.type in your config, or override per index with kapso index_kg --search-type. The primary backend for wiki-based knowledge. It embeds the query, retrieves from Weaviate, optionally reranks with an LLM, then pulls connected pages from Neo4j.
Its three presets differ only in how much work they do after the vector search: Shipped defaults are embedding_provider: openai, embedding_model: text-embedding-3-large, weaviate_collection: KapsoKG, include_connected_pages: true, use_llm_reranker: false and reranker_overview_max_chars: 300. A preset overrides them; anything a preset omits falls back to these. The stores themselves are parameters too: weaviate_url (default http://localhost:8080), weaviate_grpc_port (50051), neo4j_uri (bolt://localhost:7687) and neo4j_user (neo4j). The Neo4j password is the one connection secret and is read from NEO4J_PASSWORD. An index records the endpoints in its backend_refs, so a search or merge opened from an index reaches the stores it was built on: a test index built on its own Weaviate and Neo4j never touches the production ones.
This is a different setting from defaults.models.embedding in the main config, which is text-embedding-3-small and is used for memory rather than for this backend.

Embedding with Google Vertex AI

Set embedding_provider: vertex to embed pages and queries with a serverless Vertex AI model instead of OpenAI:
  • Credentials. Google Application Default Credentials, read by google-auth itself: gcloud auth application-default login on a workstation, or a service account / workload identity for a service. The identity needs aiplatform.endpoints.predict on the project.
  • What is embedded. gemini-embedding-2 has no task-type parameter, so the task goes in the text, in Google’s documented retrieval format: a page is sent as title: <page name> | text: <description>, a query as task: search result | query: <query>.
  • Size. embedding_dimensions sets the output size (128–3072); unset keeps the model’s default of 3072.
  • Failures raise. Inputs over the model’s limit are rejected rather than truncated, rate limits and server errors are retried with backoff (embedding_max_attempts, embedding_backoff_seconds), and any other error stops the call. This holds for both providers: a page that cannot be embedded stops an index build instead of silently going missing from it.
An index records its provider, model, size and Vertex project in backend_refs, and a search built from that index embeds queries the same way. You never have to repeat these settings at search time, and vectors from two different models are never compared.

kg_llm_navigation

For JSON graphs, where an LLM navigates the structure instead of embedding it. No embeddings are involved, so it works with any graph shape.
Its four presets trade exploration against cost: All four use search_node_type: specialization. Both backends return a KGOutput.
Each result is a KGResultItem with id, score, page_type, overview, content and metadata, plus domains, sources and last_updated as properties. Narrow a search with KGSearchFilters:

How do I index content?

Indexing writes a .index file that campaigns load with --kg-index. See index_kg().
For a JSON graph, point at the file and name the backend:
The .index file is a small JSON reference, not the data itself:
Indexing needs Weaviate and Neo4j running. See Optional: knowledge-graph backends.

What happens when knowledge search is off?

KnowledgeSearchFactory.create_null() returns a no-op backend whose search() gives an empty KGOutput. MINIMAL mode ships with knowledge_search.enabled: false and uses it, so a campaign runs without any knowledge-graph infrastructure.

Can I add my own backend?

Register a class implementing KnowledgeSearch:
Add its presets to knowledge_search.yaml beside the two shipped backends.

Knowledge graph

What the graph holds and where it comes from

Learning pipeline

How sources become wiki pages
Related pages: Knowledge graph · Learning pipeline · Knowledge graph Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.