DREAMv1 API Reference
This reference documents all public modules, classes, and functions in the DREAMv1 framework. Use this as your guide for building applications with the DREAMv1 hierarchical multi-agent system.
Master Control Program (MCP)
The Master Control Program orchestrates agent activities and manages system resources.
MasterControlProgram
Core controller class that manages the entire multi-agent system.
__init__(config=None)
Initialize a new Master Control Program instance.
config
(dict, optional): Configuration dictionary or path to YAML config file.
register_agent(agent)
Register an agent with the MCP.
agent
(Agent): Agent instance to register.
str
: Unique agent ID.
create_agent(agent_type, agent_config={})
Create and register a new agent of specified type.
agent_type
(str): Type of agent to create.agent_config
(dict, optional): Configuration for the agent.
Agent
: The created agent instance.
start()
Start the MCP and all registered agents.
stop()
Stop the MCP and all registered agents.
get_agent(agent_id)
Retrieve an agent by its ID.
agent_id
(str): ID of the agent to retrieve.
Agent
: The requested agent instance.
Agents
Agent classes that handle specific roles within the system.
Agent
Base agent class that all specific agent types inherit from.
__init__(agent_id=None, name=None, role=None)
Initialize a new agent.
agent_id
(str, optional): Unique identifier for the agent. Generated if not provided.name
(str, optional): Human-readable name for the agent.role
(str, optional): Role description for this agent.
process_message(message)
Process an incoming message.
message
(Message): The message to process.
Message
: Response message, if applicable.
send_message(receiver_id, content, message_type="default")
Send a message to another agent.
receiver_id
(str): ID of the receiving agent.content
(any): Message content.message_type
(str, optional): Type of message.
str
: Message ID of the sent message.
ExecutiveAgent
High-level strategic agent that coordinates task delegation and goal management.
set_goals(goals)
Set system-level goals.
goals
(list): List of goal descriptions.
SpecialistAgent
Domain-specific agent that handles tasks within its specialty area.
register_capability(capability_name, capability_function)
Register a new capability for this agent.
capability_name
(str): Name of the capability.capability_function
(callable): Function that implements the capability.
Communication Protocol
Classes for handling inter-agent messaging and communication.
Message
Message class for inter-agent communication.
__init__(sender, receiver, message_type, content, priority="medium")
Initialize a new message.
sender
(str): ID of the sending agent.receiver
(str): ID of the receiving agent.message_type
(str): Type of message.content
(any): Message content.priority
(str, optional): Priority level (low, medium, high, critical).
add_reference(message_id)
Add a reference to another message.
message_id
(str): ID of the referenced message.
MessageBus
Central messaging system for routing messages between agents.
send(message)
Send a message through the message bus.
message
(Message): The message to send.
str
: Message ID.
subscribe(agent_id, callback)
Subscribe an agent to receive messages.
agent_id
(str): ID of the subscribing agent.callback
(callable): Function to call when a message is received.
Memory Systems
Memory management components for persisting agent knowledge and system state.
MemoryManager
Central system for managing different types of memory.
store(memory_type, key, value, metadata={})
Store a value in memory.
memory_type
(str): Type of memory (working, long_term, etc.).key
(str): Key to store the value under.value
(any): Value to store.metadata
(dict, optional): Additional metadata about this memory.
str
: Memory entry ID.
retrieve(memory_type, key=None, query=None)
Retrieve values from memory.
memory_type
(str): Type of memory to query.key
(str, optional): Exact key to retrieve.query
(dict, optional): Query parameters for searching.
any
: Retrieved value(s).
WorkingMemory
Short-term, volatile memory for active processing.
LongTermMemory
Persistent storage for important information.
Knowledge Base
Components for managing structured knowledge and information access.
KnowledgeBase
System for storing and retrieving structured knowledge.
add_entry(category, data)
Add a new knowledge entry.
category
(str): Knowledge category.data
(dict): Knowledge data to store.
str
: Entry ID.
query(category=None, filters={})
Query the knowledge base.
category
(str, optional): Category to query.filters
(dict, optional): Query filters.
list
: Matching knowledge entries.
Monitoring & Reflection
Components for system self-monitoring and introspection.
SystemMonitor
Monitors system performance and agent activities.
register_metric(metric_name, callback=None)
Register a new metric to track.
metric_name
(str): Name of the metric.callback
(callable, optional): Function to compute metric value.
log_event(event_type, data)
Log a system event.
event_type
(str): Type of event.data
(dict): Event data.
get_metrics(metric_names=None, time_range=None)
Get current metric values.
metric_names
(list, optional): Names of metrics to retrieve.time_range
(tuple, optional): Start and end time for metric data.
dict
: Metric values.
Configuration
Utilities for system and agent configuration.
ConfigManager
Manages system and agent configurations.
load_config(config_path)
Load configuration from a file.
config_path
(str): Path to the configuration file.
dict
: Loaded configuration.
get(section, key=None, default=None)
Get configuration values.
section
(str): Configuration section.key
(str, optional): Specific configuration key.default
(any, optional): Default value if key doesn't exist.
any
: Configuration value.
set(section, key, value)
Set a configuration value.
section
(str): Configuration section.key
(str): Configuration key.value
(any): Value to set.
Utilities
Helper functions and utilities for working with the DREAMv1 system.
Logger
System logging utility.
log(level, message, context={})
Log a message.
level
(str): Log level (debug, info, warning, error, critical).message
(str): Log message.context
(dict, optional): Additional context information.
Serializer
Utilities for serializing and deserializing complex objects.
serialize(obj)
Serialize an object to a string format.
obj
(any): Object to serialize.
str
: Serialized representation.
deserialize(data, target_type=None)
Deserialize data back into an object.
data
(str): Serialized data.target_type
(type, optional): Expected type to deserialize into.
any
: Deserialized object.
Version History
Version | Release Date | Major Changes |
---|---|---|
0.1.0 | In Development | Initial release with core functionality |