construct_knowledge
Extract entities and relationships from unstructured text into a validated Canonical Knowledge Structure, saved as a new session with session and version IDs.
Instructions
Build a Canonical Knowledge Structure from free-form text using an LLM. The LLM extracts entities and relationships, generates a valid CKS JSON payload, which is then parsed and validated before being persisted as a new session. Provider is auto-selected (CKS_LLM_PROVIDER): a local Ollama server if reachable (no API key needed), else Anthropic if ANTHROPIC_API_KEY is set. Returns 'session_id', 'version_id', and the serialized structure. Use 'hint' to direct the extraction toward specific aspects of the text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | Optional. A short description of which aspects to focus on (e.g. 'focus on causal relations between diseases and symptoms'). | |
| text | Yes | Free-form text to extract a Knowledge Structure from. | |
| model | No | Optional. Model name for whichever provider is selected (e.g. an Ollama model tag, or an Anthropic model). Defaults to CKS_OLLAMA_MODEL/CKS_LLM_MODEL depending on provider. | |
| max_tokens | No | Optional. Max tokens for the LLM response. Defaults to CKS_LLM_MAX_TOKENS env var, or 4096. |