mnemex 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # mnemex
2
+
3
+ **Memory Extension for AI Agents** - Intelligent context optimization via semantic retrieval.
4
+
5
+ An MCP server that dramatically reduces Claude Code's context window usage by returning relevant code chunks instead of whole files.
6
+
7
+ ## Features
8
+
9
+ - **90%+ Context Reduction** - Returns only relevant code chunks, not entire files
10
+ - **Semantic Search** - Understands code meaning, not just keywords
11
+ - **Auto-indexing** - Indexes your codebase automatically on first search
12
+ - **Real Embeddings** - Uses all-MiniLM-L6-v2 model for high-quality vectors
13
+ - **MMR Diversity** - Maximal Marginal Relevance ensures diverse results
14
+ - **Zero Config** - Works out of the box with Claude Code
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ # Install globally
20
+ npm install -g mnemex
21
+
22
+ # Configure Claude Code integration
23
+ mnemex install
24
+
25
+ # That's it! Claude will now use mnemex_search automatically
26
+ ```
27
+
28
+ ## How It Works
29
+
30
+ 1. **Auto-indexes** your codebase on first search (or use `mnemex index ./src -r`)
31
+ 2. **Embeds** code chunks using a local ML model
32
+ 3. **Searches** semantically when Claude asks about your code
33
+ 4. **Returns** only the relevant chunks (~10) instead of whole files
34
+
35
+ ### Example
36
+
37
+ When Claude Code asks "how does authentication work?", instead of returning 5 full files (8,000+ tokens), mnemex returns just the relevant functions (~500 tokens).
38
+
39
+ ## Commands
40
+
41
+ ```bash
42
+ mnemex install # Add to Claude Code MCP config
43
+ mnemex uninstall # Remove from Claude Code
44
+ mnemex index <path> -r # Manually index a directory
45
+ mnemex stats # Show indexing statistics
46
+ mnemex doctor # Run diagnostics
47
+ ```
48
+
49
+ ## MCP Tools
50
+
51
+ When installed, Claude Code gains these tools:
52
+
53
+ - **mnemex_search** - Semantic search across all indexed code
54
+ - **mnemex_read** - Read file with intelligent chunking
55
+ - **mnemex_store** - Store memories (decisions, patterns, findings)
56
+ - **mnemex_recall** - Recall relevant memories
57
+ - **mnemex_status** - Check mnemex status
58
+
59
+ ## Requirements
60
+
61
+ - Node.js 16+
62
+ - Claude Code CLI
63
+
64
+ ## Building from Source
65
+
66
+ ```bash
67
+ git clone https://github.com/dgtise25/mnemex
68
+ cd mnemex
69
+ cargo build --release
70
+ ./target/release/mnemex install
71
+ ```
72
+
73
+ ## License
74
+
75
+ MIT
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "mnemex",
3
+ "version": "1.0.0",
4
+ "description": "Memory Extension for AI Agents - Intelligent context optimization via semantic retrieval. MCP server for Claude Code.",
5
+ "bin": {
6
+ "mnemex": "./bin/mnemex"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node scripts/postinstall.js"
10
+ },
11
+ "keywords": [
12
+ "mcp",
13
+ "claude",
14
+ "claude-code",
15
+ "ai",
16
+ "context-optimization",
17
+ "semantic-search",
18
+ "embeddings",
19
+ "rag",
20
+ "code-search",
21
+ "anthropic"
22
+ ],
23
+ "author": "lyle",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/dgtise25/mnemex"
28
+ },
29
+ "homepage": "https://github.com/dgtise25/mnemex#readme",
30
+ "bugs": {
31
+ "url": "https://github.com/dgtise25/mnemex/issues"
32
+ },
33
+ "engines": {
34
+ "node": ">=16"
35
+ },
36
+ "os": [
37
+ "darwin",
38
+ "linux",
39
+ "win32"
40
+ ],
41
+ "cpu": [
42
+ "x64",
43
+ "arm64"
44
+ ],
45
+ "optionalDependencies": {
46
+ "@dgtise/mnemex-darwin-arm64": "1.0.0",
47
+ "@dgtise/mnemex-darwin-x64": "1.0.0",
48
+ "@dgtise/mnemex-linux-x64": "1.0.0",
49
+ "@dgtise/mnemex-linux-arm64": "1.0.0",
50
+ "@dgtise/mnemex-win32-x64": "1.0.0"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
55
+ }
@@ -0,0 +1,11 @@
1
+ # @mnemex/linux-x64
2
+
3
+ Linux x64 binary for [mnemex](https://www.npmjs.com/package/mnemex).
4
+
5
+ This package is installed automatically as an optional dependency. You should not install this package directly.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g mnemex
11
+ ```
Binary file
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@dgtise/mnemex-linux-x64",
3
+ "version": "1.0.0",
4
+ "description": "Mnemex binary for Linux x64",
5
+ "os": ["linux"],
6
+ "cpu": ["x64"],
7
+ "main": "bin/mnemex",
8
+ "files": ["bin/mnemex"],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/dgtise25/mnemex"
12
+ },
13
+ "license": "MIT",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ }
17
+ }
package/publish.sh ADDED
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+ # Publish mnemex to npm
3
+ # Run this after `npm login`
4
+
5
+ set -e
6
+
7
+ cd "$(dirname "$0")"
8
+
9
+ echo "Publishing @dgtise/mnemex-linux-x64..."
10
+ cd packages/linux-x64
11
+ npm publish --access public
12
+ cd ../..
13
+
14
+ echo ""
15
+ echo "Publishing mnemex (main package)..."
16
+ npm publish --access public
17
+
18
+ echo ""
19
+ echo "Done! Published:"
20
+ echo " - @dgtise/mnemex-linux-x64@1.0.0"
21
+ echo " - mnemex@1.0.0"
22
+ echo ""
23
+ echo "Users can now install with:"
24
+ echo " npm install -g mnemex"
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const os = require('os');
5
+
6
+ const PLATFORM = os.platform();
7
+ const ARCH = os.arch();
8
+
9
+ // Map to package names
10
+ const PLATFORM_MAP = {
11
+ 'darwin-arm64': '@dgtise/mnemex-darwin-arm64',
12
+ 'darwin-x64': '@dgtise/mnemex-darwin-x64',
13
+ 'linux-x64': '@dgtise/mnemex-linux-x64',
14
+ 'linux-arm64': '@dgtise/mnemex-linux-arm64',
15
+ 'win32-x64': '@dgtise/mnemex-win32-x64',
16
+ };
17
+
18
+ const key = `${PLATFORM}-${ARCH}`;
19
+ const pkgName = PLATFORM_MAP[key];
20
+
21
+ if (!pkgName) {
22
+ console.error(`\n⚠ Unsupported platform: ${key}`);
23
+ console.error('Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64');
24
+ console.error('\nYou can build from source:');
25
+ console.error(' git clone https://github.com/dgtise25/mnemex');
26
+ console.error(' cd mnemex && cargo build --release');
27
+ process.exit(1);
28
+ }
29
+
30
+ // Find the binary in the optional dependency
31
+ try {
32
+ const pkgPath = require.resolve(`${pkgName}/package.json`);
33
+ const pkgDir = path.dirname(pkgPath);
34
+ const binName = PLATFORM === 'win32' ? 'mnemex.exe' : 'mnemex';
35
+ const srcBin = path.join(pkgDir, 'bin', binName);
36
+ const destBin = path.join(__dirname, '..', 'bin', binName);
37
+
38
+ // Check if source binary exists
39
+ if (!fs.existsSync(srcBin)) {
40
+ throw new Error(`Binary not found at ${srcBin}`);
41
+ }
42
+
43
+ // Ensure bin directory exists
44
+ fs.mkdirSync(path.dirname(destBin), { recursive: true });
45
+
46
+ // Copy binary
47
+ fs.copyFileSync(srcBin, destBin);
48
+ fs.chmodSync(destBin, 0o755);
49
+
50
+ console.log('\n✓ mnemex installed successfully');
51
+ console.log('\nTo configure Claude Code integration, run:');
52
+ console.log(' npx mnemex install');
53
+ console.log('\nThis will:');
54
+ console.log(' • Add mnemex to your Claude Code MCP servers');
55
+ console.log(' • Enable auto-indexing on first search');
56
+ console.log(' • Reduce context window usage by 90%+\n');
57
+ } catch (err) {
58
+ // Check if the platform package wasn't installed (expected for unsupported platforms)
59
+ if (err.code === 'MODULE_NOT_FOUND') {
60
+ console.error(`\n⚠ Platform package ${pkgName} not found.`);
61
+ console.error('This platform may not be supported yet.\n');
62
+ } else {
63
+ console.error(`\n⚠ Failed to install mnemex binary: ${err.message}`);
64
+ }
65
+ console.error('You can build from source instead:');
66
+ console.error(' git clone https://github.com/dgtise25/mnemex');
67
+ console.error(' cd mnemex && cargo build --release\n');
68
+ process.exit(1);
69
+ }