Which backend should I use?
Set it with
knowledge_search.type in your config, or override per index with kapso index_kg --search-type.
kg_graph_search
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.
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
Setembedding_provider: vertex to embed pages and queries with a serverless Vertex AI model instead of OpenAI:
- Credentials. Google Application Default Credentials, read by
google-authitself:gcloud auth application-default loginon a workstation, or a service account / workload identity for a service. The identity needsaiplatform.endpoints.predicton the project. - What is embedded.
gemini-embedding-2has no task-type parameter, so the task goes in the text, in Google’s documented retrieval format: a page is sent astitle: <page name> | text: <description>, a query astask: search result | query: <query>. - Size.
embedding_dimensionssets 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.
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.
All four use
search_node_type: specialization.
What comes back from a search
Both backends return aKGOutput.
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().
.index file is a small JSON reference, not the data itself:
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 implementingKnowledgeSearch:
knowledge_search.yaml beside the two shipped backends.
Related
Knowledge graph
Learning pipeline
pip install leeroo-kapso · Every page as plain text: llms.txt.