Repository navigation
Slim dependencies (drop torch/chroma/LLM), simplify CI, fix Docker - #28
Merged
Merged
Conversation
Dependencies - Bump all dependency floors to current releases (numpy/networkx capped at their last Python 3.11-compatible versions). - Replace sentence-transformers/torch with an ONNX Runtime embedder that loads the ONNX export shipped by sentence-transformers model repos and reproduces pooling/normalization from the repo's own config. Vectors match sentence-transformers to cosine 1.000000, so existing graph.db embeddings stay valid. Also fixes the default jina model, whose torch path no longer imports under transformers 5. - Remove the chroma vector store; the in-memory numpy store (rebuilt from graph.db on startup) is the only backend. Fix its quadratic upsert (100k vectors: ~15 min -> 1.3 s) and vectorize metadata filtering. - Remove the `mimir ask` command and all LLM code (litellm client, port, [llm] config). Summarization has been heuristic-only for a while. - Drop unused deps: mcp, pydantic-settings, tiktoken, direct tree-sitter, tomli (stdlib tomllib), and the unused `lsp` extra. - Switch to SPDX license metadata (table form stops building 2027-02-18). CI / release - ci.yml: only tests (3.11-3.13) and build verification (build + twine check) on PRs and pushes to main/develop. Guardrail job removed. - publish.yml: still tag-triggered; now gated on tests, runs twine check, and creates the GitHub Release only after both PyPI publishes succeed. - Bump actions to current majors. Docker - Fix image build (setuptools-scm had no git metadata; README missing). - Python 3.13 base, no compiler toolchain, deps and model layers cached ahead of source code, .dockerignore added. Cold build ~40 min -> 63 s, image 3.24 GB -> 1.53 GB.
- docker-entrypoint.sh still called the removed `mimir index` / `mimir serve` commands, so the container exited on start. Use `mimir indexer run` and `mimir query serve`. - Update CLAUDE.md and the web inspector docs to the new CLI commands. - tests: give the mocked aiohttp request a Mock protocol; aiohttp 3.14 calls resume_reading() on it, which broke 4 tests (also failing on develop with current aiohttp).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gets the repo installable, testable and buildable again, and cuts the dependency footprint substantially.
pip-auditDependencies
huggingface-hubstays on 1.x because currenttokenizersrequires<2.0.LocalEmbeddernow loads theonnx/model.onnxexport that sentence-transformers model repos ship, and reproduces pooling and normalization from the repo's ownmodules.json/1_Pooling/config.json. The vectors match sentence-transformers to cosine 1.000000 (max element diff ~1e-7), so existinggraph.dbembeddings stay valid. This also fixes the defaultjina-embeddings-v2-base-codemodel, whose torch path no longer imports under transformers 5.graph.dbon startup, is now the only backend. I also fixed its quadratic upsert (100k vectors: ~15 min → 1.3 s) and vectorized metadata filtering (search over 100k vectors takes ~4 ms). Configs that still contain[vector_db]keep loading; the section is ignored.LlmClientport and the[llm]config. Summarization is heuristic-only.mcp(the MCP server hand-rolls JSON-RPC),pydantic-settings,tiktoken, directtree-sitter,tomli(stdlibtomllib), and the unusedlspextra.CI / release
ci.yml: only tests (Python 3.11/3.12/3.13) and build verification (python -m buildfor both packages +twine check --strict), on PRs and on pushes tomain/develop. The guardrail job is removed.publish.yml: still triggered byv*tags only. It now runs tests first, runstwine check, and creates the GitHub Release only after both PyPI publishes succeed.Docker
README.mdwasn't copied. The version now comes from--build-arg MIMIR_VERSION=....mimir index/mimir servecommands, so the container exited on start. It now usesmimir indexer run/mimir query serve..dockerignore. A code-only rebuild takes seconds.Also fixed
test_runtime_publish_query.pyfailed ondevelopwith current aiohttp (3.14 callsresume_reading()on the mocked protocol).Testing
pytest: 255 passed (fresh venv, Python 3.13).indexer run,query status/search, the MCP stdio server (initialize, tools/list, tools/call) and the HTTP API.automode the container indexes, publishes a version and serves/api/v1/health. It embeds with--network noneusing the pre-baked model.twine check --strict.Tradeoff
On macOS, full indexing is ~2x slower than torch (this repo: ~99 s), because torch used Apple's Accelerate math libraries. On Linux/Docker, ONNX is slightly faster than torch CPU. Incremental indexing only re-embeds changed code.
Follow-ups (not in this PR)
docs/how-it-works.mdstill referencesmimir quality, which develop's CLI no longer has..mimir/project/graph.db-shm/-walare tracked in git, and.mimir/indexes/isn't ignored. The committedgraph.dbalso predates develop's versioned index layout, so it's worth deciding how that file should be refreshed.