feat(knowledge): real Wikipedia vertical with containment-checked KG
knowledge/: wiki.py (official MediaWiki API, own session+UA; fetch_rich appends wikitext tables as text - plain extracts drop them), chunker.py (section-aware, level paths), checks.py (verbatim containment, quote-aware), store.py (SQLite append-only, 4 contradiction cases, probe by entity AND relation with stemming), extract.py (dspy Signatures: TRANSLATE resolves pronouns from context and emits queries+entities, EXTRACT per chunk, ANSWER from KG rows), expert.py (the pipeline: KG-first probe -> gap -> translate -> search -> fetch_rich -> chunk -> gate -> extract -> check -> merge -> re-probe -> answer). Wiring: KnowledgeEngine in floop/engine.py (machine injects charge+modules at call time; baseline fallback on pipeline failure), machine routes knowledge questions to it, config.yaml knowledge: block. E2E verified live: Loire length answered from KG with zero network; the 2-hop EU-river question resolved France (population table row quote) -> Loire (KG hit) in 12 calls/75s. Six live-run bugs closed (wiki lib 403/HTML, dropped tables, pipes-in-quotes parse, gate stemming, relation probe, pronoun context). RUNLOG Run C added; code/README honest map updated. Tests 17/17.
This commit is contained in:
+10
-1
@@ -19,4 +19,13 @@ budget:
|
||||
min_child_budget: 6
|
||||
max_depth: 2 # recursion cap (PIPELINE.md §8.4)
|
||||
max_retries: 3 # bounded self-refinement on unparseable LLM output
|
||||
missing_extensions: 1 # how many times "what is still missing?" may reopen questions per run
|
||||
missing_extensions: 1 # how many times "what is still missing?" may reopen questions per run
|
||||
|
||||
knowledge:
|
||||
enabled: true # real KG pipeline for the knowledge expert; false -> baseline LLM
|
||||
kb_path: knowledge_store/kg.sqlite
|
||||
max_articles: 3 # per knowledge call
|
||||
max_search_results: 4 # candidates considered
|
||||
max_chunks_extracted: 6 # per call (lexical gate decides which)
|
||||
chunk_chars_target: 32000
|
||||
chunk_chars_cap: 48000
|
||||
Reference in New Issue
Block a user