Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2026-01-11

### 🏗️ Major Refactoring Release

Complete architectural overhaul for better maintainability and performance.

### Changed

#### Modular Architecture
- **Refactored from single file to multi-module structure**
- From: `memory.rs` (2505 lines, monolithic)
- To: 35+ files in 8 organized modules
- **New module structure:**
- `src/types/` - Core data models (Entity, Relation, KnowledgeGraph)
- `src/protocol/` - JSON-RPC and MCP protocol handling
- `src/knowledge_base/` - Core engine with CRUD, queries, temporal
- `src/tools/` - 15 MCP tools organized by category (memory, query, temporal)
- `src/search/` - Semantic search with synonym expansion
- `src/server/` - MCP server implementation
- `src/validation/` - Entity and relation type validation
- `src/utils/` - Timestamp and user utilities
- **Library + Binary separation**
- `src/lib.rs` - Public API for embedding
- `src/main.rs` - Minimal binary entry point

#### Performance Optimization
- **Mutex → RwLock migration** for `KnowledgeBase.graph`
- Allows multiple concurrent readers (60% of operations are reads)
- Write operations still have exclusive access
- Significant performance boost for multi-agent scenarios
- **Documentation:** See `docs/Proposed-RwLock.md` for risk analysis

#### Docker
- Updated `Dockerfile` for new `src/` directory structure
- Better layer caching with separate Cargo.toml and src copies

### Added
- `src/lib.rs` - Library crate for embedding in other projects
- `tests/integration_tests.rs` - 8 integration tests including concurrency tests
- `docs/Proposed-RwLock.md` - RwLock migration documentation

### Technical Details
- **Test suite expanded:** 16 tests (7 unit + 8 integration + 1 doc)
- **Zero-cost abstractions:** No runtime overhead from modularization
- **Backward compatible:** All 15 MCP tools unchanged

---

## [1.0.0] - 2026-01-11

### 🎉 Initial Release
Expand Down Expand Up @@ -74,3 +122,4 @@ First production-ready release of Memory Graph MCP Server.
- Multi-tenant support
- WAL (Write-Ahead Log) for large graphs
- Import/Export with external knowledge bases
- `parking_lot::RwLock` upgrade if benchmarks show bottleneck
125 changes: 123 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
[package]
name = "memory-server"
version = "1.0.0"
name = "memory-graph"
version = "1.1.0"
edition = "2021"
authors = ["Memory Graph MCP Server"]
description = "A knowledge graph MCP server implementing the Model Context Protocol"
license = "MIT"
readme = "README.md"
repository = "https://github.com/maithanhduyan/memory-graph"
keywords = ["mcp", "knowledge-graph", "ai", "memory", "llm"]
categories = ["development-tools", "data-structures"]

[lib]
name = "memory_graph"
path = "src/lib.rs"

[[bin]]
name = "memory-server"
path = "memory.rs"
path = "src/main.rs"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[dev-dependencies]
tempfile = "3"

[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true

[profile.dev]
opt-level = 0
debug = true
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ RUN apk add --no-cache musl-dev

WORKDIR /app

# Copy all source files
COPY Cargo.toml Cargo.lock* memory.rs ./
# Copy Cargo files first (for better layer caching)
COPY Cargo.toml Cargo.lock* ./

# Copy source directory with full structure
COPY src/ ./src/

# Build for release
RUN cargo build --release
Expand Down
Loading