An AI-powered CLI assistant with AWS Bedrock integration, tool support, and customizable features for interactive conversations and task automation.
Project description
Keystroke Agent
A Python project implementing an AI assistant with tool integration, AWS service support, and asynchronous event-driven architecture.
Features
-
Advanced AI Integration:
- Uses AWS Bedrock (Claude 3.5 Sonnet) as the default LLM
- Asynchronous API calls for better performance
- Configurable model selection
- Event-driven architecture using asyncio.Queue for handling LLM responses and tool calls
-
Built-in Tools:
- Calculator: Mathematical operations and functions
- File Management: File operations (create, read, update, delete)
- Presigned URL: AWS S3 presigned URL generation and file transfer
-
Interactive CLI:
- Rich text formatting for better readability
- Command history management
- Dynamic conversation summarization
- Dot commands for runtime configuration
- Asynchronous implementation for improved responsiveness
-
Customizable Settings:
- Model selection
- System message
- Assistant name
- History limit
- Tool enablement
Installation
pip install keystroke-agent
Configuration
- Create a
.envfile with your AWS credentials:
AWS_ACCESS_KEY_ID=your_key_id
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_SESSION_TOKEN=your_session_token
AWS_DEFAULT_REGION=your_region
- Adjust settings in
keystroke/settings.pyas needed:
AGENT_NAME = "AI Assistant"
DEFAULT_LLM_MODEL = "bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0"
HISTORY_LIMIT = 10
ENABLE_TOOLS = True
Usage
Start the agent:
agent
Available Dot Commands
.help- Show available commands.clear- Clear conversation history.model <model_name>- Change the LLM model.view- View current settings.view history- View conversation history.system <message>- Change the system message.name <new_name>- Change the assistant's name
Available Tools
-
Calculator:
- Basic arithmetic operations
- Trigonometric functions
- Logarithms and exponentials
- Factorial calculation
-
File Management:
- Create, read, update, and delete files
- List files in directories
- Copy and rename files
- Recursive operations support
-
AWS S3 Integration:
- Generate presigned URLs for upload/download
- Upload files using presigned URLs
- Download files using presigned URLs
Development
Built with:
litellm- LLM integrationrich- Terminal formattingboto3- AWS SDKpython-dotenv- Environment managementasyncio- Asynchronous I/O
License
MIT License
Future Enhancements
- Streaming Support
- Asynchronous event-driven architecture
- Additional tool integrations
- Web interface option
- Enhanced error handling
- Conversation export functionality
- Tool usage analytics
- Custom tool loading system
WhatsApp Integration
- WhatsApp Business API integration
- Message sending and receiving
- Media file handling (images, documents, voice notes)
- Group chat support
- Interactive buttons and list messages
- Automated responses through AI
- Contact management and user session handling
- Message templates and broadcasting
- Multi-language support for WhatsApp messages
- Message status tracking and analytics
Project details
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 keystroke_agent-0.1.6.tar.gz.
File metadata
- Download URL: keystroke_agent-0.1.6.tar.gz
- Upload date:
- Size: 95.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
466849773081ef1bcdaac39330b4ee3ba3885326cb80e6f8ace9391f11b5bca4
|
|
| MD5 |
c3f90b178f89c286f1d8db6b916985f0
|
|
| BLAKE2b-256 |
308c568fa801dcf35149a28a11fe5f2eb0fa5e4cf002ee03fdda941eb509afc3
|
File details
Details for the file keystroke_agent-0.1.6-py3-none-any.whl.
File metadata
- Download URL: keystroke_agent-0.1.6-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
624a7e99167cf049e8738d497434b7b48874edb3c607a3875085adf98978bd9e
|
|
| MD5 |
39c3ae22bd38ab7bbb18c8fe891be793
|
|
| BLAKE2b-256 |
245aa14fd6bb60be0355a6acd2a9a99b5a431c12df28f3b738c4d4b2683bcaea
|