package
Three-tier memory architecture for OpenCode — distillation, not summarization
npm install opencode-loreGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Experimental — Under active development. APIs, storage format, and behavior may change.
Three-tier memory architecture for OpenCode — distillation, not summarization.
An implementation of Sanity's Nuum memory architecture and Mastra's Observational Memory system as an OpenCode plugin. Preserves operational intelligence (file paths, error messages, exact decisions) rather than narrative summaries that lose the details agents need to keep working.
Add to your project's opencode.json:
{
"plugin": [
"@loreai/opencode"
]
}Restart OpenCode and the plugin will be installed automatically.
This package is also published as
opencode-lore(legacy alias). Both names ship identical code at every release — either works.
Recall uses @huggingface/transformers with nomic-embed-text-v1.5 (768-dim INT8 quantized, ~137 MB) for on-device vector search by default — no API key required. The model is downloaded on first use and cached locally.
When installed via npm, local embeddings use the native onnxruntime-node backend, which may fail on some configurations (e.g. CUDA 13 on Linux/x64 — microsoft/onnxruntime#26586). When local embeddings aren't available, recall has graceful fallbacks:
VOYAGE_API_KEY or OPENAI_API_KEY — recall transparently switches to that provider on the first call. Zero config.search.embeddings.provider to "voyage" / "openai" in .lore.json to skip the local probe entirely.If none of the above are set and local embeddings aren't available, recall falls back to FTS-only search.
If you use a local LLM server (vllm, llama.cpp, ollama, etc.), set an environment variable so Lore's gateway knows where to forward requests:
export LORE_UPSTREAM_VLLM=http://localhost:8000
# or
export LORE_UPSTREAM_OLLAMA=http://localhost:11434The URL should be the server root — do not include /v1 (the gateway appends API paths automatically). The naming convention is LORE_UPSTREAM_<PROVIDER> where <PROVIDER> is the uppercased provider name with hyphens replaced by underscores:
| Provider | Env var |
|---|---|
vllm | LORE_UPSTREAM_VLLM |
llamacpp | LORE_UPSTREAM_LLAMACPP |
ollama | LORE_UPSTREAM_OLLAMA |
lmstudio | LORE_UPSTREAM_LMSTUDIO |
tgi | LORE_UPSTREAM_TGI |
litellm | LORE_UPSTREAM_LITELLM |
Cloud providers (Anthropic, OpenAI, etc.) are routed automatically by model name and don't need this.
Lore ships as three packages sharing the same SQLite database at ~/.local/share/lore/lore.db:
@loreai/opencode (you are here) — OpenCode plugin@loreai/pi — Pi coding-agent extension@loreai/core — shared memory engineSwitching between OpenCode and Pi on the same project preserves the curated knowledge, distillations, and AGENTS.md sync.
Full architecture, benchmarks, configuration, and rationale: github.com/BYK/loreai
FSL-1.1-Apache-2.0 — see LICENSE.
Estimated unpacked size across 57 packages.
70.1 MB
Includes dependencies.