{"_id":"@cyberxninja-omp/pi-mnemopi","name":"@cyberxninja-omp/pi-mnemopi","dist-tags":{"latest":"17.5.3"},"versions":{"17.5.3":{"type":"module","name":"@cyberxninja-omp/pi-mnemopi","version":"17.5.3","description":"Local SQLite memory engine for omp agents","homepage":"https://omp.sh","author":{"name":"Can Boluk"},"contributors":[{"name":"Abdias J"}],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/can1357/oh-my-pi.git","directory":"packages/mnemopi"},"bugs":{"url":"https://github.com/can1357/oh-my-pi/issues"},"keywords":["memory","sqlite","agent","embeddings","mcp"],"main":"./src/index.ts","module":"./src/index.ts","types":"./dist/types/index.d.ts","bin":{"mnemopi":"src/cli.ts"},"scripts":{"check":"biome check . && bun run check:types","check:types":"tsgo -p tsconfig.json --noEmit","lint":"biome lint .","test":"bun test --parallel","fix":"biome check --write --unsafe .","fmt":"biome format --write ."},"dependencies":{"@cyberxninja-omp/pi-ai":"17.5.3","@cyberxninja-omp/pi-catalog":"17.5.3","@cyberxninja-omp/pi-natives":"17.5.3","@cyberxninja-omp/pi-utils":"17.5.3"},"peerDependencies":{"fastembed":"2.1.0","onnxruntime-node":"1.21.0"},"peerDependenciesMeta":{"fastembed":{"optional":true},"onnxruntime-node":{"optional":true}},"devDependencies":{"@types/bun":"^1.3.14","fastembed":"2.1.0","onnxruntime-node":"1.26.0"},"engines":{"bun":">=1.3.14"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./src/index.ts"},"./core":{"types":"./dist/types/core/index.d.ts","import":"./src/core/index.ts"},"./core/beam":{"types":"./dist/types/core/beam/index.d.ts","import":"./src/core/beam/index.ts"},"./beam":{"types":"./dist/types/core/beam/index.d.ts","import":"./src/core/beam/index.ts"},"./diagnose":{"types":"./dist/types/diagnose.d.ts","import":"./src/diagnose.ts"},"./mcp":{"types":"./dist/types/mcp-tools.d.ts","import":"./src/mcp-tools.ts"},"./cli":{"types":"./dist/types/cli.d.ts","import":"./src/cli.ts"},"./*":{"types":"./dist/types/*.d.ts","import":"./src/*.ts"},"./*.js":"./src/*.ts"},"_id":"@cyberxninja-omp/pi-mnemopi@17.5.3","_integrity":"sha512-Wte4HtrpW1Anb+LmaZJmcgCpOsyJQJH6MUDApFfd+wSwimsAJ2b6sQd4NfBpUMIqmsJtMCw5VvFG778P4yp/kA==","_resolved":"/tmp/cxn-pack-tLv7wM/cyberxninja-omp-pi-mnemopi-17.5.3.tgz","_from":"file:/tmp/cxn-pack-tLv7wM/cyberxninja-omp-pi-mnemopi-17.5.3.tgz","_nodeVersion":"24.3.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-Wte4HtrpW1Anb+LmaZJmcgCpOsyJQJH6MUDApFfd+wSwimsAJ2b6sQd4NfBpUMIqmsJtMCw5VvFG778P4yp/kA==","shasum":"15cf1d6f800798f52b58d057880fceba306b39d5","tarball":"https://registry.npmjs.org/@cyberxninja-omp/pi-mnemopi/-/pi-mnemopi-17.5.3.tgz","fileCount":135,"unpackedSize":812949,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBIaNUynLHPgQRYCy/0OIbLDJ94frCUezvhrIMLw8jhfAiEAmnkjW3cfObyWh4dcBEhsy0SWdF3NaR0uxF30pbI/A1w="}]},"_npmUser":{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"},"directories":{},"maintainers":[{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-mnemopi_17.5.3_1787233046820_0.3377612838367434"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T13:37:26.653Z","17.5.3":"2026-08-20T13:37:26.989Z","modified":"2026-08-20T13:37:27.179Z"},"maintainers":[{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"}],"description":"Local SQLite memory engine for omp agents","homepage":"https://omp.sh","keywords":["memory","sqlite","agent","embeddings","mcp"],"repository":{"type":"git","url":"git+https://github.com/can1357/oh-my-pi.git","directory":"packages/mnemopi"},"contributors":[{"name":"Abdias J"}],"author":{"name":"Can Boluk"},"bugs":{"url":"https://github.com/can1357/oh-my-pi/issues"},"license":"MIT","readme":"# @cyberxninja-omp/pi-mnemopi\n\nLocal SQLite memory engine for omp agents.\n\nThis package is the Bun/TypeScript port of the Mnemosyne memory engine. It provides:\n\n- `Mnemopi`, a small facade for remember/recall/stats/sleep workflows.\n- `BeamMemory`, the lower-level working/episodic memory engine.\n- MCP tool definitions and a dispatcher for host integrations.\n- Optional local ONNX embeddings through `fastembed` and optional OpenAI-compatible embedding/LLM endpoints.\n\nThe package does not bundle or download a local GGUF LLM. LLM paths are host-backend or OpenAI-compatible remote only; when no LLM is configured, deterministic heuristic paths are used.\n\n## Basic use\n\n```ts\nimport { Mnemopi } from \"@cyberxninja-omp/pi-mnemopi\";\n\nconst memory = new Mnemopi({ dbPath: \"./mnemopi.db\", bank: \"project\" });\nconst id = memory.remember(\"The deployment target is stable-cluster.\", {\n\tsource: \"notes\",\n\timportance: 0.8,\n\tveracity: \"true\",\n});\n\nconst results = memory.recall(\"deployment target\", 5);\nconsole.log(id, results[0]?.content);\n\nmemory.close();\n```\n\n## Configuration\n\n`Mnemopi` accepts LLM and embedding options directly. `MNEMOPI_*` environment variables remain fallbacks/defaults when the matching constructor option is omitted.\n\n```ts\nimport { Mnemopi } from \"@cyberxninja-omp/pi-mnemopi\";\nimport type { Model } from \"@cyberxninja-omp/pi-ai\";\n\nconst ftsOnly = new Mnemopi({ noEmbeddings: true });\n\nconst remoteEmbeddings = new Mnemopi({\n\tembeddingModel: \"text-embedding-3-small\",\n\tembeddingApiUrl: \"https://api.openai.com/v1\",\n\tembeddingApiKey: process.env.OPENAI_API_KEY,\n});\n\nconst remoteLlm = new Mnemopi({\n\tllm: {\n\t\tbaseUrl: \"https://api.openai.com/v1\",\n\t\tapiKey: process.env.OPENAI_API_KEY,\n\t\tmodel: \"gpt-4.1-mini\",\n\t},\n\t// Equivalent aliases: llmBaseUrl, llmApiKey, llmModel.\n});\n\ndeclare const smolModel: Model;\nconst piAiLlm = new Mnemopi({ llm: smolModel });\nconst dynamicLlm = new Mnemopi({\n\tllm: async (prompt, opts) => {\n\t\tconst token = await getFreshOauthToken();\n\t\treturn await completeWithPiAi(prompt, {\n\t\t\ttoken,\n\t\t\tmaxTokens: opts?.maxTokens,\n\t\t\ttemperature: opts?.temperature,\n\t\t});\n\t},\n});\n```\n\n### Banks and host scoping\n\n`Mnemopi` itself exposes banks directly through constructor options such as `bank`; it does not hard-code coding-agent project scoping.\n\nThe omp coding-agent wrapper adds `mnemopi.scoping` on top of those constructor options:\n\n- `global`: one shared bank\n- `per-project`: isolated project memory\n- `per-project-tagged`: project-local writes plus global recall visibility\n\nIn `per-project-tagged`, the wrapper is responsible for combining project-local retention with global recall visibility. The package still just exposes banks plus constructor-level LLM and embedding options.\n\nCommon environment fallbacks:\n\n- `MNEMOPI_DATA_DIR` / `MNEMOPI_DB_PATH`: default storage location.\n- `MNEMOPI_DB_PAGE_SIZE`: optional SQLite page size for new file-backed databases; use a valid power of two from 512 to 65536 or `os` to request the detected system page size. Unset preserves SQLite's default.\n- `MNEMOPI_NO_EMBEDDINGS=1`: force FTS-only recall.\n- `MNEMOPI_EMBEDDING_MODEL`: defaults to `BAAI/bge-small-en-v1.5`.\n- `MNEMOPI_EMBEDDING_API_URL` and `MNEMOPI_EMBEDDING_API_KEY`: OpenAI-compatible embedding endpoint.\n- `MNEMOPI_LLM_ENABLED=1`, `MNEMOPI_LLM_BASE_URL`, `MNEMOPI_LLM_API_KEY`, `MNEMOPI_LLM_MODEL`: OpenAI-compatible LLM endpoint.\n\nLocal embeddings use the `fastembed` npm package. Its default `BGESmallENV15` model is 384-dimensional and uses the package's CLS pooling plus vector normalization path. Local GGUF LLMs are not available in this package.\n\n## Commands\n\n```sh\nmnemopi remember \"Use stable-cluster for production deploys\"\nmnemopi recall \"production deploy target\"\nmnemopi stats\nmnemopi sleep\n```\n\n## Tests\n\n```sh\nbun --cwd packages/mnemopi test\nbun --cwd packages/mnemopi run check\n```\n","readmeFilename":"README.md","_rev":"1-11e0defe71bf4388c16ae23e4c5366a3"}