serialize_knowledge
Transform knowledge structures into canonical JSON, optionally using a session_id to serialize existing session state.
Instructions
Serialize a Knowledge Structure into its canonical JSON representation. Optionally accepts 'session_id' to serialize the current state of an existing session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json_data | Yes | A valid CKS Knowledge Structure as a JSON string. Each object has an 'identity' ({'id', 'type', 'name'}) and a free-form 'structure' dict. Relations are objects whose 'structure' contains 'participants' (a list of object ids) and 'relation_type'. Example: '{"objects": [{"identity": {"id": "obj-1", "type": "Definition", "name": "Photosynthesis"}, "structure": {"content": "..."}}, {"identity": {"id": "rel-1", "type": "Relation", "name": "r"}, "structure": {"participants": ["obj-1", "obj-2"], "relation_type": 'derives"}}]}'. | |
| session_id | No | Optional. If provided, serialize the current structure of this session instead of creating a new session from json_data. |