Guidance for Claude Code when working with this repository.
lyzr-kit is a Python SDK for managing AI agents via the Lyzr platform.
lk auth # Configure API credentials
lk ls # List agents (two tables)
lk get <source> # Clone and deploy agent (creates copy-of-<name>)
lk set <identifier> # Update agent on platform
lk chat <identifier> # Interactive chat session
lk rm <identifier> # Delete local agent
lk tree [identifier] # Show agent dependency tree
lk doctor # Validate all local agentsNote: agent resource is optional. lk ls = lk agent ls = lk a ls
Serial numbers: Context-aware
get→ Built-in agentsset/chat/rm→ Your agents
The get command uses a plan-based approach:
- Build clone plan (collects all dependencies recursively)
- Display plan with single confirmation prompt
- Execute plan (creates agents in dependency order)
$ lk get project-manager
Creating 'copy-of-project-manager' with 3 sub-agent(s):
AGENT ACTION FROM
copy-of-task-planner create task-planner
copy-of-data-analyst create data-analyst
copy-of-summarizer create summarizer
copy-of-project-manager create project-manager
Proceed? [Y/n]: yNo ID prompts - users rename via YAML edit + lk set.
| Location | Purpose |
|---|---|
src/lyzr_kit/collection/agents/ |
Built-in agents (bundled) |
agents/ |
User agents (via lk agent get) |
src/lyzr_kit/
├── main.py # CLI entry point
├── schemas/ # Pydantic models (agent.py, tool.py, feature.py)
├── collection/agents/ # Built-in agent YAMLs
├── commands/ # CLI implementations
│ ├── _console.py # Shared Rich console
│ ├── _resolver.py # Serial number resolver
│ ├── _websocket.py # WebSocket event streaming
│ ├── agent.py # Agent Typer app
│ ├── agent_list.py # ls command
│ ├── agent_get.py # get command (plan-based cloning)
│ ├── agent_set.py # set command
│ ├── agent_rm.py # rm command (with --tree flag)
│ ├── agent_tree.py # tree command
│ ├── agent_doctor.py # doctor command
│ ├── agent_chat.py # chat command (SSE + WebSocket)
│ ├── auth.py # auth command
│ ├── tool.py # stub
│ └── feature.py # stub
├── storage/ # StorageManager, serialization, validation
└── utils/ # auth.py, platform.py
tests/
├── unit/commands/ # Command tests
├── unit/storage/ # Storage tests
└── integration/ # E2E tests
Key files for chat functionality:
commands/agent_chat.py- Main chat loop, UI boxes, SSE streamingcommands/_websocket.py- WebSocket client, event parsing
Features:
- Session box (agent info, model, session ID, timestamp)
- Real-time WebSocket events (tool calls, memory, artifacts)
- SSE streaming for responses
- Metrics footer (latency, tokens)
- prompt_toolkit for keyboard shortcuts
- Cycle detection - Prevents circular dependencies (A → B → A)
- Dependency plan - Shows all agents to create before confirmation
- Tree view -
lk treeshows dependency graph - Doctor -
lk doctorvalidates all local agents - Recursive delete -
lk rm --treedeletes agent + sub-agents
pip install -e . # Install dev mode
pytest tests/ -v # Run tests
ruff check src/ # Lint
mypy src/ # Type check| Phase | Focus | Status |
|---|---|---|
| 1 | Agents, CLI, storage | ✅ Done |
| 2 | Chat experience, WebSocket | ✅ Done |
| 3 | Sub-agents | ✅ Done |
| 4 | Tools | Stub |
| 5 | Features | Stub |
specs/concepts/- Entity definitionsspecs/implementation/- Technical detailsspecs/phases/- Roadmap