Repository navigation
Releases: IvenKooLab/loci
Release list
v0.6.3
v0.6.3
Bug fix — first external contribution (by @hulinming) 🎉
- Fixed
TypeErroron everyloci askcall with--rewrite: the CLI passedrewrite=butcmd_askdid not accept the parameter (regression since v0.5.0). Merged via PR #1 with a regression test.
Install: pip install loci-rag==0.6.3
Full changelog: see CHANGELOG.md
v0.6.2 — integration hardening (found by loci-dsh)
v0.6.2 — integration-hardening release
Fixes found by the first downstream integration (loci-dsh, a visual plugin for DeepSeek Harness):
serve-http,sync,benchCLI subcommands are now actually registered (dispatch existed but the argument parser entries were missing)- HTTP API robustness: handler exceptions return 500 JSON instead of dropping the connection (an empty query used to kill it), malformed bodies return 400, empty queries short-circuit with a hint
--host/--portdefault from the[http]config section as documented
Read the new Ecosystem section in the README for the loci-dsh integration story.
v0.6.1 — the knowledge-graph release
v0.6.1 — the knowledge-graph release
Four features landed in parallel branches and merged into one release.
Highlights
- Knowledge graph —
loci graph buildextracts entity-relation triples from your memories and wiki pages into a single human-readablegraph.json(no graph database, hand-editable). Every edge cites its source file. Query withloci graph show ENTITYor the newbrain_graphMCP tool (omit the entity to list hub entities). Wiki generation injects related graph relations as extra context. - OCR (
[ocr]extra, rapidocr) — image files are recognized and indexed; scanned PDFs (near-empty text layer) automatically fall back to per-page OCR.loci doctorreports availability. - HTML loader (stdlib, zero deps) — headings, lists,
<meta charset>with a gb18030 fallback for legacy Chinese exports. - org-mode loader (stdlib, zero deps) —
#+TITLEbecomes the h1,#+FILETAGSbecome frontmatter tags, org links become markdown links.
MCP tool count: 9 (brain_graph joins). 173 offline tests, CI on 3.11–3.13.
Install
pip install "loci-rag[pdf,docx,ocr]"Full changelog: CHANGELOG.md
v0.5.0 — the self-improving release
v0.5.0 — the self-improving release
Query understanding, memory automation, and efficiency across the board.
Highlights
- Query rewriting —
loci ask --rewritegenerates keyword and cross-language variants of your query, retrieves per variant, and RRF-fuses the results. A Chinese query can now surface the English doc it used to miss. - Auto memory extraction —
loci chatnow distills durable facts from each exchange into memory notes automatically (mem0 pattern, max 3 per exchange, fail-open). Your agent remembers without being asked. - Chunk-level incremental indexing — only changed chunks are re-embedded; unchanged vectors are reused via content fingerprints. Editing one paragraph no longer re-embeds the whole file.
- Feedback loop —
loci feedback good|badrates the chunks behind the last answer; bad-rated chunks sink in future retrieval. - HTTP REST API —
loci serve-httpexposes search / ask / remember / stats over JSON with Bearer auth, for non-MCP tools (shortcuts, automations, home servers). - Git memory sync —
loci sync push|pullversion-controls the memories/ and wiki/ directories for cross-machine memory sharing. No cloud, no accounts. - Wiki topic suggestions —
loci wiki --suggestrecommends topics that have enough indexed material but no wiki page yet. loci bench— built-in retrieval benchmark (hit@k, vector-only vs hybrid) over your own labeled queries.
Fixes
- Python 3.11 compatibility (f-string syntax from PEP 701 was 3.12-only)
- Feedback penalties are now actually applied in retrieval (dead-code bug caught by tests)
- Config warnings go to stderr — MCP stdio streams stay clean
Install
pip install "loci-rag[pdf,docx]"Full changelog: CHANGELOG.md
v0.2.0 — the memory layer release
The "memory layer" release
loci turns scattered notes, project docs, and chat logs into a queryable second brain — local index, hybrid retrieval, cited answers, and an MCP server so your AI agents can use it. The core is ~300 lines of plain Python: no LangChain, no Docker, no daemons.
Highlights
- Hybrid retrieval by default — native BM25 (CJK-aware) fused with vector search via Reciprocal Rank Fusion. Measured on a bilingual corpus: 9/10 → 10/10 hit@5 vs vector-only.
- MCP server, zero extra dependencies —
brain_search/brain_ask/brain_links/brain_stats/brain_ingestover stdio; plus resources (brain://note/…,brain://stats) and three prompts (brain-briefing / study-plan / contradiction-check). - Fully offline verified — point both endpoints at a local Ollama and the whole pipeline runs with zero cloud calls.
- Section-level citations — every answer and hit carries
file > headingbreadcrumbs; optionalask --verifyaudits the answer claim-by-claim against the sources (✓ / ~ / ✗). - Reranking, two providers — LLM pointwise scoring, or a local cross-encoder (
BAAI/bge-reranker-base, ~30–70 ms for 5 pairs on GPU) via an optional extra. - Obsidian-native details — frontmatter tags (
--tag),[[wikilink]]graph (links), fenced code blocks never split, one-line notes stay searchable. - Office & PDF — PyMuPDF4LLM extracts PDFs as markdown with tables as pipe rows;
.docxparagraphs and tables via an optional extra. - Chat-log loader — ChatGPT / Claude
conversations.jsonexports become one searchable document per conversation. - Per-directory chunk config —
[[sources]]entries overridechunk_size/chunk_overlap. - Quality signals — 115 offline tests (no API keys needed), GitHub Actions CI (3.11–3.13 + packaging smoke), built-in retrieval eval harness,
stats/doctor/watch/chatcommands.
Quick start
pip install -e ".[pdf,docx]"
cp config.example.toml config.toml # add your API key + source dirs
second-brain ingest
second-brain ask "what did I write about X?"Full notes in CHANGELOG.md. MIT licensed.