A modern Python CLI application for AI agents with built-in support for multiple AI providers, embedding models, and vector databases.
moargents
A modern Python CLI application for AI agents with built-in support for multiple AI providers, embedding models, and vector databases.
Features
- Multi-Provider AI Support: Integration with Anthropic, OpenAI, and other AI providers
- Advanced Embedding Models: FastEmbed and Sentence Transformers support
- Vector Database Integration: Qdrant and pgvector support
- Financial Data: Yahoo Finance integration
- Document Processing: PDF parsing capabilities
- Modern CLI: Built with Typer and Rich for beautiful terminal output
- Structured Logging: Loguru integration with configurable formats
- Production Ready: Comprehensive testing, linting, and type checking
Installation
# Clone the repository
git clone https://codeberg.org/goern/moargents.git
cd moargents
# Install dependencies
uv sync --group dev
Usage
Basic Commands
# Show help
uv run moargents --help
# Show version
uv run moargents version
# Show application info
uv run moargents info
Logging Configuration
# Debug logging
uv run moargents -v command
# Trace logging (most verbose)
uv run moargents -vv command
# Set log level explicitly
uv run moargents --log-level=DEBUG command
# Log to file
uv run moargents --log-file=logs/app.log command
# JSON format logging
uv run moargents --log-format=json command
Environment Variables
# Set log level
LOG_LEVEL=DEBUG uv run moargents command
# Configure logging format
LOG_FORMAT=json uv run moargents command
Development
Setup
# Install with development dependencies
uv sync --group dev
# Install documentation dependencies
uv sync --group docs
Testing
# Run all tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=src --cov-report=html --cov-report=term-missing
# Run specific test types
uv run pytest -m unit # Unit tests only
uv run pytest -m e2e # End-to-end tests only
uv run pytest -m "not slow" # Skip slow tests
Code Quality
# Run linting
uv run ruff check
# Format code
uv run ruff format
# Type checking
uv run mypy src/
# All quality checks
uv run pre-commit run --all-files
Documentation
# Generate API documentation
uv run pdoc src/moargents -o docs/
Architecture
CLI Structure
src/moargents/cli/app.py- Main CLI application and command registrationsrc/moargents/cli/logging.py- Logging configurationsrc/moargents/settings.py- Centralized settings using Pydanticsrc/moargents/commands.py- Command implementations
Configuration
The application uses Pydantic for configuration management with support for:
- Environment variables with nested delimiter
__(e.g.,LOGGING__LEVEL=DEBUG) - File-based configuration
- Runtime configuration via CLI options
Logging
- Formats: Pretty (colored) and JSON formats
- Levels: TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL
- Output: Console and/or file with rotation
- Context: Includes function name, line number, and timestamp
Dependencies
Core Dependencies
- typer - Modern CLI framework
- rich - Beautiful terminal output
- pydantic - Data validation and settings
- loguru - Structured logging
- python-dotenv - Environment variable loading
AI & ML Dependencies
- anthropic - Anthropic Claude API
- huggingface-hub - Hugging Face model hub
- fastembed - Fast embedding models
- sentence-transformers - Sentence embedding models
Database Dependencies
- qdrant-client - Vector database client
- pgvector - PostgreSQL vector extension
- sqlalchemy - SQL toolkit and ORM
- psycopg - PostgreSQL adapter
Utility Dependencies
- pypdf - PDF processing
- yfinance - Yahoo Finance data
- googlesearch-python - Google search functionality
- pycountry - Country data
License
GPL-3.0-or-later
Links
- Homepage: https://goern.name/
- Repository: https://codeberg.org/goern/moargents.git
- Issues: https://codeberg.org/goern/moargents/issues
- Changelog: https://codeberg.org/goern/moargents/src/branch/main/CHANGELOG.md
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and quality checks
- Submit a pull request
Make sure to follow the existing code style and include tests for new functionality.