How startadam/bluemarz works
Project Type and Purpose
• Bluemarz is an open-source Python library (SDK) that provides a stateless management and orchestration layer for AI agents.
• It enables you to create Agents, manage Sessions, assign Agents to Sessions, execute reusable Tools, and support Retrieval-Augmented Generation (RAG) across multiple LLM Providers (OpenAI, Claude, Gemini, etc.).
File Structure Analysis
• top-level:
• pyproject.toml / LICENSE / README.md / docs/ → project metadata and documentation
• src/bluemarz/ → the primary Python package
• test/ → unit tests and mocks
• src/bluemarz/api:
• Provider-specific wrappers (e.g., openai.py)
• src/bluemarz/core:
• Key abstractions (Agent, Session, Assignment)
• Registries (class_registry, spec_registry)
• Middleware, interfaces, exception classes, data models
• src/bluemarz/lib:
• Low-level clients and components for interacting with LLM Providers
• src/bluemarz/utils:
• HTTP client, model utilities
• src/bluemarz/examples:
• End-user usage samples
• test/:
• Unit tests grouped by core, services, mocks
Architectural Patterns and Design Principles
• Layered architecture:
• api layer delegates to lib
• core layer orchestrates Agents, Sessions, Assignments
• utils provide shared helper functions
• Plugin/Registry pattern for dynamically registering Agent types, Tools, and RAG specs
• Middleware pipeline in core for cross-cutting concerns (logging, authentication, tool execution)
• Asynchronous execution using asyncio for non-blocking API calls
• Stateless session management—state resides on the LLM provider
Main Components and Their Relationships
• User code (your scripts or application)
↕
• bluemarz SDK:
• Agent: encapsulates an LLM model instance (via api → lib → HTTP)
• Session: represents a dialogue container
• Assignment: binds one or more Agents to a Session and drives the conversation
• Tool Execution: centralized component invoked by core when an Agent calls a tool
• RAG (Agent-level & Assignment-level): fetches external data and injects context
↕
• External LLM Providers (OpenAI, Claude, Gemini)
• External Data Sources (databases, document stores for RAG)