Skip to main content

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

Fields dropped by score although the value reads as language: the places where a real fact may have been lost.

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

Each kind’s pattern with {other_kind} replaced by that kind’s own pattern, by dependency and not by priority.

fold

The key form of a text: lowercase, no accents, no separators.

load_entities

The 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

Name -> Source for every entry that has an adapter.

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

A scalar as plain text.

describe_markers

Marker clauses as a sentence.

is_blank

lines_for

The default rendering of one field: label: text lines, nested keys joined by dots.

pointer_tokens

walk

Every (concrete path, value) the pointer reaches.

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

Parse a JSON or YAML file.

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

Plain data from a model, or from dicts and lists that contain models.

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

A field that marks its entry as secret or private, such as kind: secret or visibility: restricted.

key_words

name_lean

+1 for a field name that suggests knowledge, -1 for one that suggests configuration, 0 otherwise.

normalized

redact

Mask contact details, for a deployment that must not send them to a model.

score_leaf

The score of one leaf and the reasons, in plain words.

value_kind

One of: empty, flag, number, time, contact, address, token, tokens, word, phrase, sentence, vocab, objects, mixed.

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).

build_decider

main

value_type

A stable English phrase for the kind of value.