okforge 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- okforge-0.6.2/.claude-plugin/marketplace.json +29 -0
- okforge-0.6.2/.env.example +6 -0
- okforge-0.6.2/.github/workflows/ci.yml +53 -0
- okforge-0.6.2/.github/workflows/publish.yml +55 -0
- okforge-0.6.2/.gitignore +26 -0
- okforge-0.6.2/AGENTS.md +44 -0
- okforge-0.6.2/CLAUDE.md +1 -0
- okforge-0.6.2/LICENSE +190 -0
- okforge-0.6.2/PKG-INFO +144 -0
- okforge-0.6.2/README.md +103 -0
- okforge-0.6.2/assets/openkb-architecture.webp +0 -0
- okforge-0.6.2/config.yaml.example +22 -0
- okforge-0.6.2/docs/.gitignore +8 -0
- okforge-0.6.2/docs/golden-principles.md +32 -0
- okforge-0.6.2/examples/README.md +44 -0
- okforge-0.6.2/examples/chat/README.md +92 -0
- okforge-0.6.2/examples/commands/README.md +174 -0
- okforge-0.6.2/examples/commands/sample-wiki/concepts/attention-mechanisms.md +81 -0
- okforge-0.6.2/examples/commands/sample-wiki/concepts/positional-encoding.md +48 -0
- okforge-0.6.2/examples/commands/sample-wiki/concepts/transformer-models.md +80 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/google-brain.md +45 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/google-research.md +29 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/google.md +30 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/nips-2017.md +31 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/tensor2tensor.md +27 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/university-of-toronto.md +25 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/wmt-2014-english-french.md +31 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/wmt-2014-english-german.md +32 -0
- okforge-0.6.2/examples/commands/sample-wiki/entities/wmt-2014.md +31 -0
- okforge-0.6.2/examples/commands/sample-wiki/explorations/how-does-the-transformer-replace-recurrence-with-self-attent.md +9 -0
- okforge-0.6.2/examples/commands/sample-wiki/summaries/attention-is-all-you-need.md +136 -0
- okforge-0.6.2/examples/configuration/README.md +209 -0
- okforge-0.6.2/examples/pageindex-cloud/README.md +129 -0
- okforge-0.6.2/examples/skills/README.md +134 -0
- okforge-0.6.2/examples/skills/marketplace.json +26 -0
- okforge-0.6.2/examples/skills/transformer-attention/SKILL.md +52 -0
- okforge-0.6.2/examples/skills/transformer-attention/references/original-transformer-paper.md +11 -0
- okforge-0.6.2/examples/slides/README.md +87 -0
- okforge-0.6.2/examples/slides/attention-intro.html +151 -0
- okforge-0.6.2/examples/visualize/README.md +77 -0
- okforge-0.6.2/examples/visualize/graph.html +907 -0
- okforge-0.6.2/openkb/__init__.py +13 -0
- okforge-0.6.2/openkb/__main__.py +5 -0
- okforge-0.6.2/openkb/agent/__init__.py +1 -0
- okforge-0.6.2/openkb/agent/_markdown.py +370 -0
- okforge-0.6.2/openkb/agent/chat.py +963 -0
- okforge-0.6.2/openkb/agent/chat_session.py +271 -0
- okforge-0.6.2/openkb/agent/compiler.py +2435 -0
- okforge-0.6.2/openkb/agent/linter.py +119 -0
- okforge-0.6.2/openkb/agent/query.py +470 -0
- okforge-0.6.2/openkb/agent/skill_runner.py +216 -0
- okforge-0.6.2/openkb/agent/skills.py +124 -0
- okforge-0.6.2/openkb/agent/tools.py +404 -0
- okforge-0.6.2/openkb/cli.py +3032 -0
- okforge-0.6.2/openkb/config.py +337 -0
- okforge-0.6.2/openkb/converter.py +270 -0
- okforge-0.6.2/openkb/deck/__init__.py +34 -0
- okforge-0.6.2/openkb/deck/creator.py +122 -0
- okforge-0.6.2/openkb/deck/validator.py +246 -0
- okforge-0.6.2/openkb/frontmatter.py +138 -0
- okforge-0.6.2/openkb/images.py +260 -0
- okforge-0.6.2/openkb/indexer.py +196 -0
- okforge-0.6.2/openkb/links.py +84 -0
- okforge-0.6.2/openkb/lint.py +694 -0
- okforge-0.6.2/openkb/locks.py +243 -0
- okforge-0.6.2/openkb/log.py +22 -0
- okforge-0.6.2/openkb/mutation.py +458 -0
- okforge-0.6.2/openkb/okf.py +120 -0
- okforge-0.6.2/openkb/prompts/__init__.py +22 -0
- okforge-0.6.2/openkb/prompts/skill_create.md +214 -0
- okforge-0.6.2/openkb/schema.py +93 -0
- okforge-0.6.2/openkb/skill/__init__.py +102 -0
- okforge-0.6.2/openkb/skill/creator.py +224 -0
- okforge-0.6.2/openkb/skill/evaluator.py +490 -0
- okforge-0.6.2/openkb/skill/generator.py +125 -0
- okforge-0.6.2/openkb/skill/marketplace.py +118 -0
- okforge-0.6.2/openkb/skill/tools.py +103 -0
- okforge-0.6.2/openkb/skill/validator.py +277 -0
- okforge-0.6.2/openkb/skill/workspace.py +188 -0
- okforge-0.6.2/openkb/state.py +127 -0
- okforge-0.6.2/openkb/templates/graph.html +907 -0
- okforge-0.6.2/openkb/topic_tree.py +229 -0
- okforge-0.6.2/openkb/topic_tree_llm.py +104 -0
- okforge-0.6.2/openkb/tree_renderer.py +170 -0
- okforge-0.6.2/openkb/url_ingest.py +282 -0
- okforge-0.6.2/openkb/visualize.py +79 -0
- okforge-0.6.2/openkb/watcher.py +101 -0
- okforge-0.6.2/pyproject.toml +163 -0
- okforge-0.6.2/skills/openkb/SKILL.md +192 -0
- okforge-0.6.2/skills/openkb/references/commands.md +89 -0
- okforge-0.6.2/skills/openkb/references/wiki-schema.md +165 -0
- okforge-0.6.2/skills/openkb-deck-editorial/SKILL.md +185 -0
- okforge-0.6.2/skills/openkb-deck-neon/SKILL.md +300 -0
- okforge-0.6.2/skills/openkb-html-critic/SKILL.md +140 -0
- okforge-0.6.2/tests/conftest.py +92 -0
- okforge-0.6.2/tests/test_add_command.py +334 -0
- okforge-0.6.2/tests/test_agent_tools.py +224 -0
- okforge-0.6.2/tests/test_chat_session.py +77 -0
- okforge-0.6.2/tests/test_chat_slash_commands.py +259 -0
- okforge-0.6.2/tests/test_cli.py +485 -0
- okforge-0.6.2/tests/test_compiler.py +2981 -0
- okforge-0.6.2/tests/test_compiler_topic_tree.py +29 -0
- okforge-0.6.2/tests/test_config.py +199 -0
- okforge-0.6.2/tests/test_converter.py +469 -0
- okforge-0.6.2/tests/test_critique_slash.py +139 -0
- okforge-0.6.2/tests/test_cross_platform_locks.py +98 -0
- okforge-0.6.2/tests/test_deck_chat_slash.py +131 -0
- okforge-0.6.2/tests/test_deck_cli.py +151 -0
- okforge-0.6.2/tests/test_deck_creator.py +234 -0
- okforge-0.6.2/tests/test_deck_neon_prompt.py +83 -0
- okforge-0.6.2/tests/test_deck_package.py +22 -0
- okforge-0.6.2/tests/test_deck_prompt.py +52 -0
- okforge-0.6.2/tests/test_deck_validator.py +228 -0
- okforge-0.6.2/tests/test_feedback.py +243 -0
- okforge-0.6.2/tests/test_file_size.py +93 -0
- okforge-0.6.2/tests/test_frontmatter.py +134 -0
- okforge-0.6.2/tests/test_generator.py +147 -0
- okforge-0.6.2/tests/test_grep.py +347 -0
- okforge-0.6.2/tests/test_images.py +198 -0
- okforge-0.6.2/tests/test_indexer.py +276 -0
- okforge-0.6.2/tests/test_links.py +65 -0
- okforge-0.6.2/tests/test_lint.py +787 -0
- okforge-0.6.2/tests/test_lint_cli.py +80 -0
- okforge-0.6.2/tests/test_linter.py +86 -0
- okforge-0.6.2/tests/test_list_status.py +374 -0
- okforge-0.6.2/tests/test_llm_config_passthrough.py +281 -0
- okforge-0.6.2/tests/test_llm_timeout.py +88 -0
- okforge-0.6.2/tests/test_locks.py +105 -0
- okforge-0.6.2/tests/test_markdown_renderer.py +38 -0
- okforge-0.6.2/tests/test_marketplace.py +192 -0
- okforge-0.6.2/tests/test_mutation.py +623 -0
- okforge-0.6.2/tests/test_query.py +183 -0
- okforge-0.6.2/tests/test_query_topic_tool.py +16 -0
- okforge-0.6.2/tests/test_read_kb_file.py +133 -0
- okforge-0.6.2/tests/test_recompile.py +455 -0
- okforge-0.6.2/tests/test_reindex_cli.py +36 -0
- okforge-0.6.2/tests/test_remove.py +1338 -0
- okforge-0.6.2/tests/test_schema.py +11 -0
- okforge-0.6.2/tests/test_skill_chat_slash.py +117 -0
- okforge-0.6.2/tests/test_skill_cli.py +419 -0
- okforge-0.6.2/tests/test_skill_creator.py +113 -0
- okforge-0.6.2/tests/test_skill_evaluator.py +414 -0
- okforge-0.6.2/tests/test_skill_name_validation.py +44 -0
- okforge-0.6.2/tests/test_skill_runner.py +308 -0
- okforge-0.6.2/tests/test_skill_tools.py +68 -0
- okforge-0.6.2/tests/test_skill_validator.py +466 -0
- okforge-0.6.2/tests/test_skill_workspace.py +177 -0
- okforge-0.6.2/tests/test_skills.py +242 -0
- okforge-0.6.2/tests/test_state.py +165 -0
- okforge-0.6.2/tests/test_topic_tree.py +143 -0
- okforge-0.6.2/tests/test_topic_tree_e2e.py +54 -0
- okforge-0.6.2/tests/test_topic_tree_links.py +101 -0
- okforge-0.6.2/tests/test_tree_renderer.py +271 -0
- okforge-0.6.2/tests/test_url_ingest.py +732 -0
- okforge-0.6.2/tests/test_visualize.py +74 -0
- okforge-0.6.2/tests/test_visualize_cli.py +54 -0
- okforge-0.6.2/tests/test_watcher.py +125 -0
- okforge-0.6.2/tests/test_write_kb_file.py +80 -0
- okforge-0.6.2/uv.lock +3075 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vectify",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "designcomputer"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "Skills for navigating an okforge-compiled knowledge base from agent CLIs (Claude Code, Codex, Gemini CLI).",
|
|
8
|
+
"version": "0.6.1"
|
|
9
|
+
},
|
|
10
|
+
"plugins": [
|
|
11
|
+
{
|
|
12
|
+
"name": "openkb",
|
|
13
|
+
"description": "Navigate an okforge-compiled wiki: discover documents and concepts via openkb CLI commands, read concept and summary pages directly, and follow wikilinks across the knowledge graph. Adapted from the original OpenKB skill by Ray (Vectify AI).",
|
|
14
|
+
"source": "./",
|
|
15
|
+
"strict": false,
|
|
16
|
+
"version": "0.6.1",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "designcomputer"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/designcomputer/okforge",
|
|
21
|
+
"repository": "https://github.com/designcomputer/okforge",
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"keywords": ["knowledge-base", "wiki", "okforge", "okf", "openkb", "rag", "agent-skill"],
|
|
24
|
+
"skills": [
|
|
25
|
+
"./skills/openkb"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
# Least-privilege token: this workflow only reads the repo. Arbitrary
|
|
9
|
+
# dependency build code runs during install, so never expose a writable
|
|
10
|
+
# token to it (see the supply-chain notes in pyproject.toml).
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
# Cancel superseded runs on the same ref (rapid PR pushes) instead of
|
|
15
|
+
# letting them pile up and post stale statuses.
|
|
16
|
+
concurrency:
|
|
17
|
+
group: ci-${{ github.ref }}
|
|
18
|
+
cancel-in-progress: true
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
check:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
|
|
28
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
29
|
+
with:
|
|
30
|
+
version: "0.10.2"
|
|
31
|
+
enable-cache: true
|
|
32
|
+
|
|
33
|
+
# `uv sync --locked` installs the exact uv.lock resolution (direct AND
|
|
34
|
+
# transitive deps) and fails if the lock is stale — a bare `pip install`
|
|
35
|
+
# would ignore the lockfile and let transitive versions float, defeating
|
|
36
|
+
# the repo's exact-pin supply-chain policy. Run `uv lock` and commit the
|
|
37
|
+
# lockfile whenever pyproject dependencies change.
|
|
38
|
+
- name: Install (locked)
|
|
39
|
+
run: uv sync --locked --extra dev --python 3.12
|
|
40
|
+
|
|
41
|
+
# --no-sync: don't let `uv run` re-sync without the dev extra and
|
|
42
|
+
# uninstall the tools it is about to run.
|
|
43
|
+
- name: Ruff lint
|
|
44
|
+
run: uv run --no-sync ruff check .
|
|
45
|
+
|
|
46
|
+
- name: Ruff format check
|
|
47
|
+
run: uv run --no-sync ruff format --check .
|
|
48
|
+
|
|
49
|
+
- name: Mypy
|
|
50
|
+
run: uv run --no-sync mypy openkb
|
|
51
|
+
|
|
52
|
+
- name: Pytest
|
|
53
|
+
run: uv run --no-sync pytest
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Release flow:
|
|
4
|
+
# 1. `git tag -a vX.Y.Z -m "Release X.Y.Z" && git push origin vX.Y.Z`
|
|
5
|
+
# 2. This workflow builds the package (hatch-vcs derives the version from
|
|
6
|
+
# the tag automatically — pyproject.toml has no static version field),
|
|
7
|
+
# publishes to PyPI via OIDC trusted publishing, and creates a GitHub
|
|
8
|
+
# Release with auto-generated notes.
|
|
9
|
+
#
|
|
10
|
+
# Tag must follow PEP 440: `v0.1.4`, `v0.2.0rc1`, `v0.1.4.dev0`. The
|
|
11
|
+
# leading `v` is stripped by hatch-vcs when computing the package version.
|
|
12
|
+
#
|
|
13
|
+
# Do not run `python -m build && twine upload` locally — that bypasses the
|
|
14
|
+
# GitHub Release creation and produces a release without an attached
|
|
15
|
+
# changelog. PyPI rejects duplicate version uploads, so if the workflow
|
|
16
|
+
# fails after PyPI publish succeeded, manually create the missing GitHub
|
|
17
|
+
# Release with `gh release create vX.Y.Z`.
|
|
18
|
+
|
|
19
|
+
on:
|
|
20
|
+
push:
|
|
21
|
+
tags:
|
|
22
|
+
- "v*"
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
publish:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
environment: pypi
|
|
28
|
+
permissions:
|
|
29
|
+
id-token: write # OIDC trusted publishing to PyPI
|
|
30
|
+
contents: write # Create GitHub Release
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0 # hatch-vcs needs full history + tags
|
|
35
|
+
|
|
36
|
+
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
|
|
40
|
+
- name: Install build tools
|
|
41
|
+
run: pip install build
|
|
42
|
+
|
|
43
|
+
- name: Build package
|
|
44
|
+
run: python -m build
|
|
45
|
+
|
|
46
|
+
- name: Publish to PyPI
|
|
47
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1.14.0
|
|
48
|
+
|
|
49
|
+
- name: Create GitHub Release
|
|
50
|
+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
|
51
|
+
with:
|
|
52
|
+
tag_name: ${{ github.ref_name }}
|
|
53
|
+
name: ${{ github.ref_name }}
|
|
54
|
+
generate_release_notes: true
|
|
55
|
+
files: dist/*
|
okforge-0.6.2/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
.venv/
|
|
7
|
+
venv/
|
|
8
|
+
*.db
|
|
9
|
+
.DS_Store
|
|
10
|
+
.env
|
|
11
|
+
|
|
12
|
+
# Knowledge base test artifacts
|
|
13
|
+
raw/
|
|
14
|
+
wiki/
|
|
15
|
+
.openkb/
|
|
16
|
+
output/
|
|
17
|
+
|
|
18
|
+
# Local only
|
|
19
|
+
docs/internal/
|
|
20
|
+
.claude/
|
|
21
|
+
|
|
22
|
+
# Heavy test-input documents for the examples (the old blanket `docs/` rule
|
|
23
|
+
# used to catch this dir at any depth; the anchored `docs/internal/` above
|
|
24
|
+
# does not). The PDFs already tracked on main stay tracked — this only stops
|
|
25
|
+
# new drops from being swept into commits.
|
|
26
|
+
examples/docs/
|
okforge-0.6.2/AGENTS.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# AGENTS.md — okforge map for coding agents
|
|
2
|
+
|
|
3
|
+
okforge (a hard fork of VectifyAI/OpenKB) compiles raw documents into an interlinked wiki knowledge base using
|
|
4
|
+
LLMs (vectorless retrieval via PageIndex). This repo is developed **agent-first**:
|
|
5
|
+
humans steer, agents execute. Optimize changes for agent legibility.
|
|
6
|
+
|
|
7
|
+
## Read next
|
|
8
|
+
- `docs/golden-principles.md` — mechanical rules to follow (enforced where possible).
|
|
9
|
+
- `docs/internal/superpowers/{specs,plans}/` — design history & plans *(maintainer-local, not in git)*.
|
|
10
|
+
- `README.md` — user-facing overview and commands.
|
|
11
|
+
|
|
12
|
+
## Dev commands
|
|
13
|
+
- Install: `pip install -e ".[dev]"` (or `uv sync --extra dev` — plain `uv sync` skips the dev tools)
|
|
14
|
+
- Run CLI: `okforge <command>` (entry point: `openkb.cli:cli`; `openkb` kept as a transition alias)
|
|
15
|
+
- Test: `pytest`
|
|
16
|
+
- Lint/format/types: `ruff check .` · `ruff format .` · `mypy openkb`
|
|
17
|
+
|
|
18
|
+
## Module map (openkb/)
|
|
19
|
+
- `cli.py` — Click CLI entry point & command wiring *(large; see tech-debt)*.
|
|
20
|
+
- `config.py` — config loading/validation (LiteLLM passthrough, env).
|
|
21
|
+
- `converter.py` — document → markdown conversion (markitdown).
|
|
22
|
+
- `url_ingest.py` — fetch & ingest URLs (trafilatura).
|
|
23
|
+
- `images.py` — figure/image extraction & handling.
|
|
24
|
+
- `indexer.py` — PageIndex tree indexing for long docs.
|
|
25
|
+
- `mutation.py` — crash-safe, serial KB mutations.
|
|
26
|
+
- `locks.py` — atomic writes / file locking (`atomic_write_text`, portalocker).
|
|
27
|
+
- `state.py` — run/session state tracking.
|
|
28
|
+
- `frontmatter.py` — YAML frontmatter round-trip (OKF).
|
|
29
|
+
- `schema.py` — page/content schema constants & helpers.
|
|
30
|
+
- `lint.py` — structural wiki lint (broken links, orphans, index sync).
|
|
31
|
+
- `tree_renderer.py`, `visualize.py`, `watcher.py` — rendering / graph / file watch.
|
|
32
|
+
- `agent/compiler.py` — LLM wiki compiler *(large; see tech-debt)*.
|
|
33
|
+
- `agent/linter.py` — semantic (LLM) wiki lint (contradictions, gaps, staleness).
|
|
34
|
+
- `agent/chat.py`, `agent/chat_session.py` — chat over the wiki *(chat.py large)*.
|
|
35
|
+
- `agent/query.py` — one-off query generator.
|
|
36
|
+
- `agent/tools.py` — shared wiki read/write tool functions used by query/linter (and by chat indirectly via `query.build_chat_agent`).
|
|
37
|
+
- `agent/skills.py`, `agent/skill_runner.py`, `skill/` — Skill Factory.
|
|
38
|
+
- `deck/`, `templates/`, `prompts/` — deck output, templates, prompt assets.
|
|
39
|
+
|
|
40
|
+
## Hard invariants
|
|
41
|
+
- Deps are pinned **exactly** (supply-chain caution). Vet before bumping.
|
|
42
|
+
- Wiki writes go through `locks.py` / `mutation.py` (never ad-hoc).
|
|
43
|
+
- Modules stay < 800 lines (`tests/test_file_size.py`); grandfathered files are in tech-debt.
|
|
44
|
+
- Keep this file a short map — put depth in `docs/`.
|
okforge-0.6.2/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
okforge-0.6.2/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Vectify AI
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
okforge-0.6.2/PKG-INFO
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: okforge
|
|
3
|
+
Version: 0.6.2
|
|
4
|
+
Summary: okforge: a local-first LLM knowledge-base engine
|
|
5
|
+
Project-URL: Repository, https://github.com/okforge/okforge
|
|
6
|
+
Project-URL: Homepage, https://github.com/okforge/okforge
|
|
7
|
+
Project-URL: Issues, https://github.com/okforge/okforge/issues
|
|
8
|
+
Author: designcomputer
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,ai,document,knowledge-base,llm,pageindex,rag,retrieval
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: click==8.4.0
|
|
23
|
+
Requires-Dist: json-repair==0.59.10
|
|
24
|
+
Requires-Dist: litellm==1.87.2
|
|
25
|
+
Requires-Dist: openai-agents==0.17.3
|
|
26
|
+
Requires-Dist: pageindex==0.3.0.dev1
|
|
27
|
+
Requires-Dist: portalocker==3.2.0
|
|
28
|
+
Requires-Dist: prompt-toolkit==3.0.52
|
|
29
|
+
Requires-Dist: python-dotenv==1.2.2
|
|
30
|
+
Requires-Dist: pyyaml==6.0.3
|
|
31
|
+
Requires-Dist: rich==15.0.0
|
|
32
|
+
Requires-Dist: trafilatura==2.0.0
|
|
33
|
+
Requires-Dist: watchdog==6.0.0
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: mypy==1.15.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest-asyncio==1.3.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest==9.0.3; extra == 'dev'
|
|
38
|
+
Requires-Dist: ruff==0.9.7; extra == 'dev'
|
|
39
|
+
Requires-Dist: types-pyyaml==6.0.12.20260518; extra == 'dev'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# okforge
|
|
43
|
+
|
|
44
|
+
A local-first LLM knowledge-base engine. Point it at your documents;
|
|
45
|
+
it builds an interlinked wiki — per-document summaries, cross-document
|
|
46
|
+
concept and entity pages, extracted images, and real page citations
|
|
47
|
+
back to source. The wiki is plain Markdown with YAML frontmatter,
|
|
48
|
+
readable in Obsidian or any editor, and queryable from a CLI, a chat
|
|
49
|
+
REPL, or any MCP client.
|
|
50
|
+
|
|
51
|
+
## Why
|
|
52
|
+
|
|
53
|
+
Most retrieval setups hand an LLM a pile of raw chunks and hope. okforge
|
|
54
|
+
instead compiles your sources into curated pages *ahead of time* —
|
|
55
|
+
concepts and entities that already synthesize what's spread across
|
|
56
|
+
many documents, each claim traceable back to a `(p. N)` citation in
|
|
57
|
+
the original source. That matters most for models with limited
|
|
58
|
+
context, including small models running entirely on your own hardware:
|
|
59
|
+
they don't have to reconstruct an answer from scratch every query, and
|
|
60
|
+
what they do say is checkable against a specific page, not just
|
|
61
|
+
plausible-sounding.
|
|
62
|
+
|
|
63
|
+
The output follows the [Open Knowledge Format (OKF)](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) —
|
|
64
|
+
typed frontmatter, relative links, a predictable directory layout — so
|
|
65
|
+
the wiki a KB produces is portable, not locked to okforge itself.
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install git+https://github.com/okforge/okforge@main
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mkdir my-kb && cd my-kb
|
|
77
|
+
okforge init # scaffold raw/, wiki/, .openkb/ (--json for scripts)
|
|
78
|
+
okforge add paper.md # ingest (pre-convert non-md/pdf inputs first)
|
|
79
|
+
okforge query "What does the paper conclude?"
|
|
80
|
+
okforge chat # interactive REPL over the wiki
|
|
81
|
+
okforge list --json # machine-readable state (also: status, okf-lint)
|
|
82
|
+
okforge describe "One line about this project." # curated description
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Non-Markdown, non-PDF inputs (docx, pptx, scans, photo catalogs, …)
|
|
86
|
+
need converting to Markdown first, by a tool that understands your
|
|
87
|
+
material — a page-aware OCR script, for example. A sibling
|
|
88
|
+
`<doc>.pages.json` page array is what enables real `(p. N)` citations
|
|
89
|
+
in the generated summaries.
|
|
90
|
+
|
|
91
|
+
The query agent reads curated pages first, then drills for detail with
|
|
92
|
+
a built-in `grep_wiki` lexical search (locate-then-read) rather than
|
|
93
|
+
re-embedding everything. `okf-lint` checks a wiki bundle's OKF
|
|
94
|
+
conformance.
|
|
95
|
+
|
|
96
|
+
Configuration lives in `.openkb/config.yaml` (model, language, entity
|
|
97
|
+
types, …) and `~/.config/openkb/global.yaml` (KB registry, default
|
|
98
|
+
KB). The LLM endpoint is configured litellm-style — any
|
|
99
|
+
OpenAI-compatible server works, including a local llama.cpp instance.
|
|
100
|
+
|
|
101
|
+
### Topic tree (experimental, per-KB opt-in)
|
|
102
|
+
|
|
103
|
+
For knowledge bases that outgrow a flat concept list: set
|
|
104
|
+
`topic_tree: true` in `.openkb/config.yaml`, then run `okforge
|
|
105
|
+
reindex`. Existing concepts cluster into named `concepts/<topic>/`
|
|
106
|
+
directories, each with a `_topic.md` summary node; later ingests place
|
|
107
|
+
new concepts by tree descent, and queries gain a `read_topic`
|
|
108
|
+
navigation tool for browsing top-down instead of scanning a flat list.
|
|
109
|
+
|
|
110
|
+
## Wiki layout
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
wiki/
|
|
114
|
+
index.md # document + concept index
|
|
115
|
+
summaries/<doc>.md # per-document summary (page citations when available)
|
|
116
|
+
concepts/<name>.md # cross-document concept pages
|
|
117
|
+
entities/<name>.md # named people/places/organizations/works
|
|
118
|
+
sources/<doc>.md # ingested source text
|
|
119
|
+
sources/<doc>.json # per-page text + images (when page-aware)
|
|
120
|
+
sources/images/<doc>/ # extracted images
|
|
121
|
+
log.md # append-only ingest log
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Development
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
uv run --extra dev python -m pytest tests/ # test suite
|
|
128
|
+
uv run --extra dev ruff check openkb tests # lint
|
|
129
|
+
uv run --extra dev ruff format openkb tests # format
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Origins
|
|
133
|
+
|
|
134
|
+
okforge began as a hard fork of [VectifyAI/OpenKB](https://github.com/VectifyAI/OpenKB),
|
|
135
|
+
in the spirit of Karpathy's LLM-wiki idea, and has since diverged
|
|
136
|
+
deliberately rather than tracking it — local-only by default, its own
|
|
137
|
+
document-conversion boundary, and OKF conformance as a first-class
|
|
138
|
+
goal rather than an incidental format.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
Apache-2.0. Portions originate from the upstream OpenKB project
|
|
143
|
+
(copyright the original authors); okforge-specific changes are
|
|
144
|
+
maintained at [okforge/okforge](https://github.com/okforge/okforge).
|
okforge-0.6.2/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# okforge
|
|
2
|
+
|
|
3
|
+
A local-first LLM knowledge-base engine. Point it at your documents;
|
|
4
|
+
it builds an interlinked wiki — per-document summaries, cross-document
|
|
5
|
+
concept and entity pages, extracted images, and real page citations
|
|
6
|
+
back to source. The wiki is plain Markdown with YAML frontmatter,
|
|
7
|
+
readable in Obsidian or any editor, and queryable from a CLI, a chat
|
|
8
|
+
REPL, or any MCP client.
|
|
9
|
+
|
|
10
|
+
## Why
|
|
11
|
+
|
|
12
|
+
Most retrieval setups hand an LLM a pile of raw chunks and hope. okforge
|
|
13
|
+
instead compiles your sources into curated pages *ahead of time* —
|
|
14
|
+
concepts and entities that already synthesize what's spread across
|
|
15
|
+
many documents, each claim traceable back to a `(p. N)` citation in
|
|
16
|
+
the original source. That matters most for models with limited
|
|
17
|
+
context, including small models running entirely on your own hardware:
|
|
18
|
+
they don't have to reconstruct an answer from scratch every query, and
|
|
19
|
+
what they do say is checkable against a specific page, not just
|
|
20
|
+
plausible-sounding.
|
|
21
|
+
|
|
22
|
+
The output follows the [Open Knowledge Format (OKF)](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) —
|
|
23
|
+
typed frontmatter, relative links, a predictable directory layout — so
|
|
24
|
+
the wiki a KB produces is portable, not locked to okforge itself.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install git+https://github.com/okforge/okforge@main
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
mkdir my-kb && cd my-kb
|
|
36
|
+
okforge init # scaffold raw/, wiki/, .openkb/ (--json for scripts)
|
|
37
|
+
okforge add paper.md # ingest (pre-convert non-md/pdf inputs first)
|
|
38
|
+
okforge query "What does the paper conclude?"
|
|
39
|
+
okforge chat # interactive REPL over the wiki
|
|
40
|
+
okforge list --json # machine-readable state (also: status, okf-lint)
|
|
41
|
+
okforge describe "One line about this project." # curated description
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Non-Markdown, non-PDF inputs (docx, pptx, scans, photo catalogs, …)
|
|
45
|
+
need converting to Markdown first, by a tool that understands your
|
|
46
|
+
material — a page-aware OCR script, for example. A sibling
|
|
47
|
+
`<doc>.pages.json` page array is what enables real `(p. N)` citations
|
|
48
|
+
in the generated summaries.
|
|
49
|
+
|
|
50
|
+
The query agent reads curated pages first, then drills for detail with
|
|
51
|
+
a built-in `grep_wiki` lexical search (locate-then-read) rather than
|
|
52
|
+
re-embedding everything. `okf-lint` checks a wiki bundle's OKF
|
|
53
|
+
conformance.
|
|
54
|
+
|
|
55
|
+
Configuration lives in `.openkb/config.yaml` (model, language, entity
|
|
56
|
+
types, …) and `~/.config/openkb/global.yaml` (KB registry, default
|
|
57
|
+
KB). The LLM endpoint is configured litellm-style — any
|
|
58
|
+
OpenAI-compatible server works, including a local llama.cpp instance.
|
|
59
|
+
|
|
60
|
+
### Topic tree (experimental, per-KB opt-in)
|
|
61
|
+
|
|
62
|
+
For knowledge bases that outgrow a flat concept list: set
|
|
63
|
+
`topic_tree: true` in `.openkb/config.yaml`, then run `okforge
|
|
64
|
+
reindex`. Existing concepts cluster into named `concepts/<topic>/`
|
|
65
|
+
directories, each with a `_topic.md` summary node; later ingests place
|
|
66
|
+
new concepts by tree descent, and queries gain a `read_topic`
|
|
67
|
+
navigation tool for browsing top-down instead of scanning a flat list.
|
|
68
|
+
|
|
69
|
+
## Wiki layout
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
wiki/
|
|
73
|
+
index.md # document + concept index
|
|
74
|
+
summaries/<doc>.md # per-document summary (page citations when available)
|
|
75
|
+
concepts/<name>.md # cross-document concept pages
|
|
76
|
+
entities/<name>.md # named people/places/organizations/works
|
|
77
|
+
sources/<doc>.md # ingested source text
|
|
78
|
+
sources/<doc>.json # per-page text + images (when page-aware)
|
|
79
|
+
sources/images/<doc>/ # extracted images
|
|
80
|
+
log.md # append-only ingest log
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uv run --extra dev python -m pytest tests/ # test suite
|
|
87
|
+
uv run --extra dev ruff check openkb tests # lint
|
|
88
|
+
uv run --extra dev ruff format openkb tests # format
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Origins
|
|
92
|
+
|
|
93
|
+
okforge began as a hard fork of [VectifyAI/OpenKB](https://github.com/VectifyAI/OpenKB),
|
|
94
|
+
in the spirit of Karpathy's LLM-wiki idea, and has since diverged
|
|
95
|
+
deliberately rather than tracking it — local-only by default, its own
|
|
96
|
+
document-conversion boundary, and OKF conformance as a first-class
|
|
97
|
+
goal rather than an incidental format.
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
Apache-2.0. Portions originate from the upstream OpenKB project
|
|
102
|
+
(copyright the original authors); okforge-specific changes are
|
|
103
|
+
maintained at [okforge/okforge](https://github.com/okforge/okforge).
|
|
Binary file
|