Skip to main content

Crate kb

Crate kb 

Source
Expand description

Personal knowledge base — typed AST with org-mode as projection, SQLite-backed.

The crate provides:

  • parser — org-mode text → AST
  • generator — AST → org-mode text
  • storageSQLite persistence with FTS5 search
  • api — HTTP handlers for kb-server
  • mcp — Model Context Protocol server over stdio

The org-mode AST types are re-used from the companion tftio_org crate; the parser is kept in-crate (see the crate README for the rationale).

Modules§

api
HTTP API type definition and handlers.
auth
Bearer-token authentication middleware (T06-03).
canonical
Canonical-form mapping over Document.
cli_main
CLI entrypoint for the kb knowledge base tool.
embedding
OpenAI-compatible embedding generation.
error
Error types for the kb crate.
generator
AST → org-mode String projection.
markdown
Markdown ingestion: convert GitHub-flavored markdown to the kb AST.
mcp
MCP (Model Context Protocol) JSON-RPC server over stdio.
org_meta
Document-level kb metadata as an org property-drawer envelope.
parser
Org-mode text → AST parser using hand-written recursive descent.
prompt
kb promptMiniJinja template runner over the local kb corpus.
sexp
S-expression encoding for Document matching Haskell KB/AST/Sexp.hs.
storage
SQLite-backed persistence for kb.