@graphmemory/server 1.1.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/LICENSE +15 -0
- package/README.md +216 -0
- package/dist/api/index.js +473 -0
- package/dist/api/rest/code.js +78 -0
- package/dist/api/rest/docs.js +80 -0
- package/dist/api/rest/embed.js +47 -0
- package/dist/api/rest/files.js +64 -0
- package/dist/api/rest/graph.js +71 -0
- package/dist/api/rest/index.js +371 -0
- package/dist/api/rest/knowledge.js +239 -0
- package/dist/api/rest/skills.js +285 -0
- package/dist/api/rest/tasks.js +273 -0
- package/dist/api/rest/tools.js +157 -0
- package/dist/api/rest/validation.js +196 -0
- package/dist/api/rest/websocket.js +71 -0
- package/dist/api/tools/code/get-file-symbols.js +30 -0
- package/dist/api/tools/code/get-symbol.js +22 -0
- package/dist/api/tools/code/list-files.js +18 -0
- package/dist/api/tools/code/search-code.js +27 -0
- package/dist/api/tools/code/search-files.js +22 -0
- package/dist/api/tools/context/get-context.js +19 -0
- package/dist/api/tools/docs/cross-references.js +76 -0
- package/dist/api/tools/docs/explain-symbol.js +55 -0
- package/dist/api/tools/docs/find-examples.js +52 -0
- package/dist/api/tools/docs/get-node.js +24 -0
- package/dist/api/tools/docs/get-toc.js +22 -0
- package/dist/api/tools/docs/list-snippets.js +46 -0
- package/dist/api/tools/docs/list-topics.js +18 -0
- package/dist/api/tools/docs/search-files.js +22 -0
- package/dist/api/tools/docs/search-snippets.js +43 -0
- package/dist/api/tools/docs/search.js +27 -0
- package/dist/api/tools/file-index/get-file-info.js +21 -0
- package/dist/api/tools/file-index/list-all-files.js +28 -0
- package/dist/api/tools/file-index/search-all-files.js +24 -0
- package/dist/api/tools/knowledge/add-attachment.js +31 -0
- package/dist/api/tools/knowledge/create-note.js +20 -0
- package/dist/api/tools/knowledge/create-relation.js +29 -0
- package/dist/api/tools/knowledge/delete-note.js +19 -0
- package/dist/api/tools/knowledge/delete-relation.js +23 -0
- package/dist/api/tools/knowledge/find-linked-notes.js +25 -0
- package/dist/api/tools/knowledge/get-note.js +20 -0
- package/dist/api/tools/knowledge/list-notes.js +18 -0
- package/dist/api/tools/knowledge/list-relations.js +17 -0
- package/dist/api/tools/knowledge/remove-attachment.js +19 -0
- package/dist/api/tools/knowledge/search-notes.js +25 -0
- package/dist/api/tools/knowledge/update-note.js +34 -0
- package/dist/api/tools/skills/add-attachment.js +31 -0
- package/dist/api/tools/skills/bump-usage.js +19 -0
- package/dist/api/tools/skills/create-skill-link.js +25 -0
- package/dist/api/tools/skills/create-skill.js +26 -0
- package/dist/api/tools/skills/delete-skill-link.js +23 -0
- package/dist/api/tools/skills/delete-skill.js +20 -0
- package/dist/api/tools/skills/find-linked-skills.js +25 -0
- package/dist/api/tools/skills/get-skill.js +21 -0
- package/dist/api/tools/skills/link-skill.js +23 -0
- package/dist/api/tools/skills/list-skills.js +20 -0
- package/dist/api/tools/skills/recall-skills.js +18 -0
- package/dist/api/tools/skills/remove-attachment.js +19 -0
- package/dist/api/tools/skills/search-skills.js +25 -0
- package/dist/api/tools/skills/update-skill.js +58 -0
- package/dist/api/tools/tasks/add-attachment.js +31 -0
- package/dist/api/tools/tasks/create-task-link.js +25 -0
- package/dist/api/tools/tasks/create-task.js +26 -0
- package/dist/api/tools/tasks/delete-task-link.js +23 -0
- package/dist/api/tools/tasks/delete-task.js +20 -0
- package/dist/api/tools/tasks/find-linked-tasks.js +25 -0
- package/dist/api/tools/tasks/get-task.js +20 -0
- package/dist/api/tools/tasks/link-task.js +23 -0
- package/dist/api/tools/tasks/list-tasks.js +25 -0
- package/dist/api/tools/tasks/move-task.js +38 -0
- package/dist/api/tools/tasks/remove-attachment.js +19 -0
- package/dist/api/tools/tasks/search-tasks.js +25 -0
- package/dist/api/tools/tasks/update-task.js +58 -0
- package/dist/cli/index.js +617 -0
- package/dist/cli/indexer.js +275 -0
- package/dist/graphs/attachment-types.js +74 -0
- package/dist/graphs/code-types.js +10 -0
- package/dist/graphs/code.js +204 -0
- package/dist/graphs/docs.js +231 -0
- package/dist/graphs/file-index-types.js +10 -0
- package/dist/graphs/file-index.js +310 -0
- package/dist/graphs/file-lang.js +119 -0
- package/dist/graphs/knowledge-types.js +32 -0
- package/dist/graphs/knowledge.js +768 -0
- package/dist/graphs/manager-types.js +87 -0
- package/dist/graphs/skill-types.js +10 -0
- package/dist/graphs/skill.js +1016 -0
- package/dist/graphs/task-types.js +17 -0
- package/dist/graphs/task.js +972 -0
- package/dist/lib/access.js +67 -0
- package/dist/lib/embedder.js +235 -0
- package/dist/lib/events-log.js +401 -0
- package/dist/lib/file-import.js +328 -0
- package/dist/lib/file-mirror.js +461 -0
- package/dist/lib/frontmatter.js +17 -0
- package/dist/lib/jwt.js +146 -0
- package/dist/lib/mirror-watcher.js +637 -0
- package/dist/lib/multi-config.js +393 -0
- package/dist/lib/parsers/code.js +214 -0
- package/dist/lib/parsers/codeblock.js +33 -0
- package/dist/lib/parsers/docs.js +199 -0
- package/dist/lib/parsers/languages/index.js +15 -0
- package/dist/lib/parsers/languages/registry.js +68 -0
- package/dist/lib/parsers/languages/types.js +2 -0
- package/dist/lib/parsers/languages/typescript.js +306 -0
- package/dist/lib/project-manager.js +458 -0
- package/dist/lib/promise-queue.js +22 -0
- package/dist/lib/search/bm25.js +167 -0
- package/dist/lib/search/code.js +103 -0
- package/dist/lib/search/docs.js +106 -0
- package/dist/lib/search/file-index.js +31 -0
- package/dist/lib/search/files.js +61 -0
- package/dist/lib/search/knowledge.js +101 -0
- package/dist/lib/search/skills.js +104 -0
- package/dist/lib/search/tasks.js +103 -0
- package/dist/lib/team.js +89 -0
- package/dist/lib/watcher.js +67 -0
- package/dist/ui/assets/index-D6oxrVF7.js +1759 -0
- package/dist/ui/assets/index-kKd4mVrh.css +1 -0
- package/dist/ui/favicon.svg +1 -0
- package/dist/ui/icons.svg +24 -0
- package/dist/ui/index.html +14 -0
- package/package.json +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 prih
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# graphmemory
|
|
2
|
+
|
|
3
|
+
An MCP server that builds a **semantic graph memory** from a project directory.
|
|
4
|
+
Indexes markdown docs, TypeScript/JavaScript source code, and all project files into six graph structures,
|
|
5
|
+
then exposes them as **58 MCP tools** + **REST API** + **Web UI**.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
### Docker (recommended)
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 1. Create graph-memory.yaml
|
|
13
|
+
cat > graph-memory.yaml << 'EOF'
|
|
14
|
+
server:
|
|
15
|
+
host: "0.0.0.0"
|
|
16
|
+
port: 3000
|
|
17
|
+
modelsDir: "/data/models"
|
|
18
|
+
|
|
19
|
+
projects:
|
|
20
|
+
my-app:
|
|
21
|
+
projectDir: "/data/projects/my-app"
|
|
22
|
+
EOF
|
|
23
|
+
|
|
24
|
+
# 2. Run
|
|
25
|
+
docker run -d \
|
|
26
|
+
--name graph-memory \
|
|
27
|
+
-p 3000:3000 \
|
|
28
|
+
-v $(pwd)/graph-memory.yaml:/data/config/graph-memory.yaml:ro \
|
|
29
|
+
-v /path/to/my-app:/data/projects/my-app:ro \
|
|
30
|
+
-v graph-memory-models:/data/models \
|
|
31
|
+
ghcr.io/graph-memory/graphmemory-server
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Open http://localhost:3000 — the web UI is ready. The embedding model (~560 MB) downloads on first startup.
|
|
35
|
+
|
|
36
|
+
### npm
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g @graphmemory/server
|
|
40
|
+
graphmemory serve --config graph-memory.yaml
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### From source
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
git clone https://github.com/graph-memory/graphmemory.git
|
|
47
|
+
cd graphmemory
|
|
48
|
+
npm install && cd ui && npm install && cd ..
|
|
49
|
+
npm run build
|
|
50
|
+
node dist/cli/index.js serve --config graph-memory.yaml
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Connect an MCP client
|
|
54
|
+
|
|
55
|
+
Start the server, then connect MCP clients to `http://localhost:3000/mcp/{projectId}`.
|
|
56
|
+
|
|
57
|
+
**Claude Desktop** — add via **Settings > Connectors** in the app, enter the URL:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
http://localhost:3000/mcp/my-app
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Claude Code** — run in your project directory:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
claude mcp add --transport http --scope project graph-memory http://localhost:3000/mcp/my-app
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or add to `.mcp.json` manually:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"graph-memory": {
|
|
75
|
+
"type": "http",
|
|
76
|
+
"url": "http://localhost:3000/mcp/my-app"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Cursor / Windsurf / other clients** — enter the URL directly in settings:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
http://localhost:3000/mcp/my-app
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
See [docs/cli.md](docs/cli.md) for stdio transport and other connection options.
|
|
89
|
+
|
|
90
|
+
## What it does
|
|
91
|
+
|
|
92
|
+
| Feature | Description |
|
|
93
|
+
|---------|-------------|
|
|
94
|
+
| **Docs indexing** | Parses markdown into heading-based chunks with cross-file links and code block extraction |
|
|
95
|
+
| **Code indexing** | Extracts AST symbols (functions, classes, interfaces) via tree-sitter |
|
|
96
|
+
| **File index** | Indexes all project files with metadata, language detection, directory hierarchy |
|
|
97
|
+
| **Knowledge graph** | Persistent notes and facts with typed relations and cross-graph links |
|
|
98
|
+
| **Task management** | Kanban workflow with priorities, assignees, and cross-graph context |
|
|
99
|
+
| **Skills** | Reusable recipes with steps, triggers, and usage tracking |
|
|
100
|
+
| **Hybrid search** | BM25 keyword + vector cosine similarity with BFS graph expansion |
|
|
101
|
+
| **Real-time** | File watching + WebSocket push to UI |
|
|
102
|
+
| **Multi-project** | One process manages multiple projects with YAML hot-reload |
|
|
103
|
+
| **Workspaces** | Share knowledge/tasks/skills across related projects |
|
|
104
|
+
| **Auth & ACL** | Password login (JWT), API keys, 4-level access control |
|
|
105
|
+
|
|
106
|
+
## 58 MCP tools
|
|
107
|
+
|
|
108
|
+
| Group | Tools |
|
|
109
|
+
|-------|-------|
|
|
110
|
+
| **Context** | `get_context` |
|
|
111
|
+
| **Docs** | `list_topics`, `get_toc`, `search`, `get_node`, `search_topic_files` |
|
|
112
|
+
| **Code blocks** | `find_examples`, `search_snippets`, `list_snippets`, `explain_symbol` |
|
|
113
|
+
| **Cross-graph** | `cross_references` |
|
|
114
|
+
| **Code** | `list_files`, `get_file_symbols`, `search_code`, `get_symbol`, `search_files` |
|
|
115
|
+
| **Files** | `list_all_files`, `search_all_files`, `get_file_info` |
|
|
116
|
+
| **Knowledge** | `create_note`, `update_note`, `delete_note`, `get_note`, `list_notes`, `search_notes`, `create_relation`, `delete_relation`, `list_relations`, `find_linked_notes`, `add_note_attachment`, `remove_note_attachment` |
|
|
117
|
+
| **Tasks** | `create_task`, `update_task`, `delete_task`, `get_task`, `list_tasks`, `search_tasks`, `move_task`, `link_task`, `create_task_link`, `delete_task_link`, `find_linked_tasks`, `add_task_attachment`, `remove_task_attachment` |
|
|
118
|
+
| **Skills** | `create_skill`, `update_skill`, `delete_skill`, `get_skill`, `list_skills`, `search_skills`, `recall_skills`, `bump_skill_usage`, `link_skill`, `create_skill_link`, `delete_skill_link`, `find_linked_skills`, `add_skill_attachment`, `remove_skill_attachment` |
|
|
119
|
+
|
|
120
|
+
## Web UI
|
|
121
|
+
|
|
122
|
+
Dashboard, Knowledge (notes CRUD), Tasks (kanban board with drag-drop), Skills (recipes),
|
|
123
|
+
Docs browser, Files browser, Prompts (AI prompt generator), Search (cross-graph),
|
|
124
|
+
Graph (Cytoscape.js visualization), Tools (MCP explorer), Help.
|
|
125
|
+
|
|
126
|
+
Light/dark theme. Real-time WebSocket updates. Login page when auth is configured.
|
|
127
|
+
|
|
128
|
+
## Configuration
|
|
129
|
+
|
|
130
|
+
All configuration via `graph-memory.yaml`. Only `projects.<id>.projectDir` is required:
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
server:
|
|
134
|
+
host: "127.0.0.1"
|
|
135
|
+
port: 3000
|
|
136
|
+
embedding:
|
|
137
|
+
model: "Xenova/bge-m3"
|
|
138
|
+
|
|
139
|
+
projects:
|
|
140
|
+
my-app:
|
|
141
|
+
projectDir: "/path/to/my-app"
|
|
142
|
+
graphs:
|
|
143
|
+
docs:
|
|
144
|
+
include: "**/*.md" # default
|
|
145
|
+
code:
|
|
146
|
+
include: "**/*.{js,ts,jsx,tsx}" # default
|
|
147
|
+
skills:
|
|
148
|
+
enabled: false
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
See [docs/configuration.md](docs/configuration.md) for full reference and [graph-memory.yaml.example](graph-memory.yaml.example) for all options.
|
|
152
|
+
|
|
153
|
+
## Authentication
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
users:
|
|
157
|
+
alice:
|
|
158
|
+
name: "Alice"
|
|
159
|
+
email: "alice@example.com"
|
|
160
|
+
apiKey: "mgm-key-abc123"
|
|
161
|
+
passwordHash: "$scrypt$..." # generated by: graphmemory users add
|
|
162
|
+
|
|
163
|
+
server:
|
|
164
|
+
jwtSecret: "your-secret"
|
|
165
|
+
defaultAccess: rw
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- **UI login**: email + password → JWT cookies (httpOnly, SameSite=Strict)
|
|
169
|
+
- **API access**: `Authorization: Bearer <apiKey>`
|
|
170
|
+
- **ACL**: graph > project > workspace > server > defaultAccess (`deny` / `r` / `rw`)
|
|
171
|
+
|
|
172
|
+
See [docs/authentication.md](docs/authentication.md).
|
|
173
|
+
|
|
174
|
+
## Docker Compose
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
services:
|
|
178
|
+
graph-memory:
|
|
179
|
+
image: ghcr.io/graph-memory/graphmemory-server
|
|
180
|
+
ports:
|
|
181
|
+
- "3000:3000"
|
|
182
|
+
volumes:
|
|
183
|
+
- ./graph-memory.yaml:/data/config/graph-memory.yaml:ro
|
|
184
|
+
- /path/to/my-app:/data/projects/my-app
|
|
185
|
+
- models:/data/models
|
|
186
|
+
restart: unless-stopped
|
|
187
|
+
|
|
188
|
+
volumes:
|
|
189
|
+
models:
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
See [docs/docker.md](docs/docker.md).
|
|
193
|
+
|
|
194
|
+
## Development
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run dev # tsc --watch (backend)
|
|
198
|
+
cd ui && npm run dev # Vite on :5173, proxies /api → :3000
|
|
199
|
+
npm test # 1240 tests across 28 suites
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Documentation
|
|
203
|
+
|
|
204
|
+
Full documentation is in [docs/](docs/README.md):
|
|
205
|
+
|
|
206
|
+
- **Concepts**: [docs indexing](docs/concepts-docs-indexing.md), [code indexing](docs/concepts-code-indexing.md), [tasks](docs/concepts-tasks.md), [skills](docs/concepts-skills.md), [knowledge](docs/concepts-knowledge.md), [file index](docs/concepts-file-index.md)
|
|
207
|
+
- **Architecture**: [system architecture](docs/architecture.md), [graphs overview](docs/graphs-overview.md), [search algorithms](docs/search.md), [embeddings](docs/embeddings.md)
|
|
208
|
+
- **API**: [REST API](docs/api-rest.md), [MCP tools guide](docs/mcp-tools-guide.md), [WebSocket](docs/api-websocket.md)
|
|
209
|
+
- **Operations**: [CLI](docs/cli.md), [configuration](docs/configuration.md), [Docker](docs/docker.md), [npm](docs/npm-package.md)
|
|
210
|
+
- **Security**: [authentication](docs/authentication.md), [security](docs/security.md)
|
|
211
|
+
- **UI**: [architecture](docs/ui-architecture.md), [features](docs/ui-features.md), [patterns](docs/ui-patterns.md)
|
|
212
|
+
- **Development**: [testing](docs/testing.md), [API patterns](docs/api-patterns.md)
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
ISC
|