Skip to content

Commit ab6231e

Browse files
committed
fix(docs): correcting documentation for knowledge policy
1 parent be1f5eb commit ab6231e

3 files changed

Lines changed: 64 additions & 38 deletions

File tree

docs/features/memory-decay.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,23 @@ Nodes and edges whose decay score drops below the visibility threshold are autom
181181

182182
A background job periodically removes suppressed entities from secondary indexes (BM25, vector) to reclaim space. Primary data remains intact.
183183

184-
## Admin Endpoints
184+
## Cypher Introspection
185185

186-
| Endpoint | Description |
187-
|----------|-------------|
188-
| `GET /admin/knowledge-policies/profiles` | List decay profiles and bindings |
189-
| `GET /admin/knowledge-policies/policies` | List promotion policies |
190-
| `GET /admin/knowledge-policies/resolve?entityId=X` | Explain scoring for an entity |
191-
| `GET /admin/knowledge-policies/deindex/status` | Deindex cleanup job status |
186+
The supported operational surface for knowledge-layer scoring is Cypher, not a dedicated admin HTTP API.
187+
188+
```cypher
189+
CALL nornicdb.knowledgepolicy.info();
190+
CALL nornicdb.knowledgepolicy.profiles();
191+
CALL nornicdb.knowledgepolicy.policies();
192+
CALL nornicdb.knowledgepolicy.resolve('nornic:episode-1', '', '');
193+
CALL nornicdb.knowledgepolicy.deindexStatus();
194+
195+
SHOW DECAY PROFILES;
196+
SHOW PROMOTION PROFILES;
197+
SHOW PROMOTION POLICIES;
198+
```
199+
200+
Use these procedures to inspect effective policy resolution, catalog stored profiles and policies, and monitor deindex cleanup state.
192201

193202
## Disable Scoring
194203

docs/user-guides/knowledge-layer-policies.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,42 @@ When multiple bindings could match:
108108
3. If two bindings have equal specificity, the resolver returns a diagnostic warning
109109
4. No binding → entity scores 1.0 (no decay)
110110

111-
## Admin API
111+
## Cypher Diagnostics
112112

113-
| Endpoint | Description |
114-
|----------|-------------|
115-
| `GET /admin/knowledge-policies/profiles` | List all profiles and bindings |
116-
| `GET /admin/knowledge-policies/policies` | List all promotion policies |
117-
| `GET /admin/knowledge-policies/resolve?entityId=X` | Explain scoring for a specific entity |
118-
| `GET /admin/knowledge-policies/deindex/status` | Deindex cleanup job status |
113+
The knowledge-layer system is operated and inspected through Cypher.
114+
115+
### Catalog and Status
116+
117+
```cypher
118+
CALL nornicdb.knowledgepolicy.info();
119+
CALL nornicdb.knowledgepolicy.profiles();
120+
CALL nornicdb.knowledgepolicy.policies();
121+
122+
SHOW DECAY PROFILES;
123+
SHOW PROMOTION PROFILES;
124+
SHOW PROMOTION POLICIES;
125+
```
126+
127+
### Resolve an Effective Policy
128+
129+
```cypher
130+
-- Resolve by entity ID
131+
CALL nornicdb.knowledgepolicy.resolve('nornic:episode-1', '', '');
132+
133+
-- Resolve by label set
134+
CALL nornicdb.knowledgepolicy.resolve('', 'MemoryEpisode,SessionRecord', '');
135+
136+
-- Resolve by edge type
137+
CALL nornicdb.knowledgepolicy.resolve('', '', 'CO_ACCESSED');
138+
```
139+
140+
### Deindex Queue Status
141+
142+
```cypher
143+
CALL nornicdb.knowledgepolicy.deindexStatus();
144+
```
145+
146+
These procedures are the supported diagnostics surface. The older `/admin/knowledge-policies/*` HTTP endpoints have been removed.
119147

120148
## Browser UI
121149

@@ -124,6 +152,8 @@ The Knowledge Policies admin page is available at **Security > Knowledge Policie
124152
- Interactive resolve tool for debugging scoring
125153
- Deindex status monitoring
126154

155+
The UI uses the same Cypher DDL and knowledge-policy procedures shown above rather than a separate admin API.
156+
127157
Node detail views in the graph browser show decay metadata (score, suppression status, access count) when present.
128158

129159
## See Also

docs/user-guides/visibility-suppression-deindex.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@ ORDER BY decayScore(n)
6565

6666
`reveal()` is a query-time bypass — it does not change the entity's suppression status. The entity remains suppressed for all other queries.
6767

68-
### Using the Admin API
68+
### Inspecting Suppression with Cypher
6969

70-
```bash
71-
curl -H "Authorization: Bearer $TOKEN" \
72-
"http://localhost:7474/admin/knowledge-policies/resolve?entityId=node-123"
70+
```cypher
71+
CALL nornicdb.knowledgepolicy.resolve('node-123', '', '');
7372
```
7473

75-
Returns the full `ScoringResolution` including explanation of why the entity was suppressed.
74+
This returns the full scoring resolution, including the effective threshold, final score, suppression eligibility, and explanation of why the entity was suppressed.
7675

7776
## Deindex Cleanup
7877

@@ -91,28 +90,16 @@ The deindex job runs every 24 hours by default. No configuration is required —
9190

9291
### Monitoring
9392

94-
Check deindex status via the admin API:
93+
Check deindex status with the supported Cypher procedure:
9594

96-
```bash
97-
curl -H "Authorization: Bearer $TOKEN" \
98-
"http://localhost:7474/admin/knowledge-policies/deindex/status"
95+
```cypher
96+
CALL nornicdb.knowledgepolicy.deindexStatus();
9997
```
10098

101-
Response:
102-
```json
103-
{
104-
"pending_count": 3,
105-
"items": [
106-
{
107-
"workItemId": "deindex:nornic:node-123",
108-
"targetId": "node-123",
109-
"targetScope": "NODE",
110-
"enqueuedAt": 1714000000,
111-
"status": "pending"
112-
}
113-
],
114-
"supported": true
115-
}
99+
Example result columns:
100+
101+
```text
102+
pending_count | supported | message | workItemId | targetId | targetScope | enqueuedAt | status
116103
```
117104

118105
The browser UI also shows deindex status on the **Security > Knowledge Policies > Deindex Status** tab.

0 commit comments

Comments
 (0)