memnexus 0.2.0__tar.gz
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.
- memnexus-0.2.0/.gitattributes +39 -0
- memnexus-0.2.0/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
- memnexus-0.2.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- memnexus-0.2.0/.github/pull_request_template.md +31 -0
- memnexus-0.2.0/.github/workflows/ci.yml +93 -0
- memnexus-0.2.0/.gitignore +89 -0
- memnexus-0.2.0/.python-version +1 -0
- memnexus-0.2.0/AGENTS.md +216 -0
- memnexus-0.2.0/CHANGELOG.md +107 -0
- memnexus-0.2.0/CONTRIBUTING.md +204 -0
- memnexus-0.2.0/INSTALL.md +99 -0
- memnexus-0.2.0/LICENSE +21 -0
- memnexus-0.2.0/Makefile +42 -0
- memnexus-0.2.0/PKG-INFO +283 -0
- memnexus-0.2.0/README.md +228 -0
- memnexus-0.2.0/README.zh.md +286 -0
- memnexus-0.2.0/RELEASE_CHECKLIST.md +132 -0
- memnexus-0.2.0/SECURITY.md +103 -0
- memnexus-0.2.0/docs/AGENTS.md +82 -0
- memnexus-0.2.0/docs/API.md +348 -0
- memnexus-0.2.0/docs/ARCHITECTURE.md +273 -0
- memnexus-0.2.0/docs/CLI.md +257 -0
- memnexus-0.2.0/docs/DEPLOYMENT.md +577 -0
- memnexus-0.2.0/docs/DEVELOPMENT.md +195 -0
- memnexus-0.2.0/docs/GETTING_STARTED.md +185 -0
- memnexus-0.2.0/docs/ROADMAP.md +569 -0
- memnexus-0.2.0/docs/SUPERMEMORY_COMPARISON.md +250 -0
- memnexus-0.2.0/docs/VISION.md +252 -0
- memnexus-0.2.0/examples/memory_v2_demo.py +10 -0
- memnexus-0.2.0/frontend/AGENTS.md +181 -0
- memnexus-0.2.0/frontend/index.html +13 -0
- memnexus-0.2.0/frontend/package.json +34 -0
- memnexus-0.2.0/frontend/postcss.config.js +6 -0
- memnexus-0.2.0/frontend/src/App.tsx +29 -0
- memnexus-0.2.0/frontend/src/components/Header.tsx +30 -0
- memnexus-0.2.0/frontend/src/components/Layout.tsx +21 -0
- memnexus-0.2.0/frontend/src/components/Sidebar.tsx +64 -0
- memnexus-0.2.0/frontend/src/index.css +73 -0
- memnexus-0.2.0/frontend/src/main.tsx +27 -0
- memnexus-0.2.0/frontend/src/pages/Agents.tsx +115 -0
- memnexus-0.2.0/frontend/src/pages/Dashboard.tsx +165 -0
- memnexus-0.2.0/frontend/src/pages/Interventions.tsx +201 -0
- memnexus-0.2.0/frontend/src/pages/Memory.tsx +56 -0
- memnexus-0.2.0/frontend/src/pages/Orchestration.tsx +144 -0
- memnexus-0.2.0/frontend/src/pages/SessionDetail.tsx +107 -0
- memnexus-0.2.0/frontend/src/pages/Sessions.tsx +136 -0
- memnexus-0.2.0/frontend/src/pages/Settings.tsx +109 -0
- memnexus-0.2.0/frontend/src/services/api.ts +112 -0
- memnexus-0.2.0/frontend/src/store/useStore.ts +63 -0
- memnexus-0.2.0/frontend/tailwind.config.js +21 -0
- memnexus-0.2.0/frontend/tsconfig.json +25 -0
- memnexus-0.2.0/frontend/tsconfig.node.json +10 -0
- memnexus-0.2.0/frontend/vite.config.ts +19 -0
- memnexus-0.2.0/main.py +6 -0
- memnexus-0.2.0/pyproject.toml +214 -0
- memnexus-0.2.0/scripts/verify-week1.sh +96 -0
- memnexus-0.2.0/src/memnexus/AGENTS.md +887 -0
- memnexus-0.2.0/src/memnexus/__init__.py +47 -0
- memnexus-0.2.0/src/memnexus/agents/__init__.py +6 -0
- memnexus-0.2.0/src/memnexus/agents/base.py +77 -0
- memnexus-0.2.0/src/memnexus/agents/wrapper.py +255 -0
- memnexus-0.2.0/src/memnexus/cli.py +445 -0
- memnexus-0.2.0/src/memnexus/code_memory.py +658 -0
- memnexus-0.2.0/src/memnexus/core/config.py +102 -0
- memnexus-0.2.0/src/memnexus/core/session.py +353 -0
- memnexus-0.2.0/src/memnexus/memory/__init__.py +59 -0
- memnexus-0.2.0/src/memnexus/memory/advanced_rag.py +338 -0
- memnexus-0.2.0/src/memnexus/memory/code.py +658 -0
- memnexus-0.2.0/src/memnexus/memory/compression/README.md +7 -0
- memnexus-0.2.0/src/memnexus/memory/compression/__init__.py +0 -0
- memnexus-0.2.0/src/memnexus/memory/context.py +296 -0
- memnexus-0.2.0/src/memnexus/memory/core/__init__.py +19 -0
- memnexus-0.2.0/src/memnexus/memory/core/types.py +249 -0
- memnexus-0.2.0/src/memnexus/memory/git.py +310 -0
- memnexus-0.2.0/src/memnexus/memory/knowledge_graph/README.md +7 -0
- memnexus-0.2.0/src/memnexus/memory/knowledge_graph/__init__.py +25 -0
- memnexus-0.2.0/src/memnexus/memory/knowledge_graph/builder.py +386 -0
- memnexus-0.2.0/src/memnexus/memory/layers/README.md +13 -0
- memnexus-0.2.0/src/memnexus/memory/layers/__init__.py +23 -0
- memnexus-0.2.0/src/memnexus/memory/layers/base.py +358 -0
- memnexus-0.2.0/src/memnexus/memory/layers/manager.py +422 -0
- memnexus-0.2.0/src/memnexus/memory/rag.py +470 -0
- memnexus-0.2.0/src/memnexus/memory/retrieval/README.md +12 -0
- memnexus-0.2.0/src/memnexus/memory/retrieval/__init__.py +15 -0
- memnexus-0.2.0/src/memnexus/memory/retrieval/adaptive.py +361 -0
- memnexus-0.2.0/src/memnexus/memory/rmt/README.md +7 -0
- memnexus-0.2.0/src/memnexus/memory/rmt/__init__.py +19 -0
- memnexus-0.2.0/src/memnexus/memory/rmt/curriculum.py +456 -0
- memnexus-0.2.0/src/memnexus/memory/rmt/memory_manager.py +424 -0
- memnexus-0.2.0/src/memnexus/memory/rmt/segment_processor.py +334 -0
- memnexus-0.2.0/src/memnexus/memory/store.py +324 -0
- memnexus-0.2.0/src/memnexus/memory/sync.py +393 -0
- memnexus-0.2.0/src/memnexus/orchestrator/__init__.py +14 -0
- memnexus-0.2.0/src/memnexus/orchestrator/engine.py +527 -0
- memnexus-0.2.0/src/memnexus/orchestrator/intervention.py +614 -0
- memnexus-0.2.0/src/memnexus/orchestrator/scheduler.py +481 -0
- memnexus-0.2.0/src/memnexus/protocols/__init__.py +5 -0
- memnexus-0.2.0/src/memnexus/protocols/acp.py +644 -0
- memnexus-0.2.0/src/memnexus/scripts/kimi_plugin.py +226 -0
- memnexus-0.2.0/src/memnexus/server.py +320 -0
- memnexus-0.2.0/tests/__init__.py +1 -0
- memnexus-0.2.0/tests/manual_test_git.py +88 -0
- memnexus-0.2.0/tests/test_git_integration.py +289 -0
- memnexus-0.2.0/tests/test_session.py +114 -0
- memnexus-0.2.0/tests/test_week2_complete.py +218 -0
- memnexus-0.2.0/tests/test_week3_complete.py +418 -0
- memnexus-0.2.0/uv.lock +4709 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Python files
|
|
5
|
+
*.py text eol=lf
|
|
6
|
+
*.pyx text eol=lf
|
|
7
|
+
*.pyd binary
|
|
8
|
+
|
|
9
|
+
# Web files
|
|
10
|
+
*.js text eol=lf
|
|
11
|
+
*.ts text eol=lf
|
|
12
|
+
*.tsx text eol=lf
|
|
13
|
+
*.json text eol=lf
|
|
14
|
+
*.css text eol=lf
|
|
15
|
+
*.html text eol=lf
|
|
16
|
+
*.md text eol=lf
|
|
17
|
+
*.yml text eol=lf
|
|
18
|
+
*.yaml text eol=lf
|
|
19
|
+
|
|
20
|
+
# Documentation
|
|
21
|
+
*.md text eol=lf
|
|
22
|
+
*.txt text eol=lf
|
|
23
|
+
|
|
24
|
+
# Scripts
|
|
25
|
+
*.sh text eol=lf
|
|
26
|
+
*.bat text eol=crlf
|
|
27
|
+
|
|
28
|
+
# Binary files
|
|
29
|
+
*.png binary
|
|
30
|
+
*.jpg binary
|
|
31
|
+
*.jpeg binary
|
|
32
|
+
*.gif binary
|
|
33
|
+
*.ico binary
|
|
34
|
+
*.svg text
|
|
35
|
+
*.pdf binary
|
|
36
|
+
*.zip binary
|
|
37
|
+
*.gz binary
|
|
38
|
+
*.tar binary
|
|
39
|
+
*.db binary
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Run command '...'
|
|
16
|
+
2. See error
|
|
17
|
+
|
|
18
|
+
**Expected behavior**
|
|
19
|
+
A clear and concise description of what you expected to happen.
|
|
20
|
+
|
|
21
|
+
**Logs**
|
|
22
|
+
If applicable, add logs to help explain your problem.
|
|
23
|
+
```
|
|
24
|
+
Paste logs here
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Environment (please complete the following information):**
|
|
28
|
+
- OS: [e.g. macOS, Linux]
|
|
29
|
+
- Python Version: [e.g. 3.12]
|
|
30
|
+
- MemNexus Version: [e.g. 0.1.0]
|
|
31
|
+
- Installation Method: [e.g. pip, source]
|
|
32
|
+
|
|
33
|
+
**Additional context**
|
|
34
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- Please include a summary of the changes -->
|
|
3
|
+
|
|
4
|
+
Fixes # (issue)
|
|
5
|
+
|
|
6
|
+
## Type of Change
|
|
7
|
+
<!-- Please check the relevant option(s) -->
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
10
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
11
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
12
|
+
- [ ] Documentation update
|
|
13
|
+
- [ ] Performance improvement
|
|
14
|
+
- [ ] Code refactoring
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
- [ ] My code follows the style guidelines of this project
|
|
19
|
+
- [ ] I have performed a self-review of my own code
|
|
20
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
21
|
+
- [ ] I have made corresponding changes to the documentation
|
|
22
|
+
- [ ] My changes generate no new warnings
|
|
23
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
24
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
25
|
+
|
|
26
|
+
## Testing
|
|
27
|
+
<!-- Please describe the tests you ran -->
|
|
28
|
+
|
|
29
|
+
## Screenshots (if applicable)
|
|
30
|
+
|
|
31
|
+
## Additional Notes
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test-python:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.12', '3.13']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v3
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
uv sync --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: Lint with ruff
|
|
34
|
+
run: |
|
|
35
|
+
uv run ruff check .
|
|
36
|
+
uv run ruff format --check .
|
|
37
|
+
|
|
38
|
+
- name: Type check with mypy
|
|
39
|
+
run: |
|
|
40
|
+
uv run mypy src/memnexus
|
|
41
|
+
|
|
42
|
+
- name: Test with pytest
|
|
43
|
+
run: |
|
|
44
|
+
uv run pytest --cov=memnexus --cov-report=xml
|
|
45
|
+
|
|
46
|
+
- name: Upload coverage
|
|
47
|
+
uses: codecov/codecov-action@v3
|
|
48
|
+
with:
|
|
49
|
+
file: ./coverage.xml
|
|
50
|
+
fail_ci_if_error: false
|
|
51
|
+
|
|
52
|
+
test-frontend:
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
|
|
58
|
+
- name: Set up Node.js
|
|
59
|
+
uses: actions/setup-node@v4
|
|
60
|
+
with:
|
|
61
|
+
node-version: '18'
|
|
62
|
+
cache: 'npm'
|
|
63
|
+
cache-dependency-path: frontend/package-lock.json
|
|
64
|
+
|
|
65
|
+
- name: Install dependencies
|
|
66
|
+
run: |
|
|
67
|
+
cd frontend
|
|
68
|
+
npm ci
|
|
69
|
+
|
|
70
|
+
- name: Build frontend
|
|
71
|
+
run: |
|
|
72
|
+
cd frontend
|
|
73
|
+
npm run build
|
|
74
|
+
|
|
75
|
+
- name: Lint frontend
|
|
76
|
+
run: |
|
|
77
|
+
cd frontend
|
|
78
|
+
npm run lint || true
|
|
79
|
+
|
|
80
|
+
check-docs:
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v4
|
|
85
|
+
|
|
86
|
+
- name: Check documentation
|
|
87
|
+
run: |
|
|
88
|
+
# Check if README.md exists
|
|
89
|
+
test -f README.md
|
|
90
|
+
# Check if CHANGELOG.md exists
|
|
91
|
+
test -f CHANGELOG.md
|
|
92
|
+
# Check if LICENSE exists
|
|
93
|
+
test -f LICENSE
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
pip-wheel-metadata/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
MANIFEST
|
|
25
|
+
|
|
26
|
+
# Virtual environments
|
|
27
|
+
.env
|
|
28
|
+
.venv
|
|
29
|
+
env/
|
|
30
|
+
venv/
|
|
31
|
+
ENV/
|
|
32
|
+
env.bak/
|
|
33
|
+
venv.bak/
|
|
34
|
+
|
|
35
|
+
# IDEs
|
|
36
|
+
.idea/
|
|
37
|
+
.vscode/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
*~
|
|
41
|
+
.DS_Store
|
|
42
|
+
|
|
43
|
+
# Testing
|
|
44
|
+
.pytest_cache/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
htmlcov/
|
|
48
|
+
.tox/
|
|
49
|
+
.nox/
|
|
50
|
+
|
|
51
|
+
# MyPy
|
|
52
|
+
.mypy_cache/
|
|
53
|
+
.dmypy.json
|
|
54
|
+
dmypy.json
|
|
55
|
+
|
|
56
|
+
# Ruff
|
|
57
|
+
.ruff_cache/
|
|
58
|
+
|
|
59
|
+
# Data
|
|
60
|
+
.memnexus/
|
|
61
|
+
data/
|
|
62
|
+
*.db
|
|
63
|
+
*.sqlite
|
|
64
|
+
*.sqlite3
|
|
65
|
+
|
|
66
|
+
# Logs
|
|
67
|
+
*.log
|
|
68
|
+
logs/
|
|
69
|
+
|
|
70
|
+
# LanceDB
|
|
71
|
+
*.lance
|
|
72
|
+
|
|
73
|
+
# Frontend
|
|
74
|
+
frontend/node_modules/
|
|
75
|
+
frontend/dist/
|
|
76
|
+
frontend/.cache/
|
|
77
|
+
|
|
78
|
+
# Misc
|
|
79
|
+
*.bak
|
|
80
|
+
*.tmp
|
|
81
|
+
*.temp
|
|
82
|
+
|
|
83
|
+
# Research (local only, not tracked)
|
|
84
|
+
research/
|
|
85
|
+
!research/README.md # Keep only the index
|
|
86
|
+
!research/**/README.md # Keep sub-indexes
|
|
87
|
+
|
|
88
|
+
# Sisyphus planning files (development only)
|
|
89
|
+
.sisyphus/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
memnexus-0.2.0/AGENTS.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# MemNexus - AI Agent 开发指南
|
|
2
|
+
|
|
3
|
+
> **目标读者**: AI 编程助手(如 Claude Code、Kimi CLI 等)
|
|
4
|
+
>
|
|
5
|
+
> **项目状态**: v0.2.0 - Code Memory for AI Programming Tools
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 项目概述
|
|
10
|
+
|
|
11
|
+
MemNexus 是一个**代码记忆基础设施**(Code Memory Infrastructure),为 AI 编程工具提供持久的项目记忆能力。
|
|
12
|
+
|
|
13
|
+
### 核心定位
|
|
14
|
+
|
|
15
|
+
**不是**:多 Agent 协作编排系统、通用记忆层、项目管理工具
|
|
16
|
+
|
|
17
|
+
**而是**:专为 AI 编程场景设计的代码记忆基础设施
|
|
18
|
+
|
|
19
|
+
- **Code-Aware**: 理解代码结构(AST),不只是文本
|
|
20
|
+
- **Git-Native**: 与 Git 历史深度集成
|
|
21
|
+
- **Tool-Agnostic**: 服务所有 AI 编程工具
|
|
22
|
+
|
|
23
|
+
### 核心功能
|
|
24
|
+
|
|
25
|
+
1. **Git 历史索引** - 索引 commit 历史,支持语义搜索
|
|
26
|
+
2. **代码解析** - 解析 Python 代码结构(函数、类、方法)
|
|
27
|
+
3. **向量记忆** - LanceDB 存储,支持语义检索
|
|
28
|
+
4. **Kimi CLI 插件** - 原生集成 Kimi CLI 1.25.0+
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 技术栈
|
|
33
|
+
|
|
34
|
+
| 层级 | 技术 | 用途 |
|
|
35
|
+
|------|------|------|
|
|
36
|
+
| 存储 | LanceDB | 向量数据库 |
|
|
37
|
+
| Embedding | sentence-transformers | 文本向量化 |
|
|
38
|
+
| 代码解析 | Python AST | Python 代码分析 |
|
|
39
|
+
| Git 操作 | GitPython | Git 历史提取 |
|
|
40
|
+
| Web | FastAPI | HTTP API |
|
|
41
|
+
| CLI | Typer + Rich | 命令行界面 |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 项目结构
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
MemNexus/
|
|
49
|
+
├── src/memnexus/ # Python 源代码
|
|
50
|
+
│ ├── __init__.py # 导出 CodeMemory, SearchResult
|
|
51
|
+
│ ├── code_memory.py # 核心 CodeMemory 类
|
|
52
|
+
│ ├── cli.py # CLI 入口
|
|
53
|
+
│ ├── server.py # FastAPI 服务器
|
|
54
|
+
│ └── memory/ # 记忆系统
|
|
55
|
+
│ ├── store.py # LanceDB 向量存储
|
|
56
|
+
│ ├── git.py # Git 集成
|
|
57
|
+
│ └── code.py # 代码解析
|
|
58
|
+
├── docs/ # 文档
|
|
59
|
+
│ ├── VISION.md # 产品定位
|
|
60
|
+
│ ├── ROADMAP.md # 路线图
|
|
61
|
+
│ ├── API.md # API 文档
|
|
62
|
+
│ └── CLI.md # CLI 文档
|
|
63
|
+
├── tests/ # 测试
|
|
64
|
+
├── README.md # 项目说明
|
|
65
|
+
├── INSTALL.md # 安装指南
|
|
66
|
+
└── CHANGELOG.md # 更新日志
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 快速开始
|
|
72
|
+
|
|
73
|
+
### 安装
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install memnexus
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 使用
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import asyncio
|
|
83
|
+
from memnexus import CodeMemory
|
|
84
|
+
|
|
85
|
+
async def main():
|
|
86
|
+
# 初始化
|
|
87
|
+
memory = await CodeMemory.init("./my-project")
|
|
88
|
+
|
|
89
|
+
# 索引
|
|
90
|
+
await memory.index_git_history()
|
|
91
|
+
await memory.index_codebase()
|
|
92
|
+
|
|
93
|
+
# 搜索
|
|
94
|
+
results = await memory.search("authentication")
|
|
95
|
+
for r in results:
|
|
96
|
+
print(f"{r.source}: {r.content[:100]}")
|
|
97
|
+
|
|
98
|
+
asyncio.run(main())
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### CLI
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
memnexus init # 初始化项目
|
|
105
|
+
memnexus index --git # 索引 Git 历史
|
|
106
|
+
memnexus index --code # 索引代码
|
|
107
|
+
memnexus search "query" # 搜索记忆
|
|
108
|
+
memnexus server # 启动 API 服务
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 核心 API
|
|
114
|
+
|
|
115
|
+
### CodeMemory
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
class CodeMemory:
|
|
119
|
+
# 初始化
|
|
120
|
+
@classmethod
|
|
121
|
+
async def init(cls, project_path: str) -> "CodeMemory"
|
|
122
|
+
|
|
123
|
+
# Git 相关
|
|
124
|
+
async def index_git_history(self, limit: int = 1000) -> Dict
|
|
125
|
+
async def query_git_history(self, query: str, limit: int = 5) -> List[GitSearchResult]
|
|
126
|
+
async def get_file_history(self, file_path: str, limit: int = 20) -> List[GitSearchResult]
|
|
127
|
+
|
|
128
|
+
# 代码相关
|
|
129
|
+
async def index_codebase(self, languages: List[str] = None) -> Dict
|
|
130
|
+
async def search_code(self, query: str, symbol_type: str = None) -> List[SearchResult]
|
|
131
|
+
async def find_symbol(self, name: str) -> Optional[SearchResult]
|
|
132
|
+
|
|
133
|
+
# 通用
|
|
134
|
+
async def add(self, content: str, source: str, metadata: dict = None) -> str
|
|
135
|
+
async def search(self, query: str, limit: int = 5) -> List[SearchResult]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## HTTP API 端点
|
|
141
|
+
|
|
142
|
+
| 方法 | 端点 | 描述 |
|
|
143
|
+
|------|------|------|
|
|
144
|
+
| GET | `/health` | 健康检查 |
|
|
145
|
+
| GET | `/stats` | 项目统计 |
|
|
146
|
+
| GET | `/api/v1/search` | 搜索记忆 |
|
|
147
|
+
| POST | `/api/v1/memory` | 添加记忆 |
|
|
148
|
+
| POST | `/api/v1/git/index` | 索引 Git |
|
|
149
|
+
| GET | `/api/v1/git/search` | 搜索 Git |
|
|
150
|
+
| POST | `/api/v1/code/index` | 索引代码 |
|
|
151
|
+
| GET | `/api/v1/code/search` | 搜索代码 |
|
|
152
|
+
| GET | `/api/v1/code/symbol/{name}` | 查找符号 |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 开发指南
|
|
157
|
+
|
|
158
|
+
### 构建
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# 安装依赖
|
|
162
|
+
pip install -e ".[dev]"
|
|
163
|
+
|
|
164
|
+
# 运行测试
|
|
165
|
+
pytest
|
|
166
|
+
|
|
167
|
+
# 代码检查
|
|
168
|
+
ruff format .
|
|
169
|
+
ruff check . --fix
|
|
170
|
+
mypy src/memnexus
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 发布
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# 构建
|
|
177
|
+
python -m build
|
|
178
|
+
|
|
179
|
+
# 检查
|
|
180
|
+
twine check dist/*
|
|
181
|
+
|
|
182
|
+
# 上传
|
|
183
|
+
twine upload dist/*
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 冻结功能(Experimental)
|
|
189
|
+
|
|
190
|
+
以下功能已标记为 experimental,当前版本不维护但保留代码:
|
|
191
|
+
|
|
192
|
+
- `advanced_rag.py` - 复杂 RAG 系统
|
|
193
|
+
- `layers/` - 分层记忆架构
|
|
194
|
+
- `retrieval/adaptive.py` - 自适应检索
|
|
195
|
+
- `rmt/` - 循环记忆传递
|
|
196
|
+
- `knowledge_graph/` - 知识图谱
|
|
197
|
+
|
|
198
|
+
这些功能在 `memory/` 目录中带有 README 说明。
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 参考文档
|
|
203
|
+
|
|
204
|
+
| 文档 | 路径 | 说明 |
|
|
205
|
+
|------|------|------|
|
|
206
|
+
| 愿景 | `docs/VISION.md` | 产品定位 |
|
|
207
|
+
| 路线图 | `docs/ROADMAP.md` | 开发计划 |
|
|
208
|
+
| API | `docs/API.md` | API 参考 |
|
|
209
|
+
| CLI | `docs/CLI.md` | CLI 参考 |
|
|
210
|
+
| 安装 | `INSTALL.md` | 安装指南 |
|
|
211
|
+
| 贡献 | `CONTRIBUTING.md` | 贡献指南 |
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
**版本**: 0.2.0
|
|
216
|
+
**最后更新**: 2026-03-25
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to MemNexus will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2026-03-25
|
|
11
|
+
|
|
12
|
+
### 🎉 First Public Release - Code Memory for AI Programming Tools
|
|
13
|
+
|
|
14
|
+
This is the first public release of MemNexus as a **Code Memory** tool for AI programming assistants.
|
|
15
|
+
|
|
16
|
+
### ✨ New Features
|
|
17
|
+
|
|
18
|
+
#### Core Memory System
|
|
19
|
+
- **CodeMemory** - Main entry point for library usage
|
|
20
|
+
- **Vector Storage** - LanceDB-based semantic search
|
|
21
|
+
- **MemoryStore** - Add, search, and manage memory entries
|
|
22
|
+
|
|
23
|
+
#### Git Integration
|
|
24
|
+
- **GitMemoryExtractor** - Extract commit history from Git repositories
|
|
25
|
+
- **Commit Indexing** - Index commit messages, authors, and file changes
|
|
26
|
+
- **Semantic Search** - Search Git history with natural language
|
|
27
|
+
- **File History** - Get complete history for specific files
|
|
28
|
+
|
|
29
|
+
#### Code Parsing
|
|
30
|
+
- **CodeParser** - Parse Python code using AST
|
|
31
|
+
- **Symbol Extraction** - Extract functions, classes, and methods
|
|
32
|
+
- **Import Analysis** - Extract and analyze import statements
|
|
33
|
+
- **CodeChunker** - Create embeddable code chunks with context
|
|
34
|
+
- **Signature Extraction** - Capture function signatures with type annotations
|
|
35
|
+
|
|
36
|
+
#### CLI Interface
|
|
37
|
+
- **memnexus init** - Initialize project for memory tracking
|
|
38
|
+
- **memnexus index** - Index Git history and/or code
|
|
39
|
+
- **memnexus search** - Search project memory
|
|
40
|
+
- **memnexus status** - Check project indexing status
|
|
41
|
+
- **memnexus server** - Start HTTP API server
|
|
42
|
+
|
|
43
|
+
#### HTTP API
|
|
44
|
+
- `GET /health` - Health check
|
|
45
|
+
- `GET /stats` - Project statistics
|
|
46
|
+
- `GET /api/v1/search` - Search all memories
|
|
47
|
+
- `POST /api/v1/memory` - Add memory entry
|
|
48
|
+
- `POST /api/v1/git/index` - Index Git history
|
|
49
|
+
- `GET /api/v1/git/search` - Search Git history
|
|
50
|
+
- `POST /api/v1/code/index` - Index codebase
|
|
51
|
+
- `GET /api/v1/code/search` - Search code symbols
|
|
52
|
+
- `GET /api/v1/code/symbol/{name}` - Find specific symbol
|
|
53
|
+
|
|
54
|
+
#### Kimi CLI Plugin
|
|
55
|
+
- **Plugin Support** - Native integration with Kimi CLI 1.25.0+
|
|
56
|
+
- **6 Tools** - memory_search, memory_store, memory_status, memory_index, find_symbol, get_file_history
|
|
57
|
+
- **Slash Commands** - `/memory search`, `/memory store`, `/memory status`, etc.
|
|
58
|
+
|
|
59
|
+
### 🐛 Known Issues
|
|
60
|
+
|
|
61
|
+
- Code parsing currently only supports Python
|
|
62
|
+
- TypeScript/JavaScript support coming in next release
|
|
63
|
+
- Large repositories may require tuning batch sizes
|
|
64
|
+
|
|
65
|
+
### 📁 New Files
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
src/memnexus/
|
|
69
|
+
├── __init__.py # Main exports
|
|
70
|
+
├── code_memory.py # Core CodeMemory class
|
|
71
|
+
├── cli.py # CLI interface
|
|
72
|
+
├── server.py # FastAPI server
|
|
73
|
+
├── memory/
|
|
74
|
+
│ ├── git.py # Git integration
|
|
75
|
+
│ ├── code.py # Code parsing
|
|
76
|
+
│ └── store.py # Vector storage
|
|
77
|
+
└── scripts/
|
|
78
|
+
└── kimi_plugin.py # Kimi CLI plugin
|
|
79
|
+
|
|
80
|
+
~/.kimi/plugins/memnexus/
|
|
81
|
+
├── plugin.json # Plugin manifest
|
|
82
|
+
└── SKILL.md # Plugin documentation
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 📊 Statistics
|
|
86
|
+
|
|
87
|
+
- Total Lines of Code: ~5,000
|
|
88
|
+
- Python Files: 15
|
|
89
|
+
- Test Coverage: Core functionality tested
|
|
90
|
+
- Documentation: Complete user guides
|
|
91
|
+
|
|
92
|
+
## [0.1.0] - 2026-02-20 (Internal)
|
|
93
|
+
|
|
94
|
+
### Initial Prototype
|
|
95
|
+
|
|
96
|
+
> **Note:** This was an internal prototype with a different focus (Multi-Agent Orchestration).
|
|
97
|
+
> The project was significantly refactored for the 0.2.0 release.
|
|
98
|
+
|
|
99
|
+
Original features:
|
|
100
|
+
- Multi-Agent Collaboration Orchestration
|
|
101
|
+
- ACP Protocol implementation
|
|
102
|
+
- LlamaIndex RAG Pipeline
|
|
103
|
+
- React Frontend
|
|
104
|
+
- Task Scheduler and Intervention System
|
|
105
|
+
|
|
106
|
+
[0.2.0]: https://github.com/Leeelics/MemNexus/releases/tag/v0.2.0
|
|
107
|
+
[0.1.0]: https://github.com/Leeelics/MemNexus/releases/tag/v0.1.0
|