aux4 knowledge base manager
aux4/kb manages a markdown-based knowledge base stored in a local folder. It provides commands to add, update, remove, search, list, and view knowledge entries. Each entry is a markdown file, and an auto-maintained index.json tracks metadata, MD5 checksums, and cross-page references.
aux4 aux4 pkger install aux4/kb
Add a knowledge entry:
aux4 kb add "Docker Networking" --content "# Docker Networking\n\nDocker uses bridge networks by default." --tags "docker,networking"
List all entries:
aux4 kb list
Search for a term:
aux4 kb search "bridge"
View an entry:
aux4 kb view "Docker Networking"
aux4 kb add - Add a new knowledge entryaux4 kb update - Update an existing knowledge entryaux4 kb remove - Remove a knowledge entryaux4 kb search - Search the knowledge baseaux4 kb list - List all knowledge base entriesaux4 kb view - View a knowledge base entryaux4 kb links - Show links between knowledge base entriesaux4 kb refs - List references from a page to other pagesaux4 kb backrefs - List pages that reference a given pageaux4 kb graph - Generate a mermaid graph of page referencesAdd a new knowledge entry to the knowledge base.
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder path--content (optional) - Markdown content--file (optional) - Path to markdown file for content--tags (optional) - Comma-separated tagsaux4 kb add "Go Error Handling" --content "# Go Error Handling\n\nGo uses explicit error returns." --tags "go,errors"
Add from a file:
aux4 kb add "API Design" --file notes/api-design.md --tags "api,design"
Update an existing knowledge entry.
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder path--content (optional) - New markdown content--file (optional) - Path to markdown file for contentaux4 kb update "Docker Networking" --content "# Docker Networking\n\nUpdated content about overlay networks."
Remove a knowledge entry from the knowledge base.
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder pathaux4 kb remove "Docker Networking"
Search the knowledge base. Entries are ranked by relevance using BM25 across three fields, with title and tags weighted higher than the body:
Because title and tags are indexed — not just the body — a query that matches only the topic or a tag still finds the entry (e.g. searching the tag word preferences, or the topic word preference, matches an entry titled "response style preference" even when the word is absent from the body). Queries and documents are tokenized and stemmed (Porter stemmer), so preference, prefers, preferences, and preferred all match one another; common stop words are ignored.
Results are returned ranked by score (most relevant first), with the file header followed by the matching lines and surrounding context. Entries with no matching terms are dropped.
Variables:
query (required, arg) - Search query--folder (optional, default: .knowledge) - Knowledge base folder pathaux4 kb search "networking"
aux4 kb search "preference"
## response-style-preference.md
Line 1:
Prefers concise, bullet-point answers
List all entries in the knowledge base.
Variables:
--folder (optional, default: .knowledge) - Knowledge base folder pathaux4 kb list
View the content of a knowledge base entry.
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder pathaux4 kb view "Docker Networking"
List all pages that a given page references (outbound links).
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder path--render (optional, default: text) - Output format (text or json)aux4 kb refs "Docker"
List all pages that reference a given page (inbound links / backlinks).
Variables:
topic (required, arg) - Topic title--folder (optional, default: .knowledge) - Knowledge base folder path--render (optional, default: text) - Output format (text or json)aux4 kb backrefs "Docker"
Generate a mermaid graph of page references. Optionally focus on a single page and its neighbors.
Variables:
topic (optional, arg) - Topic title (generates graph for specific page)--folder (optional, default: .knowledge) - Knowledge base folder path--render (optional, default: text) - Output format (text or json)# Full graph
aux4 kb graph
# Graph focused on a page
aux4 kb graph "Docker"
The knowledge base is stored as markdown files in a configurable folder (default .knowledge/):
.knowledge/
├── index.json # Metadata index (auto-maintained)
├── docker-networking.md # Individual entries
└── go-error-handling.md
The index.json file is a JSON array with metadata, MD5 checksums, and cross-page references:
[
{
"topic": "Docker Networking",
"file": "docker-networking.md",
"tags": "docker,networking",
"date": "2026-03-11",
"summary": "Docker uses bridge networks by default.",
"md5": "a1b2c3d4e5f6...",
"references": ["go-error-handling.md"]
}
]
This package is licensed under the Apache License, Version 2.0.
