kader coding agent
Project description
Kader
Kader is an intelligent coding agent designed to assist with software development tasks. It provides a comprehensive framework for building AI-powered agents with advanced reasoning capabilities and tool integration.
Features
- ๐ค AI-powered Code Assistance - Support for multiple LLM providers:
- Ollama: Local LLM execution for privacy and speed.
- Google Gemini: Cloud-based powerful models via the Google GenAI SDK.
- ๐ฅ๏ธ Interactive CLI - Modern TUI interface built with Textual:
- Lazy Loading: Efficient directory tree loading for large projects.
- TODO Management: Integrated TODO list widget with automatic updates.
- ๐ ๏ธ Tool Integration - File system, command execution, web search, and more.
- ๐ง Memory Management - State persistence, conversation history, and isolated sub-agent memory.
- ๐ Session Management - Save and load conversation sessions.
- โจ๏ธ Keyboard Shortcuts - Efficient navigation and operations.
- ๐ YAML Configuration - Agent configuration via YAML files.
- ๐ Planner-Executor Framework - Sophisticated reasoning and acting architecture using task planning and delegation.
- ๐๏ธ File System Tools - Read, write, search, and edit files.
- ๐ค Agent-As-Tool - Spawn sub-agents for specific tasks with isolated memory and automated context aggregation.
Installation
Prerequisites
Using uv (recommended)
# Clone the repository
git clone https://github.com/your-repo/kader.git
cd kader
# Install dependencies with uv
uv sync
# Run the CLI
uv run python -m cli
Using pip
# Clone the repository
git clone https://github.com/your-repo/kader.git
cd kader
# Install in development mode
pip install -e .
# Run the CLI
python -m cli
Quick Start
Running the CLI
# Run the Kader CLI using uv
uv run python -m cli
# Or using pip
python -m cli
First Steps in CLI
Once the CLI is running:
- Type any question to start chatting with the agent.
- Use
/helpto see available commands. - Use
/modelsto check available models from all providers. - The directory tree on the left features lazy loading, expanding only when needed.
- The TODO list on the right tracks tasks identified by the planner.
Configuration
When the kader module is imported for the first time, it automatically creates a .kader directory in your home directory and a .env file.
Environment Variables
The application automatically loads environment variables from ~/.kader/.env:
OLLAMA_API_KEY: API key for Ollama service (if applicable).GOOGLE_API_KEY: API key for Google Gemini (required for Google Provider).- Additional variables can be added to the
.envfile and will be automatically loaded.
Memory and Sessions
Kader stores data in ~/.kader/:
- Sessions:
~/.kader/memory/sessions/ - Configuration:
~/.kader/ - Memory files:
~/.kader/memory/ - Checkpoints:
~/.kader/memory/sessions/<session-id>/executors/(Aggregated context from sub-agents)
CLI Commands
| Command | Description |
|---|---|
/help |
Show command reference |
/models |
Show available models (Ollama & Google) |
/clear |
Clear conversation |
/save |
Save current session |
/load <id> |
Load a saved session |
/sessions |
List saved sessions |
/refresh |
Refresh file tree |
/exit |
Exit the CLI |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Q |
Quit |
Ctrl+L |
Clear conversation |
Ctrl+S |
Save session |
Ctrl+R |
Refresh file tree |
Tab |
Navigate panels |
Project Structure
kader/
โโโ cli/ # Interactive command-line interface
โ โโโ app.py # Main application entry point
โ โโโ app.tcss # Textual CSS for styling
โ โโโ llm_factory.py # Provider selection logic
โ โโโ widgets/ # Custom Textual widgets
โ โ โโโ conversation.py # Chat display widget
โ โ โโโ loading.py # Loading spinner widget
โ โ โโโ confirmation.py # Tool/model selection widgets
โ โ โโโ todo_list.py # TODO tracking widget
โ โโโ README.md # CLI documentation
โโโ examples/ # Example implementations
โ โโโ memory_example.py # Memory management examples
โ โโโ google_example.py # Google Gemini provider examples
โ โโโ planner_executor_example.py # Advanced workflow examples
โ โโโ README.md # Examples documentation
โโโ kader/ # Core framework
โ โโโ agent/ # Agent implementations (Planning, ReAct)
โ โโโ memory/ # Memory management & persistence
โ โโโ providers/ # LLM providers (Ollama, Google)
โ โโโ tools/ # Tools (File System, Web, Command, AgentTool)
โ โโโ prompts/ # Prompt templates (Jinja2)
โ โโโ utils/ # Utilities (Checkpointer, ContextAggregator)
โโโ pyproject.toml # Project dependencies
โโโ README.md # This file
โโโ uv.lock # Dependency lock file
Core Components
Agents
Kader provides a robust agent architecture:
- ReActAgent: Reasoning and Acting agent that combines thoughts with actions.
- PlanningAgent: High-level agent that breaks complex tasks into manageable plans.
- BaseAgent: Abstract base class for creating custom agent behaviors.
LLM Providers
Kader supports multiple backends:
- OllamaProvider: Connects to locally running Ollama instances.
- GoogleProvider: High-performance access to Gemini models.
Agent-As-Tool (AgentTool)
The AgentTool allows a PlanningAgent (Architect) to delegate work to a ReActAgent (Worker). It features:
- Persistent Memory: Sub-agent conversations are saved to JSON.
- Context Aggregation: Sub-agent research and actions are automatically merged into the main session's
checkpoint.mdviaContextAggregator.
Memory Management
- SlidingWindowConversationManager: Maintains context within token limits.
- PersistentSlidingWindowConversationManager: Auto-saves sub-agent history.
- Checkpointer: Generates markdown summaries of agent actions.
Development
Setting up for Development
# Clone the repository
git clone https://github.com/your-repo/kader.git
cd kader
# Install in development mode with uv
uv sync
# Run the CLI with hot reload for development
uv run textual run --dev cli.app:KaderApp
Running Tests
# Run tests with uv
uv run pytest
# Run tests with specific options
uv run pytest --verbose
Code Quality
Kader uses various tools for maintaining code quality:
# Run linter
uv run ruff check .
# Format code
uv run ruff format .
Troubleshooting
Common Issues
- No models found: Ensure your providers are correctly configured. For Ollama, run
ollama serve. For Google, ensureGOOGLE_API_KEYis set. - Connection errors: Verify internet access for cloud providers and local service availability for Ollama.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run the test suite
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with Textual for the beautiful CLI interface.
- Uses Ollama for local LLM execution.
- Powered by Google Gemini for advanced cloud-based reasoning.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kader-1.3.0.tar.gz.
File metadata
- Download URL: kader-1.3.0.tar.gz
- Upload date:
- Size: 279.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a46360f29b34ffa7498e6a3c43d5c0d187744a2421fe98dd8458568c22206fb6
|
|
| MD5 |
da31813f0cd3aea4772ea1d66c7db989
|
|
| BLAKE2b-256 |
fb12bff114625f40be7506a37176c4a177c90ad8d59ed39b4ad4c36a6cb603f6
|
File details
Details for the file kader-1.3.0-py3-none-any.whl.
File metadata
- Download URL: kader-1.3.0-py3-none-any.whl
- Upload date:
- Size: 121.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03a6da6d9d9b9a5500d7233bb65f5204ac4cc24922ff9aed1f39a2e5fbcb8c9b
|
|
| MD5 |
ffcee0b7f841a2832bbdb79ca66357e8
|
|
| BLAKE2b-256 |
42012b51fdbb53815fb968fc531776589736a937865400dccd89a3669c926bbe
|