documentation work#26
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive documentation suite for the Structural Memory Protocol (SMP), including an API reference, architecture guide, contributing guidelines, and a user guide, while also overhauling the README to emphasize its AI-first design and MCP integration. The review identifies several critical discrepancies where the documentation does not align with the current codebase, such as missing documentation for the smp/impact and smp/trace methods, incorrect parameter and return structures for smp/locate and smp/search, and the mention of a non-existent smp query CLI command. Additionally, the architecture guide incorrectly attributes the Louvain algorithm implementation to Neo4j GDS instead of the custom Python implementation used in the code.
|
|
||
| --- | ||
|
|
||
| ## 🔍 Discovery & Search |
There was a problem hiding this comment.
| - `seed_k` (int, optional): Number of initial vector seeds. Default: 3. | ||
| - `hops` (int, optional): Depth of graph traversal. Default: 2. | ||
| - `top_k` (int, optional): Number of final results. Default: 10. | ||
| - **Returns:** `LocateResponse` containing ranked results and a structural map of relationships. |
There was a problem hiding this comment.
There are several discrepancies between the documentation and the implementation of smp/locate:
- The parameters
seed_kandhopsare listed as optional, but theSeedWalkEngine.locatemethod (smp/engine/seed_walk.py:347) does not accept them; they are hardcoded to defaults inside the method. - The return type is documented as
LocateResponse, but theLocateHandler(smp/protocol/handlers/query.py:108) wraps the result in a{"matches": ...}object. SeedWalkEngine.locatereturns a list containing the response dictionary, which results in a nested structure:{"matches": [{...}]}.
| - `tags` (list): e.g., `["billing"]`. | ||
| - `scope` (string): e.g., `"package:src/payments"`. | ||
| - `top_k` (int): Number of results. | ||
| - **Returns:** List of matches ranked by BM25 score. |
There was a problem hiding this comment.
| - Source hashes (to detect when a node becomes "stale" and needs re-enrichment). | ||
|
|
||
| ### 4. Community Detection | ||
| SMP uses the **Louvain Algorithm** via Neo4j GDS to partition the graph into two levels of structural clusters: |
There was a problem hiding this comment.
| "id": 1 | ||
| }' | ||
| # Query the intelligence layer | ||
| smp query "Where is the authentication logic handled?" |
| ### 2. Querying the Intelligence Layer | ||
| Once ingested, you can ask natural language questions. | ||
| ```bash | ||
| smp query "Find the part of the code that handles JWT validation" |
No description provided.