Skip to content

documentation work#26

Merged
offx-zinth merged 1 commit intomainfrom
master
Apr 19, 2026
Merged

documentation work#26
offx-zinth merged 1 commit intomainfrom
master

Conversation

@offx-zinth
Copy link
Copy Markdown
Owner

No description provided.

@offx-zinth offx-zinth merged commit 5ec7644 into main Apr 19, 2026
1 check failed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread API.md

---

## 🔍 Discovery & Search
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This section is missing documentation for several implemented methods found in smp/protocol/handlers/query.py, specifically smp/impact (handled by ImpactHandler) and smp/trace (handled by TraceHandler). These should be included to provide a complete API reference.

Comment thread API.md
Comment on lines +23 to +26
- `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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are several discrepancies between the documentation and the implementation of smp/locate:

  1. The parameters seed_k and hops are listed as optional, but the SeedWalkEngine.locate method (smp/engine/seed_walk.py:347) does not accept them; they are hardcoded to defaults inside the method.
  2. The return type is documented as LocateResponse, but the LocateHandler (smp/protocol/handlers/query.py:108) wraps the result in a {"matches": ...} object.
  3. SeedWalkEngine.locate returns a list containing the response dictionary, which results in a nested structure: {"matches": [{...}]}.

Comment thread API.md
- `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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The return value for smp/search is documented as a "List of matches", but the implementation in DefaultQueryEngine.search (smp/engine/query.py:448) returns a dictionary: {"matches": results, "total": len(results)}. The documentation should be updated to reflect this structure.

Comment thread ARCHITECTURE.md
- 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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation states that the Louvain algorithm is executed via Neo4j GDS. However, the implementation in smp/engine/community.py (lines 241-288) is a custom Python-based Louvain implementation. This should be corrected to accurately describe the system architecture.

Comment thread README.md
"id": 1
}'
# Query the intelligence layer
smp query "Where is the authentication logic handled?"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The smp query command is documented here, but it is not implemented in the CLI (smp/cli.py). The available subcommands are ingest, serve, run, ps, stop, and logs. Please update the documentation to use a valid command or implement the missing functionality.

Comment thread USER_GUIDE.md
### 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The smp query command is not supported by the current CLI implementation. This example should be updated to reflect the actual available commands or the use of the Python SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant