sources.auto
Find the knowledge in any configuration file, with no rules written for it.
AutoConfig
AutoFlattener
Construct with AutoFlattener(config: AutoConfig \| None = None, triage: 'FieldTriage \| None' = None).
Entry
Leaf
main
misses
report
report_misses
sources.combined
Several Sources that feed one scope.
CombinedSource
Construct with CombinedSource(*sources: Source).
sources.entities
Entity kinds from the ingestion config: codes, abbreviations, or any thing a deployment wants to name and explain.
Answer
Classes
A label for an entry, read from the start of one key group: QT is a process, QĐ a regulation.
ConceptRules
Which lexicon entries become concepts, how they read, and which links to document concepts are kept.
EntityConfig
EntityEngine
Construct with EntityEngine(config: EntityConfig).
EntityKind
Entry
Lexicon
Construct with Lexicon(entries: dict[tuple[str, ...], Entry], *, passages: int = 0, lowercase: collections.Counter \| None = None, expansions: frozenset[str] = frozenset()).
Pointer
Where something was found.
Resolver
TitleRules
What a good answer looks like.
expand
expanded_patterns
fold
load_entities
entities: section of ladygraph.yaml, or None when it has none.
main
report
sources.factory
Build Sources from the sources: list of ladygraph.yaml.
load_sources
sources.flatten
Flatten and normalize unstructured input into Records, the common input of the JSON, pydantic and markdown sources.
EntryFlattener
Flattens parsed JSON (or a dumped pydantic model) by EntryRules.
Construct with EntryFlattener(rules: list[EntryRule], triage: 'FieldTriage \| None' = None).
EntryRule
Which part of a structured document to ingest, and how to read it.
FlatSource
A Source over Records.
Construct with FlatSource(*, name: str, scheme: str, shape: Literal['assemble', 'decompose', 'map'], load: Callable[[str], typing.Any], flattener: Flattener, document_scheme: str \| None = None, scope: str \| None = None).
Flattener
Construct with Flattener(*args, **kwargs).
Part
One passage of a Record.
Record
One change unit, flattened.
as_date
as_list
clean
describe_markers
is_blank
lines_for
label: text lines, nested keys joined by dots.
pointer_tokens
walk
sources.json
JSON source: business configuration kept in a JSON (or YAML) file, one Document per entry (INTERFACE §7).
JsonSource
Construct with JsonSource(config: JsonSourceConfig, base_dir: pathlib.Path \| None = None, decider: Decider \| None = None).
JsonSourceConfig
TriageConfig
make_flattener
auto reads any file by its shape.
make_triage
read_structured
resolve_path
sources.markdown
Markdown source: knowledge kept as markdown files, one Document per section (INTERFACE §7, shape decompose).
MarkdownFile
MarkdownFlattener
Construct with MarkdownFlattener(config: MarkdownSourceConfig).
MarkdownSource
Construct with MarkdownSource(config: MarkdownSourceConfig, base_dir: pathlib.Path \| None = None).
MarkdownSourceConfig
find_files
split_front_matter
sources.plan
Show what an update would do, without extracting or writing anything.
main
sources.pydantic
Pydantic source: configuration that already lives in code as pydantic models (INTERFACE §7).
PydanticSource
Construct with PydanticSource(config: PydanticSourceConfig, provider: Callable[[str], typing.Any] \| None = None, base_dir: pathlib.Path \| None = None, decider: Decider \| None = None).
PydanticSourceConfig
dump
import_provider
sources.resolver
A Resolver that reads the live text back through a Source (INTERFACE section 6, “Resolver”).
SourceResolver
Construct with SourceResolver(source: Source, *, max_workers: int = 4).
sources.signals
Deterministic signals that tell knowledge from system configuration, for any config in any domain.
describe_clause
a & b & !c as words.
effective_kind
value_kind, except that single words under a name that leans to knowledge are a vocabulary: ["laptop", "invoice"] under aliases is keywords, under route_codes it is code words.
is_protected
kind: secret or visibility: restricted.
key_words
name_lean
normalized
redact
score_leaf
value_kind
sources.sql
SQL source: builds Documents from database rows (INTERFACE §7).
ConnectionConfig
DocumentMap
Executor
Construct with Executor(*args, **kwargs).
PassageMap
Queries
QueryConfig
Relationship
SqlAlchemyExecutor
Construct with SqlAlchemyExecutor(connections: dict[str, ConnectionConfig]).
SqlSource
Construct with SqlSource(config: SqlSourceConfig, executor: Executor \| None = None).
SqlSourceConfig
TableConfig
VersionMap
sources.triage
Let a Decider judge which fields of a config entry are knowledge, so nobody has to list exclude: by hand.
FieldTriage
Construct with FieldTriage(decider: Decider \| None, cache: pathlib.Path \| str, *, drop_threshold: float = 0.7).