{"_id":"@awfixerai/mnemopi","name":"@awfixerai/mnemopi","dist-tags":{"latest":"0.0.1-rc.1"},"versions":{"0.0.1-rc.1":{"type":"module","name":"@awfixerai/mnemopi","version":"0.0.1-rc.1","description":"Local SQLite memory engine for Oh My Pi agents","homepage":"https://agent.awfixer.codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/awfixers-stuff/awfixer-agent.git","directory":"packages/mnemopi"},"bugs":{"url":"https://github.com/awfixers-stuff/awfixer-agent/issues"},"keywords":["memory","sqlite","agent","embeddings","mcp"],"main":"./src/index.ts","module":"./src/index.ts","types":"./src/index.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":{"@awfixerai/ai":"0.0.1-rc.1","@awfixerai/catalog":"0.0.1-rc.1","@awfixerai/utils":"0.0.1-rc.1","lru-cache":"11.5.1"},"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":"./src/index.ts","import":"./src/index.ts"},"./core":{"types":"./src/core/index.ts","import":"./src/core/index.ts"},"./core/beam":{"types":"./src/core/beam/index.ts","import":"./src/core/beam/index.ts"},"./beam":{"types":"./src/core/beam/index.ts","import":"./src/core/beam/index.ts"},"./diagnose":{"types":"./src/diagnose.ts","import":"./src/diagnose.ts"},"./mcp":{"types":"./src/mcp-tools.ts","import":"./src/mcp-tools.ts"},"./cli":{"types":"./src/cli.ts","import":"./src/cli.ts"},"./*":{"types":"./src/*.ts","import":"./src/*.ts"},"./*.js":"./src/*.ts"},"_id":"@awfixerai/mnemopi@0.0.1-rc.1","_integrity":"sha512-n+ht8z2/hGk+wJ4EXV4w/Crr0O/9frEppUvjhHFHXberka2lPpXD7lx1JqGOehjrG3xz5NeanH0UJsV9NXemJg==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"5cc569ef29ac52f7be8d400101436b6a4896f731","dist":{"integrity":"sha512-n+ht8z2/hGk+wJ4EXV4w/Crr0O/9frEppUvjhHFHXberka2lPpXD7lx1JqGOehjrG3xz5NeanH0UJsV9NXemJg==","shasum":"5cc569ef29ac52f7be8d400101436b6a4896f731","tarball":"https://registry.npmjs.org/@awfixerai/mnemopi/-/mnemopi-0.0.1-rc.1.tgz","fileCount":69,"unpackedSize":629146,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDVWWRYAcCJMwKEqm30IMbFvLTSa4SiW2+aKbNj3oCHxgIgCor0NV68aEv2qLbHDwto5HeqKzni7rngLB8m0kDoUps="}]},"_npmUser":{"name":"awfixer","email":"wise.jet2897@fastmail.com"},"directories":{},"maintainers":[{"name":"awfixer","email":"wise.jet2897@fastmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mnemopi_0.0.1-rc.1_1783014980751_0.26552684431597307"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-02T17:56:20.582Z","0.0.1-rc.1":"2026-07-02T17:56:20.964Z","modified":"2026-07-02T17:56:21.298Z"},"maintainers":[{"name":"awfixer","email":"wise.jet2897@fastmail.com"}],"description":"Local SQLite memory engine for Oh My Pi agents","homepage":"https://agent.awfixer.codes","keywords":["memory","sqlite","agent","embeddings","mcp"],"repository":{"type":"git","url":"git+https://github.com/awfixers-stuff/awfixer-agent.git","directory":"packages/mnemopi"},"bugs":{"url":"https://github.com/awfixers-stuff/awfixer-agent/issues"},"license":"MIT","readme":"# @awfixerai/mnemopi\n\nLocal SQLite memory engine for Oh My Pi 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 \"@awfixerai/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 \"@awfixerai/mnemopi\";\nimport type { Model } from \"@awfixerai/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 Oh My Pi 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_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-8f7ad90172ddf3a7d460840342125de0"}