Skip to content

Commit 451f7a6

Browse files
SonAIengineclaude
andcommitted
docs: 영문화 + CI/CD + CONTRIBUTING + CHANGELOG — 글로벌 오픈소스 준비
- README.md 전체 영문 번역 (Quick Start, 벤치마크, 아키텍처 등) - 핵심 모듈 15개 docstring/주석 영문화 (코드 로직 변경 없음) - GitHub Actions CI 추가 (lint + test, Python 3.12, uv) - CONTRIBUTING.md 생성 (setup, test, PR guidelines) - CHANGELOG.md 생성 (v0.1.0~v0.7.0 Keep a Changelog 포맷) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9d370f4 commit 451f7a6

18 files changed

Lines changed: 714 additions & 588 deletions

.github/workflows/ci.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,54 @@ on:
77
branches: [main]
88

99
jobs:
10-
check:
10+
lint:
1111
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: ["3.12", "3.13"]
15-
1612
steps:
1713
- uses: actions/checkout@v4
1814

1915
- name: Install uv
20-
uses: astral-sh/setup-uv@v4
16+
uses: astral-sh/setup-uv@v5
17+
18+
- name: Set up Python 3.12
19+
run: uv python install 3.12
2120

22-
- name: Set up Python ${{ matrix.python-version }}
23-
run: uv python install ${{ matrix.python-version }}
21+
- name: Cache uv
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/uv
25+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
26+
restore-keys: uv-${{ runner.os }}-
2427

2528
- name: Install dependencies
26-
run: uv sync --extra dev --extra sqlite
29+
run: uv sync --extra dev
2730

2831
- name: Ruff check
2932
run: uv run ruff check
3033

31-
- name: Ruff format
34+
- name: Ruff format check
3235
run: uv run ruff format --check
3336

34-
- name: Pyright
35-
run: uv run pyright
37+
test:
38+
runs-on: ubuntu-latest
39+
needs: lint
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v5
45+
46+
- name: Set up Python 3.12
47+
run: uv python install 3.12
48+
49+
- name: Cache uv
50+
uses: actions/cache@v4
51+
with:
52+
path: ~/.cache/uv
53+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
54+
restore-keys: uv-${{ runner.os }}-
55+
56+
- name: Install dependencies
57+
run: uv sync --extra dev --extra sqlite
3658

37-
- name: Tests
38-
run: uv run pytest -v
59+
- name: Run tests
60+
run: uv run pytest tests/ --ignore=tests/test_backend_postgresql.py --ignore=tests/benchmark --ignore=tests/qa -x -q

CHANGELOG.md

Lines changed: 92 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,112 @@
11
# Changelog
22

3-
## v0.5.0 (2026-03-21)
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6+
7+
## [Unreleased]
8+
9+
### Changed
10+
- Refactored README Quick Start to use factory functions.
11+
- Refactored public API: factory functions, type stubs, reduced code duplication.
12+
13+
## [0.7.0] - 2026-03-22
414

515
### Added
6-
- **Ontology Engine** — 동적 타입 계층, 속성 상속, 관계 제약 검증 (`OntologyRegistry`, `TypeDef`, `PropertyDef`, `RelationConstraint`)
7-
- **Agent Activity Tracking** — 세션/tool call/decision/outcome 캡처 (`ActivityTracker`)
8-
- **Intent-based Agent Search** — 6가지 검색 전략: similar_decisions, past_failures, related_rules, reasoning_chain, context_explore, general (`AgentSearch`, `SearchIntent`)
9-
- **Intent 자동 추론** — 쿼리 키워드에서 intent 자동 판별 (`suggest_intent()`, `intent="auto"` 기본값)
10-
- **Neo4j Backend** — native Cypher 그래프 순회, dual label, typed relationship, fulltext index
11-
- **GraphTraversal Protocol**`shortest_path()`, `pattern_match()`, `find_by_type_hierarchy()`
12-
- **5축 Resonance Scoring** — context axis 추가 (세션 태그 Jaccard 유사도)
13-
- **Node.properties** — 온톨로지 확장 속성 (dict[str, str]), 전 백엔드 지원
14-
- **Ontology 영속화**`save_ontology()` / `load_ontology()`로 그래프에 저장/복원
15-
- **L3 강등 메커니즘** — 성공률 60% 미만 시 L3 → L2 강등
16-
- **Consolidation 페이지네이션** — limit=1000 제한 제거, 전체 노드 배치 처리
17-
- **link() 온톨로지 검증** — 관계 제약 위반 시 ValueError 발생
18-
- **Hebbian adaptive learning rate**`delta / (1 + 0.02 × maturity)`로 초기 빠른 학습, 이후 안정화
19-
- **HybridSearch node_kinds 필터** — 검색 시 노드 타입 필터링
20-
- **기본 에이전트 온톨로지**`build_agent_ontology()`로 knowledge/agent_activity 타입 트리 제공
21-
- **MCP 9개 tool 추가** (총 16개): agent_start_session, agent_log_action, agent_record_decision, agent_record_outcome, agent_find_similar, agent_get_reasoning_chain, agent_explore_context, ontology_define_type, ontology_query_schema
22-
- **NodeKind 6개 추가**: tool_call, observation, reasoning, outcome, session, type_def
23-
- **EdgeKind 5개 추가**: is_a, invoked, resulted_in, part_of, followed_by
24-
- `docker-compose.yml` — Neo4j 개발 환경
25-
- `docs/COMPARISON.md` — 기존 Agent Memory 시스템 비교 분석
26-
- 185+ unit tests, 22 Neo4j integration tests
16+
- **Evidence Chain Assembly** — small LLM augmentation for multi-hop reasoning, HotPotQA Correctness 0.856 (+9.2%).
17+
- **Personalized PageRank (PPR) engine** — replaced spreading activation, multi-hop retrieval +28%.
18+
- **End-to-end QA benchmark** — HotPotQA 24-question suite for Cognee comparison (Correctness 0.784).
19+
- **Auto-ontology optimization** — HybridClassifier, batch LLM processing, EmbeddingRelation, PhraseExtractor.
20+
21+
### Fixed
22+
- PhraseExtractor search noise — phrase filtering and optimization.
2723

2824
### Changed
29-
- `graph.agent_search()` 기본 intent가 `"auto"` (키워드 기반 자동 추론)
30-
- `ResonanceWeights``context` 필드 추가 (기본값 0.0, 하위호환)
31-
- SQLite/PostgreSQL backend에 `properties_json` 컬럼 자동 마이그레이션 (v0.4 → v0.5)
32-
- pyproject.toml: `neo4j`, `scale` extras 추가, version 0.5.0
25+
- Removed `__pycache__` from repo and updated `.gitignore`.
26+
27+
## [0.6.0] - 2026-03-21
28+
29+
### Added
30+
- **Auto-ontology construction** — LLM-based ontology building with search-optimized metadata generation.
31+
- **LLM classifier prompt optimization** — few-shot examples improved accuracy from 50% to 86%.
32+
- **FTS + embedding hybrid scoring** — S7 Auto+Embed achieved MRR 0.83.
33+
- **Kind/tag/search_keywords utilization** in search — FTS and ranking boost.
34+
- **Ontology auto-construction + benchmark framework + search engine improvements** (combined release).
35+
36+
### Changed
37+
- Updated README with auto-ontology, benchmark results, and differentiation points.
38+
39+
## [0.5.0] - 2026-03-21
40+
41+
### Added
42+
- **Ontology Engine** — dynamic type hierarchy, property inheritance, relation constraint validation (`OntologyRegistry`).
43+
- **Agent Activity Tracking** — session/tool call/decision/outcome capture (`ActivityTracker`).
44+
- **Intent-based Agent Search** — 6 search strategies: similar_decisions, past_failures, related_rules, reasoning_chain, context_explore, general (`AgentSearch`).
45+
- **Neo4j Backend** — native Cypher graph traversal, dual label, typed relationships, fulltext index.
46+
- **Auto-embedding** — automatic vector generation on `add()` / `search()`.
47+
- **Qdrant + MinIO + CompositeBackend** — storage separation by purpose.
48+
- **5-axis Resonance Scoring** — added context axis (session tag Jaccard similarity).
49+
- **GraphTraversal Protocol**`shortest_path()`, `pattern_match()`, `find_by_type_hierarchy()`.
50+
- **Node.properties** — ontology extension attributes, supported across all backends.
51+
- **MCP 9 new tools** (total 16): agent session/action/decision/outcome tracking, ontology tools.
52+
- 6 new `NodeKind` values: tool_call, observation, reasoning, outcome, session, type_def.
53+
- 5 new `EdgeKind` values: is_a, invoked, resulted_in, part_of, followed_by.
54+
- `docker-compose.yml` for Neo4j dev environment.
55+
- `docs/COMPARISON.md` — comparison with existing agent memory systems.
56+
- 185+ unit tests, 22 Neo4j integration tests.
57+
58+
### Fixed
59+
- MemoryBackend fuzzy search ineffectiveness bug + 12 edge case QA tests added.
60+
- Library distribution quality: `__version__`, `py.typed`, lazy imports, embedding extra.
3361

34-
## v0.4.0 (2026-03-21)
62+
## [0.4.0] - 2026-03-21
3563

3664
### Added
37-
- **MCP Server**7개 tool (knowledge_search/add/link/reinforce/stats/export/consolidate)
38-
- **SQLite Backend** — FTS5, recursive CTE, WAL mode
39-
- **QA Test Suite** — Wikipedia 169건 + GitHub 368건 실제 데이터 검증
40-
- `synaptic-mcp` CLI entry point
65+
- **MCP Server**7 tools (knowledge search/add/link/reinforce/stats/export/consolidate).
66+
- **SQLite Backend** — FTS5, recursive CTE, WAL mode.
67+
- **QA Test Suite**169 Wikipedia + 368 GitHub real-data verification cases.
68+
- `synaptic-mcp` CLI entry point.
4169

42-
## v0.3.0 (2026-03-21)
70+
## [0.3.0] - 2026-03-21
4371

4472
### Added
45-
- **Protocol 구현체** — LLM QueryRewriter, RegexTagExtractor, EmbeddingProvider
46-
- **LRU Cache** — NodeCache with hit rate tracking
47-
- **JSON Exporter**구조화된 JSON export
48-
- **Node Merge**중복 노드 병합 + 엣지 재연결
49-
- **Find Duplicates**제목 유사도 기반 중복 탐지
73+
- **Protocol implementations** — LLM QueryRewriter, RegexTagExtractor, EmbeddingProvider.
74+
- **LRU Cache** — NodeCache with hit rate tracking.
75+
- **JSON Exporter**structured JSON export.
76+
- **Node Merge**duplicate node merging with edge reconnection.
77+
- **Find Duplicates**title similarity-based duplicate detection.
5078

51-
## v0.2.0 (2026-03-21)
79+
## [0.2.0] - 2026-03-21
5280

5381
### Added
54-
- **PostgreSQL backend** — asyncpg + pgvector HNSW + pg_trgm + recursive CTE
55-
- Vector search with cosine distance (pgvector)
56-
- Trigram fuzzy matching with graceful ILIKE fallback
57-
- Hybrid search method: FTS + fuzzy + vector merged results
58-
- Connection pooling (asyncpg Pool, min=2, max=10)
59-
- Configurable `embedding_dim` parameter
60-
- `execute_raw()` for admin/testing SQL
61-
- `ResonanceWeights` added to public exports
62-
- Configurable consolidation thresholds (TTL, promotion access counts)
63-
- Edge direction type safety: `Literal["both", "incoming", "outgoing"]`
64-
- SQLite batch operations with rollback on error
65-
- README.md, ARCHITECTURE.md, ROADMAP.md documentation
66-
- GitHub Actions CI (Python 3.12/3.13)
67-
- Integration test suite for PostgreSQL (13 tests)
82+
- **PostgreSQL backend** — asyncpg + pgvector HNSW + pg_trgm + recursive CTE.
83+
- Vector search with cosine distance (pgvector).
84+
- Trigram fuzzy matching with graceful ILIKE fallback.
85+
- Hybrid search: FTS + fuzzy + vector merged results.
86+
- Connection pooling (asyncpg Pool, min=2, max=10).
87+
- Configurable `embedding_dim` parameter.
88+
- `ResonanceWeights` added to public exports.
89+
- Configurable consolidation thresholds (TTL, promotion access counts).
90+
- README.md, ARCHITECTURE.md, ROADMAP.md documentation.
91+
- GitHub Actions CI (Python 3.12/3.13).
92+
- Integration test suite for PostgreSQL (13 tests).
6893

6994
### Changed
70-
- Consolidation constants now accept `__init__` parameters instead of module globals
95+
- Consolidation constants now accept `__init__` parameters instead of module globals.
7196

72-
## v0.1.0 (2026-03-21)
97+
## [0.1.0] - 2026-03-21
7398

7499
### Added
75-
- Core models: Node, Edge, ActivatedNode, SearchResult, DigestResult
76-
- Enums: NodeKind (9), EdgeKind (7), ConsolidationLevel (4)
77-
- Protocols: StorageBackend, Digester, QueryRewriter, TagExtractor
78-
- SynapticGraph facade: add, link, search, reinforce, consolidate, prune, decay
79-
- Hybrid 3-stage search: FTS + fuzzysynonym expansionquery rewrite
80-
- Hebbian learning engine: co-activation reinforcement with anti-resonance
81-
- 4-axis resonance scoring: relevance × importance × recency × vitality
82-
- Memory consolidation cascade: L0→L1→L2→L3 with TTL and promotion
83-
- Korean/English synonym map (38 groups)
84-
- Markdown exporter
85-
- MemoryBackend (dict-based, zero deps)
86-
- SQLiteBackend (FTS5, recursive CTE, WAL mode)
87-
- 93 unit tests, pyright strict, ruff clean
100+
- Core models: Node, Edge, ActivatedNode, SearchResult, DigestResult.
101+
- Enums: NodeKind (9), EdgeKind (7), ConsolidationLevel (4).
102+
- Protocols: StorageBackend, Digester, QueryRewriter, TagExtractor.
103+
- SynapticGraph facade: add, link, search, reinforce, consolidate, prune, decay.
104+
- Hybrid 3-stage search: FTS + fuzzy, synonym expansion, query rewrite.
105+
- Hebbian learning engine: co-activation reinforcement with anti-resonance.
106+
- 4-axis resonance scoring: relevance x importance x recency x vitality.
107+
- Memory consolidation cascade: L0 -> L1 -> L2 -> L3 with TTL and promotion.
108+
- Korean/English synonym map (38 groups).
109+
- Markdown exporter.
110+
- MemoryBackend (dict-based, zero dependencies).
111+
- SQLiteBackend (FTS5, recursive CTE, WAL mode).
112+
- 93 unit tests, pyright strict, ruff clean.

CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributing to Synaptic Memory
2+
3+
Thanks for your interest in contributing! This guide will help you get started.
4+
5+
## Prerequisites
6+
7+
- **Python 3.12+**
8+
- **[uv](https://docs.astral.sh/uv/)** — fast Python package manager
9+
10+
## Setup
11+
12+
```bash
13+
git clone https://github.com/PlateerLab/synaptic-memory.git
14+
cd synaptic-memory
15+
uv sync --extra dev --extra sqlite --extra neo4j --extra qdrant --extra minio
16+
```
17+
18+
## Running Tests
19+
20+
```bash
21+
# All tests (requires external services: Neo4j, Qdrant, MinIO)
22+
uv run pytest tests/ -v
23+
24+
# Skip external backends (recommended for most contributors)
25+
uv run pytest tests/ --ignore=tests/test_backend_postgresql.py --ignore=tests/benchmark --ignore=tests/qa -v
26+
```
27+
28+
## Linting
29+
30+
We use [Ruff](https://docs.astral.sh/ruff/) for linting and formatting:
31+
32+
```bash
33+
uv run ruff check --fix
34+
uv run ruff format
35+
```
36+
37+
Both checks must pass before merging. CI runs `ruff check` and `ruff format --check` automatically.
38+
39+
## Code Style
40+
41+
- **Ruff** handles all formatting and linting — no additional tools needed.
42+
- **Type hints are required** for all function signatures.
43+
- Keep imports sorted (Ruff handles this via `isort` rules).
44+
45+
## Pull Request Guidelines
46+
47+
1. **Create a feature branch** from `main` — do not push directly to `main`.
48+
2. **All tests must pass** before requesting review.
49+
3. **Use conventional commit messages**:
50+
- `feat:` new feature
51+
- `fix:` bug fix
52+
- `docs:` documentation only
53+
- `refactor:` code restructuring without behavior change
54+
- `test:` adding or updating tests
55+
- `chore:` maintenance tasks
56+
4. **Keep PRs focused** — one feature or fix per PR.
57+
5. **Add tests** for new functionality.
58+
59+
## Project Structure
60+
61+
```
62+
src/synaptic/
63+
├── graph.py # Main facade (SynapticGraph)
64+
├── search.py # Hybrid search engine
65+
├── agent_search.py # Intent-based agent search
66+
├── resonance.py # Multi-axis scoring
67+
├── hebbian.py # Co-activation learning
68+
├── consolidation.py # Memory consolidation cascade
69+
├── ontology.py # Type hierarchy & constraints
70+
├── activity.py # Agent activity tracking
71+
├── models.py # Core data models
72+
└── backends/ # Storage backends (Memory, SQLite, PostgreSQL, Neo4j, Qdrant, MinIO)
73+
```
74+
75+
## Questions?
76+
77+
Open an issue on GitHub — we're happy to help.

0 commit comments

Comments
 (0)