Utilities

Frontmatter

LLMWiki.parse_frontmatterFunction
parse_frontmatter(content::String) -> (meta::PageMeta, body::String)

Parse YAML frontmatter delimited by --- from a markdown file. Returns the parsed PageMeta and the remaining body text. If no frontmatter is found, returns a default PageMeta with title="" and the full content as body.

LLMWiki.write_frontmatterFunction
write_frontmatter(meta::PageMeta) -> String

Generate YAML frontmatter string with --- delimiters.

write_frontmatter(meta::PageMeta, body::AbstractString) -> String

Serialize frontmatter + body into a complete Markdown document.

Markdown Utilities

LLMWiki.slugifyFunction
slugify(title::String) -> String

Convert a concept title to a URL-safe slug.

Examples

slugify("Knowledge Compilation") == "knowledge-compilation"
slugify("C++ Templates") == "c-templates"
slugify("  Foo  Bar  ") == "foo-bar"

State Management

LLMWiki.load_stateFunction
load_state(config::WikiConfig) -> WikiState

Read the wiki state from config.state_file. Returns an empty WikiState if the file does not exist or cannot be parsed.

LLMWiki.save_stateFunction
save_state(config::WikiConfig, state::WikiState)

Persist state to config.state_file atomically (write to a temporary file then rename).

LLMWiki.detect_changesFunction
detect_changes(config::WikiConfig, state::WikiState) -> Vector{SourceChange}

Walk config.sources_dir, compare each file's SHA-256 hash against the recorded state, and classify every file as NEW, CHANGED, UNCHANGED, or DELETED.

Files whose path previously appeared in state.sources but no longer exist on disk are reported as DELETED.

Configuration

LLMWiki.load_configFunction
load_config(root::String=".") -> WikiConfig

Load wiki configuration from .llmwiki/config.yaml. If the file does not exist, return default_config(root).

LLMWiki.save_configFunction
save_config(config::WikiConfig)

Persist the current configuration to .llmwiki/config.yaml. Only non-default values are written so the file stays minimal.

LLMWiki.default_configFunction
default_config(root::String=".") -> WikiConfig

Return a WikiConfig with all default values rooted at root. Directory paths are made absolute relative to root.

LLMWiki.resolve_paths!Function
resolve_paths!(config::WikiConfig) -> WikiConfig

Ensure all directory/file paths in config are absolute, resolving them relative to config.root. Mutates and returns config.

Operation Log

LLMWiki.log_operation!Function
log_operation!(config::WikiConfig, operation::Symbol, details::String)

Append an entry to the wiki operation log at config.log_file.

Each entry is formatted as:

## [2026-04-06T19:00:00] operation | details
LLMWiki.read_logFunction
read_log(config::WikiConfig) -> Vector{NamedTuple{(:timestamp,:operation,:details), Tuple{String,String,String}}}

Parse the wiki operation log and return a vector of named tuples. Lines that do not match the expected format are silently skipped.

Extension Stubs

LLMWiki.semantic_searchFunction
semantic_search(config::WikiConfig, query::String; top_k::Int=10) -> Vector{SearchResult}

Semantic vector search over wiki pages. Requires using LLMWiki, Mem0.

LLMWiki.load_state_sqliteFunction
load_state_sqlite(config::WikiConfig) -> WikiState

Load wiki state from SQLite. Requires using LLMWiki, SQLite.

LLMWiki.save_state_sqliteFunction
save_state_sqlite(config::WikiConfig, state::WikiState)

Save wiki state to SQLite. Requires using LLMWiki, SQLite.