Skip to content

Commit a8e2410

Browse files
Patrick Roebuckclaude
andcommitted
feat: Add comprehensive MemDocs memory for core modules
Commit git-native AI memory generated from enhanced module docstrings. Memory Includes: - Symbols: 54 documented functions and classes - Embeddings: Semantic search enabled via FAISS - Summaries: Module-level documentation for 6 core components - Cursor Integration: .cursorrules for IDE assistant context Demonstrates MemDocs dogfooding - using MemDocs to document itself with production-quality git-committed memory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 1b02247 commit a8e2410

File tree

12 files changed

+2785
-0
lines changed

12 files changed

+2785
-0
lines changed

.cursorrules

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
# Project Memory (Auto-generated by doc-intelligence)
2+
# Last updated: 2025-11-13 23:33:14
3+
4+
## 📚 Documentation
5+
6+
# Enhanced module docstrings for core engine components
7+
8+
**Commit:** 1b02247
9+
**Scope:** Module-level
10+
**Date:** 2025-11-14
11+
12+
## Summary
13+
14+
- Enhanced module docstrings for core engine components
15+
Added comprehensive module-level documentation to 6 core MemDocs modules (mcp_server, extract, embeddings, search, summarize, policy) describing their purpose, capabilities, and architectural role. Clarifies flagship MCP integration, multi-language symbol extraction, zero-cost local embeddings, FAISS-based vector search, Claude-powered summarization, and intelligent scope escalation.
16+
- Dogfooding: Committed .memdocs/ directory for self-documentation
17+
Modified .gitignore to allow committing .memdocs/ directory, demonstrating MemDocs usage on its own codebase with git-committed memories.
18+
19+
## Changes
20+
21+
22+
**Modified:** 7 files
23+
- .gitignore
24+
- memdocs/embeddings.py
25+
- memdocs/extract.py
26+
- memdocs/mcp_server.py
27+
- memdocs/policy.py
28+
29+
## Risks
30+
31+
- repository_size
32+
- documentation_only
33+
34+
## References
35+
36+
- Commit: 1b02247
37+
38+
39+
## 🗺️ Code Map
40+
41+
42+
### memdocs/embeddings.py
43+
44+
- **class** `LocalEmbedder` (line 20)
45+
- **function** `embed_documents` (line 76)
46+
```
47+
def embed_documents(self, texts: list[str])
48+
```
49+
- **function** `embed_query` (line 98)
50+
```
51+
def embed_query(self, query: str)
52+
```
53+
- **function** `chunk_document` (line 111)
54+
```
55+
def chunk_document(text: str, max_tokens: int = 512, overlap: int = 50)
56+
```
57+
- **function** `load_embeddings` (line 197)
58+
```
59+
def load_embeddings(embeddings_file: Path)
60+
```
61+
62+
### memdocs/extract.py
63+
64+
- **class** `GitDiff` (line 40)
65+
- **class** `FileContext` (line 54)
66+
- **class** `ExtractedContext` (line 66)
67+
- **class** `Extractor` (line 74)
68+
- **function** `__init__` (line 77)
69+
```
70+
def __init__(self, repo_path: Path = Path(".")
71+
```
72+
- **function** `extract_diff` (line 90)
73+
```
74+
def extract_diff(self, commit: str | None = None)
75+
```
76+
- **function** `extract_file_context` (line 145)
77+
```
78+
def extract_file_context(self, file_path: Path)
79+
```
80+
- **function** `extract_context` (line 201)
81+
```
82+
def extract_context(self, paths: list[Path], commit: str | None = None)
83+
```
84+
- **function** `_expand_paths` (line 226)
85+
```
86+
def _expand_paths(self, paths: list[Path])
87+
```
88+
- **function** `_find_code_files` (line 248)
89+
```
90+
def _find_code_files(self, directory: Path)
91+
```
92+
- **function** `_glob_files` (line 279)
93+
```
94+
def _glob_files(self, pattern: Path)
95+
```
96+
- **function** `_extract_symbols` (line 295)
97+
```
98+
def _extract_symbols(self, file_path: Path, content: str, language: str)
99+
```
100+
- **function** `_extract_python_symbols` (line 317)
101+
```
102+
def _extract_python_symbols(self, file_path: Path, content: str)
103+
```
104+
- **function** `_extract_typescript_symbols` (line 375)
105+
```
106+
def _extract_typescript_symbols(self, file_path: Path, content: str)
107+
```
108+
- **function** `_extract_class_methods` (line 420)
109+
```
110+
def _extract_class_methods(self, class_lines: list[str])
111+
```
112+
- **function** `_extract_imports` (line 436)
113+
```
114+
def _extract_imports(self, content: str, language: str)
115+
```
116+
- **function** `_parse_dependencies` (line 457)
117+
```
118+
def _parse_dependencies(self, repo_root: Path, language: str)
119+
```
120+
- **function** `_parse_requirements_txt` (line 488)
121+
```
122+
def _parse_requirements_txt(self, repo_root: Path)
123+
```
124+
- **function** `_parse_pyproject_toml` (line 519)
125+
```
126+
def _parse_pyproject_toml(self, repo_root: Path)
127+
```
128+
- **function** `_parse_package_json` (line 562)
129+
```
130+
def _parse_package_json(self, repo_root: Path)
131+
```
132+
133+
### memdocs/mcp_server.py
134+
135+
- **class** `DocIntMCPServer` (line 27)
136+
- **function** `__init__` (line 36)
137+
```
138+
def __init__(self, repo_path: Path = Path(".")
139+
```
140+
- **function** `search_memory` (line 60)
141+
```
142+
def search_memory(self, query: str, k: int = 5)
143+
```
144+
- **function** `get_symbols` (line 95)
145+
```
146+
def get_symbols(self, file_path: str | None = None)
147+
```
148+
- **function** `get_documentation` (line 121)
149+
```
150+
def get_documentation(self, doc_id: str | None = None)
151+
```
152+
- **function** `get_summary` (line 147)
153+
```
154+
def get_summary(self)
155+
```
156+
157+
### memdocs/policy.py
158+
159+
- **class** `PolicyEngine` (line 20)
160+
- **function** `__init__` (line 23)
161+
```
162+
def __init__(self, config: DocIntConfig)
163+
```
164+
- **function** `_infer_scope_from_paths` (line 73)
165+
```
166+
def _infer_scope_from_paths(self, paths: list[Path])
167+
```
168+
- **function** `_is_directory_pattern` (line 96)
169+
```
170+
def _is_directory_pattern(self, path: Path)
171+
```
172+
- **function** `_are_paths_in_same_module` (line 107)
173+
```
174+
def _are_paths_in_same_module(self, paths: list[Path])
175+
```
176+
- **function** `_should_escalate` (line 122)
177+
```
178+
def _should_escalate(self, context: ExtractedContext)
179+
```
180+
- **function** `_touches_security_paths` (line 150)
181+
```
182+
def _touches_security_paths(self, context: ExtractedContext)
183+
```
184+
- **function** `_has_cross_module_changes` (line 168)
185+
```
186+
def _has_cross_module_changes(self, context: ExtractedContext)
187+
```
188+
- **function** `_modifies_public_api` (line 185)
189+
```
190+
def _modifies_public_api(self, context: ExtractedContext)
191+
```
192+
- **function** `_escalate_scope` (line 210)
193+
```
194+
def _escalate_scope(self, current_scope: ScopeLevel)
195+
```
196+
- **function** `validate_scope` (line 226)
197+
```
198+
def validate_scope(self, scope: ScopeInfo)
199+
```
200+
201+
### memdocs/search.py
202+
203+
- **class** `LocalVectorSearch` (line 16)
204+
- **function** `remove_by_indices` (line 165)
205+
```
206+
def remove_by_indices(self, indices: list[int])
207+
```
208+
- **function** `rebuild_index` (line 181)
209+
```
210+
def rebuild_index(self)
211+
```
212+
- **function** `save` (line 216)
213+
```
214+
def save(self)
215+
```
216+
- **function** `_load_metadata` (line 225)
217+
```
218+
def _load_metadata(self)
219+
```
220+
- **function** `get_stats` (line 233)
221+
```
222+
def get_stats(self)
223+
```
224+
225+
### memdocs/summarize.py
226+
227+
- **class** `Summarizer` (line 29)
228+
- **function** `__repr__` (line 142)
229+
```
230+
def __repr__(self)
231+
```
232+
- **function** `summarize` (line 147)
233+
```
234+
def summarize(self, context: ExtractedContext, scope: ScopeInfo)
235+
```
236+
- **function** `_build_prompt` (line 199)
237+
```
238+
def _build_prompt(self, context: ExtractedContext, scope: ScopeInfo)
239+
```
240+
- **function** `_extract_yaml` (line 254)
241+
```
242+
def _extract_yaml(self, text: str)
243+
```
244+
- **function** `_generate_markdown` (line 339)
245+
```
246+
def _generate_markdown(self, doc_index: DocumentIndex, context: ExtractedContext)
247+
```
248+
249+
250+
251+
## 🔗 Memory Graph
252+
253+
**Recent Features:**
254+
- Enhanced module docstrings for core engine components
255+
- Dogfooding: Committed .memdocs/ directory for self-documentation
256+
257+
258+
---
259+
260+
## 💡 Tips for Cursor
261+
262+
- Ask: "What does [function_name] do?"
263+
- Ask: "Where is [feature] implemented?"
264+
- Ask: "Explain the architecture"
265+
- Reference symbols by file:line (e.g., src/auth/jwt.py:33)
266+
267+
---
268+
269+
*Generated by [doc-intelligence](https://github.com/deepstudyai/memdocs)*
270+
*Regenerate with: `memdocs export cursor`*

.memdocs/cursor

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Project Memory (Auto-generated by doc-intelligence)
2+
# Last updated: 2025-11-08 07:39:09
3+
4+
## 📚 Documentation
5+
6+
# Core schema definitions for MemDocs v2.0.0 memory system
7+
8+
**Commit:** 588a035
9+
**Scope:** File-level
10+
**Date:** 2025-11-08
11+
12+
## Summary
13+
14+
- Core schema definitions for MemDocs v2.0.0 memory system
15+
Defines foundational enums and dataclasses for scope levels (FILE/MODULE/REPO), event types, PHI privacy modes, symbol kinds, and policy configuration. Establishes type system for git-native AI memory with empathy framework support.
16+
- ScopeLevel enum for hierarchical context management
17+
Introduces FILE/MODULE/REPO scope levels with auto-escalation support for context-aware memory operations. Enables token-efficient scoping strategy.
18+
- EventType enum for memory event classification
19+
Defines event taxonomy (CREATION/MODIFICATION/DELETION/QUERY/SUMMARIZATION/ESCALATION/ERROR) for tracking memory operations and system behavior.
20+
- PHIMode enum for privacy guard configuration
21+
Implements OFF/DETECT/REDACT modes for PHI/PII handling in medical AI applications. Supports HIPAA-aligned privacy controls.
22+
- SymbolKind enum for code entity classification
23+
Categorizes code symbols (CLASS/FUNCTION/METHOD/VARIABLE/CONSTANT/IMPORT/TYPE_ALIAS/DECORATOR/PROPERTY/ASYNC_FUNCTION) for semantic analysis and documentation generation.
24+
- PolicyConfig dataclass for system behavior configuration
25+
Centralized configuration for auto-escalation thresholds, empathy integration, Claude model selection, and privacy guards. Supports Level 4 Anticipatory Intelligence.
26+
27+
## Changes
28+
29+
30+
**Modified:** 8 files
31+
- memdocs/__init__.py
32+
- memdocs/cli.py
33+
- memdocs/embeddings.py
34+
- memdocs/empathy_adapter.py
35+
- memdocs/guard.py
36+
37+
## Impact
38+
39+
**APIs affected:** memdocs.schemas.ScopeLevel, memdocs.schemas.EventType, memdocs.schemas.PHIMode, memdocs.schemas.SymbolKind, memdocs.schemas.PolicyConfig
40+
41+
**Breaking changes:**
42+
- New schema definitions in MemDocs v2.0.0 break compatibility with DocInt 1.0
43+
- PolicyConfig dataclass replaces previous configuration approach
44+
- Enum-based type system requires migration from string-based types
45+
46+
## Risks
47+
48+
- validation
49+
- security
50+
- type_safety
51+
- logging
52+
- parsing
53+
- observability
54+
- configuration
55+
- compliance
56+
- breaking
57+
- api_contract
58+
- privacy
59+
60+
## References
61+
62+
- Commit: 588a035
63+
64+
65+
## 🗺️ Code Map
66+
67+
68+
### memdocs/schemas.py
69+
70+
- **class** `ScopeLevel` (line 15)
71+
- **class** `EventType` (line 23)
72+
- **class** `PHIMode` (line 33)
73+
- **class** `SymbolKind` (line 41)
74+
- **class** `PolicyConfig` (line 56)
75+
- **class** `PrivacyConfig` (line 70)
76+
- **class** `OutputsConfig` (line 78)
77+
- **class** `RetentionConfig` (line 88)
78+
- **class** `AIConfig` (line 95)
79+
- **class** `DocIntConfig` (line 104)
80+
- **function** `validate_version` (line 116)
81+
```
82+
def validate_version(cls, v: int)
83+
```
84+
- **class** `Symbol` (line 125)
85+
- **class** `SymbolsOutput` (line 137)
86+
- **class** `FeatureSummary` (line 143)
87+
- **class** `ImpactSummary` (line 153)
88+
- **class** `ReferenceSummary` (line 163)
89+
- **class** `ScopeInfo` (line 172)
90+
- **class** `DocumentIndex` (line 182)
91+
- **function** `serialize_datetime` (line 197)
92+
```
93+
def serialize_datetime(self, dt: datetime, _info)
94+
```
95+
- **class** `RedactionEvent` (line 201)
96+
- **class** `ReviewResult` (line 210)
97+
- **function** `serialize_outputs` (line 224)
98+
```
99+
def serialize_outputs(self, outputs: dict[str, Path], _info)
100+
```
101+
102+
103+
104+
## 🔗 Memory Graph
105+
106+
**Recent Features:**
107+
- Core schema definitions for MemDocs v2.0.0 memory system
108+
- ScopeLevel enum for hierarchical context management
109+
- EventType enum for memory event classification
110+
- PHIMode enum for privacy guard configuration
111+
- SymbolKind enum for code entity classification
112+
113+
114+
---
115+
116+
## 💡 Tips for Cursor
117+
118+
- Ask: "What does [function_name] do?"
119+
- Ask: "Where is [feature] implemented?"
120+
- Ask: "Explain the architecture"
121+
- Reference symbols by file:line (e.g., src/auth/jwt.py:33)
122+
123+
---
124+
125+
*Generated by [doc-intelligence](https://github.com/deepstudyai/memdocs)*
126+
*Regenerate with: `memdocs export cursor`*

0 commit comments

Comments
 (0)