21 releases (8 stable)
Uses new Rust 2024
| 2.2.0-beta.1 | Jan 31, 2026 |
|---|---|
| 2.1.0-beta.1 | Jan 29, 2026 |
| 1.5.5 | Jan 9, 2026 |
| 1.3.0 | Oct 18, 2025 |
| 0.2.4 | Sep 18, 2025 |
#4 in #search-result
Used in 2 crates
1MB
16K
SLoC
blz-core
Core functionality for blz - a fast, local search cache for llms.txt documentation.
This crate provides the foundational components for parsing, storing, and searching llms.txt documentation files locally. It's designed for speed (sub-10ms search latency), offline-first usage, and exact line citations.
Architecture
The crate is organized around several key components:
- Configuration: Global and per-source settings management
- Parsing: Tree-sitter based markdown parsing with structured output
- Types: Core data structures representing sources, search results, and metadata
- Error Handling: Comprehensive error types with categorization and recovery hints
Quick Start
use blz_core::{Config, MarkdownParser, Result};
// Load global configuration
let config = Config::load()?;
// Parse markdown content
let mut parser = MarkdownParser::new()?;
let result = parser.parse("# Hello World\n\nThis is content.")?;
println!("Found {} heading blocks", result.heading_blocks.len());
println!("Generated TOC with {} entries", result.toc.len());
Performance Characteristics
- Parse time: < 150ms per MB of markdown content
- Memory usage: < 2x source document size during parsing
- Thread safety: All types are
Send + Syncwhere appropriate
Error Handling
All operations return [Result<T, Error>] with structured error information:
use blz_core::{Error, MarkdownParser};
let mut parser = MarkdownParser::new()?;
match parser.parse("malformed content") {
Ok(result) => println!("Parsed successfully"),
Err(Error::Parse(msg)) => eprintln!("Parse error: {}", msg),
Err(e) if e.is_recoverable() => eprintln!("Recoverable error: {}", e),
Err(e) => eprintln!("Fatal error: {}", e),
}
Dependencies
~46–72MB
~1M SLoC