Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Evincere/klisk/llms.txt
Use this file to discover all available pages before exploring further.
AgentRegistry
Singleton registry that tracks all agents and tools in the project.
Fields
Dictionary mapping agent names to their registry entries
Dictionary mapping tool names to their registry entries
Methods
get_instance
@classmethod
def get_instance(cls) -> AgentRegistry
Get the singleton instance of the registry.
The singleton AgentRegistry instance
Example:
from klisk.core.registry import AgentRegistry
registry = AgentRegistry.get_instance()
register_agent
def register_agent(self, entry: AgentEntry) -> None
Register an agent in the registry.
Example:
from klisk.core.registry import AgentRegistry, AgentEntry
registry = AgentRegistry.get_instance()
agent = AgentEntry(
name="my_agent",
instructions="You are a helpful assistant",
model="claude-3-5-sonnet-20241022"
)
registry.register_agent(agent)
def register_tool(self, entry: ToolEntry) -> None
Register a tool in the registry.
Example:
from klisk.core.registry import AgentRegistry, ToolEntry
registry = AgentRegistry.get_instance()
tool = ToolEntry(
name="calculator",
description="Performs calculations",
parameters={"expression": {"type": "string"}}
)
registry.register_tool(tool)
get_agent
def get_agent(self, name: str) -> AgentEntry | None
Retrieve an agent by name.
Name of the agent to retrieve
The agent entry if found, None otherwise
Example:
registry = AgentRegistry.get_instance()
agent = registry.get_agent("my_agent")
if agent:
print(agent.instructions)
def get_tool(self, name: str) -> ToolEntry | None
Retrieve a tool by name.
Name of the tool to retrieve
The tool entry if found, None otherwise
Example:
registry = AgentRegistry.get_instance()
tool = registry.get_tool("calculator")
if tool:
print(tool.description)
get_project_snapshot
def get_project_snapshot(self) -> ProjectSnapshot
Get a snapshot of all registered agents and tools.
Snapshot containing copies of all agents and tools
Example:
registry = AgentRegistry.get_instance()
snapshot = registry.get_project_snapshot()
print(snapshot.to_dict())
clear
Clear all registered agents and tools from the registry.
Example:
registry = AgentRegistry.get_instance()
registry.clear()
reset
@classmethod
def reset(cls) -> None
Reset the singleton instance. Useful for testing.
Example:
AgentEntry
Dataclass representing a registered agent.
Fields
System instructions for the agent
Model identifier (e.g., “claude-3-5-sonnet-20241022”)
List of tool names available to the agent
Temperature parameter for model sampling
Reasoning effort level for the agent
Path to the source file where the agent is defined
The underlying Agent object from the SDK
Project name this agent belongs to
Example:
from klisk.core.registry import AgentEntry
agent = AgentEntry(
name="assistant",
instructions="You are a helpful coding assistant",
model="claude-3-5-sonnet-20241022",
tools=["code_analyzer", "file_reader"],
temperature=0.7,
source_file="src/agents.py"
)
ToolEntry
Dataclass representing a registered tool.
Fields
Description of what the tool does
JSON Schema defining the tool’s parameters
Path to the source file where the tool is defined
The underlying FunctionTool object from the SDK
Project name this tool belongs to
Example:
from klisk.core.registry import ToolEntry
tool = ToolEntry(
name="search",
description="Search for information",
parameters={
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "default": 10}
},
source_file="src/tools.py"
)
ProjectSnapshot
Dataclass representing a snapshot of all agents and tools in a project. Returned by AgentRegistry.get_project_snapshot().
Fields
agents
dict[str, AgentEntry]
default:"{}"
Dictionary mapping agent names to their AgentEntry objects
tools
dict[str, ToolEntry]
default:"{}"
Dictionary mapping tool names to their ToolEntry objects
config
dict[str, Any]
default:"{}"
Project configuration dictionary
Methods
to_dict
def to_dict(self) -> dict[str, Any]
Convert the snapshot to a JSON-serializable dictionary. Useful for sending project state to the Studio UI or API clients.
Returns: Dictionary with serialized agents, tools, and config
Example:
from klisk.core.registry import AgentRegistry
registry = AgentRegistry.get_instance()
snapshot = registry.get_project_snapshot()
# Convert to dict for JSON serialization
data = snapshot.to_dict()
# Structure:
# {
# "agents": {
# "agent_name": {
# "name": "agent_name",
# "instructions": "...",
# "model": "...",
# "tools": [...],
# "temperature": 0.7,
# "reasoning_effort": None,
# "source_file": "src/main.py",
# "project": "my-agent"
# }
# },
# "tools": {
# "tool_name": {
# "name": "tool_name",
# "description": "...",
# "parameters": {...},
# "source_file": "src/tools/example.py",
# "project": "my-agent"
# }
# },
# "config": {}
# }
Source Reference: src/klisk/core/registry.py:34-66