factflow-knowledge
Concept detection, consolidation, and knowledge-diff adapters. Turns segmented/embedded content into a structured concept map, detects change over time, and exports to downstream systems (Avalon).
Tier and role
Section titled “Tier and role”- Tier: workflow
- Import name:
factflow_knowledge - Source:
backend/packages/workflows/factflow-knowledge/
Consumed by pipelines that need structured knowledge rather than raw segments. Often the final stage before export.
Context
Section titled “Context”Three subpackages, each owning a stage of the knowledge lifecycle:
concept_detection
Section titled “concept_detection”Identify concepts in segmented content (LLM-extracted). Maintains a per-origin concept map in storage.
adapter.py— pipeline adapter that runs detectionconcept_map_writer.py— persists the maprepository.py— read/write access to detected conceptsmodels.py— typed concept + relationship records
consolidation
Section titled “consolidation”Merge concepts from multiple sources; write to Avalon (DNB’s knowledge platform).
concept_map_updater.py— merges new detections into an existing mapconcept_source_loader.py— reads source documents referenced by conceptsavalon_writer.py— persists the consolidated map to Avalonmodels.py
knowledge_diff
Section titled “knowledge_diff”Compare two snapshots of a knowledge map; emit a diff with storage-writeable output.
adapter.pystorage_enumerator.pydiff_storage_writer.py
export
Section titled “export”Render concept maps to shareable formats (tree / report / taxonomy).
exporter.pyrenderer.pytaxonomy_resolver.pystats.py
Public API
Section titled “Public API”Top-level factflow_knowledge/__init__.py is intentionally empty. Consumers:
- Configure adapters via YAML (pipeline config references them by their
type:string — each adapter registers itself via discovery) - Use
python -m factflow_knowledge.exportto run export CLI
Importing individual classes is rare; when needed, import from the subpackage (e.g. from factflow_knowledge.concept_detection.adapter import ConceptDetectionAdapter).
Dependencies
Section titled “Dependencies”- Workspace:
factflow-protocols,factflow-foundation,factflow-engine,factflow-llm(for concept extraction) - External services: storage provider, LLM provider, Avalon credentials (for the
avalon_writer)
Testing
Section titled “Testing”Tests at backend/packages/workflows/factflow-knowledge/tests/. Testing concept detection is LLM-heavy — see .claude/skills/backend/llm-unit-testing/ for the mocking pattern. See .claude/skills/epistemic-evaluation/ for assessing extraction quality.
Related
Section titled “Related”factflow-embeddings— typical upstream (segmented + embedded content)factflow-boost— upstream source for Boost-origin conceptsfactflow-llm— the extraction and consolidation LLM calls go through here