Agent
class is the primary entry point for the qckfx Agent SDK. It provides a clean, developer-friendly interface for creating and managing AI agents capable of interacting with code, files, and systems.
The Agent Class
The Agent follows a factory pattern usingAgent.create()
for proper async initialization:
Key Agent Methods
The Agent class provides several essential methods for interaction:processQuery(query, model?, contextWindow?)
The primary method for sending natural language queries to your agent:
invokeTool(toolId, args, sessionState?)
Execute tools directly while maintaining proper session context:
registerTool(tool)
Add custom tools to extend agent capabilities:
Agent Configuration
The agent configuration uses a strongly-typed schema from@qckfx/sdk-schema
:
Model Management with LiteLLM
The SDK uses the OpenAI SDK with LiteLLM for model provider abstraction. This allows you to use any model with an OpenAI-compatible interface while keeping your API keys private.Setting up LiteLLM (Recommended)
LiteLLM provides a unified interface to multiple model providers. Set it up using the included Docker configuration:Available Models
The LiteLLM configuration includes support for multiple providers:- Anthropic:
claude-sonnet-3-7
,claude-sonnet-4
- OpenAI:
o3
,gpt-o4-mini
,gpt-4.1-mini
,gpt-4.1-nano
- Google:
gemini-2.5-pro
- Mistral:
devstral-small
- Groq:
llama-3.1-8b
,qwen-32b
Environment Variables
Set the LiteLLM base URL to use your local instance:Event System
The Agent provides a comprehensive event system for monitoring operations:Advanced Agent Features
Model Management
Query available models and manage LLM providers:Rollback and Recovery
Implement sophisticated rollback capabilities:Next Steps
- Learn about Session Management to understand conversation context
- Explore the Tool System to extend agent capabilities
- Understand Environment Types for different execution contexts
- Check out Getting Started for practical examples