|
| 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`* |
0 commit comments