agentCores is a powerful MongoDB-based system for creating, managing, and deploying AI agents. It provides a comprehensive framework for handling complex agent configurations, making it easier to work with multiple AI models and agent types.
-
Agent Configuration Management:
- Create, store, and manage AI agent configurations in MongoDB
- Version control and unique identifiers for each agent
- Template-based agent creation with extensive customization
-
Database Integration:
- MongoDB collections for agent data, conversations, and knowledge
- Customizable collection structures and configurations
- Built-in database management and optimization
-
Model and Prompt Management:
- Support for multiple AI models (language, vision, speech)
- Structured prompt templates and version control
- Integration with Ollama and other model providers
-
Research and Development Tools:
- Built-in research assistant capabilities
- Paper and code repository integration
- Knowledge base management
-
Command-line Interface:
- Interactive agent management
- Real-time chat capabilities
- Database administration tools
pip install agentCores
- Python 3.8+
- MongoDB
- ollama (optional, for LLM functionality)
- duckduckgo_search (optional, for research capabilities)
agentCores uses a single MongoDB database named agentCores
with organized collections:
MongoDB Database: agentCores/
├── System Collections:
│ ├── agent_matrix # Main agent configurations
│ ├── documentation # System documentation
│ ├── templates # Agent templates
│ └── template_files # Template resources
├── Agent-Specific Collections:
│ ├── conversations_{agent_id} # Chat history
│ ├── knowledge_{agent_id} # Knowledge base
│ ├── embeddings_{agent_id} # Vector embeddings
│ ├── research_{agent_id} # Research data
│ └── design_patterns_{agent_id} # Agent patterns
└── Shared Collections:
├── global_knowledge # Shared knowledge base
├── model_configs # Model configurations
└── prompt_templates # Prompt templates
from agentCores import agentCores
# Initialize with default MongoDB connection
core = agentCores()
# Or specify custom MongoDB connection
core = agentCores(connection_uri="mongodb://localhost:27017/")
# Create a simple agent
agent = core.mintAgent(
agent_id="my_assistant",
model_config={
"largeLanguageModel": {
"names": ["llama2"],
"instances": None,
"concurrency": [],
"parrallelModels": None
}
},
prompt_config={
"userInput": "You are a helpful assistant",
"agent": {
"llmSystem": "Provide clear and concise answers",
"llmBooster": "Use examples when helpful"
}
}
)
# Start chatting
core.chat_with_agent("my_assistant")
from agentCores import researchAssistant
# Initialize research assistant with MongoDB connection
assistant = researchAssistant(
agent_id="research_agent",
connection_uri="mongodb://localhost:27017/"
)
# Process a research query
response = assistant.process_query("What is quantum computing?")
# Start interactive research session
assistant.start_chat()
{
"agentCore": {
"identifyers": {
"agent_id": str, # Unique identifier
"uid": str, # Generated hash
"version": int, # Version number
"creationDate": float, # Creation timestamp
"cpuNoiseHex": str # Hardware identifier
},
"models": {
"largeLanguageModel": {
"names": list, # Model names
"instances": None, # Instance count
"concurrency": list, # Concurrency settings
"parrallelModels": None,
"model_config_template": dict
},
"largeLanguageAndVisionAssistant": dict,
"yoloVision": dict,
"speechRecognitionSTT": dict,
"voiceGenerationTTS": dict,
"embedding": dict
},
"prompts": {
"userInput": str,
"agent": {
"llmSystem": str,
"llmBooster": str,
"visionSystem": str,
"visionBooster": str
}
},
"modalityFlags": {
"TTS_FLAG": bool, # Text-to-speech
"STT_FLAG": bool, # Speech-to-text
"CHUNK_AUDIO_FLAG": bool,
"AUTO_SPEECH_FLAG": bool,
"LLAVA_FLAG": bool,
"SCREEN_SHOT_FLAG": bool,
"SPLICE_VIDEO_FLAG": bool,
"AUTO_COMMANDS_FLAG": bool,
"CLEAR_MEMORY_FLAG": bool,
"ACTIVE_AGENT_FLAG": bool
},
"evolutionarySettings": {
"mutation": float,
"pain": float,
"hunger": float,
"fasting": bool,
"rationalizationFactor": float
}
}
}
Start the interface:
python -m agentCores
Available commands:
/help Show available commands
/agentCores List all agent cores
/showAgent <agent_id> Show agent configuration
/createAgent <template_id> <new_agent_id> Create new agent
/createCustomAgent Interactive agent creation
/createCollection <name> Create MongoDB collection
/linkCollection <agent_id> <collection_name> Link collection to agent
/storeAgent <file_path> Import agent from JSON
/exportAgent <agent_id> Export agent to JSON
/deleteAgent <agent_id> Delete an agent
/resetAgent <agent_id> Reset agent to base template
/chat <agent_id> Start chat session
/knowledge <agent_id> View knowledge base
/conversations <agent_id> View conversation history
model_config = {
"largeLanguageModel": {
"instances": 2,
"names": ["llama2", "codellama"],
"concurrency": ["parallel", "sequential"],
"parrallelModels": True,
"model_config_template": {
"temperature": 0.7,
"context_window": 4096,
"streaming": True
}
}
}
agent = core.mintAgent(
agent_id="advanced_agent",
model_config=model_config
)
# Create collection with indexes
core.create_collection_with_schema(
"research_papers",
indexes=[
[("paper_id", 1)],
[("title", "text")]
]
)
# Link collection to agent
core.linkDatabase(
"research_agent",
"research_papers"
)
from agentCores import researchAssistant
# Initialize with custom configuration
assistant = researchAssistant(
agent_id="research_agent",
connection_uri="mongodb://localhost:27017/"
)
# Create research collection
assistant.core.create_collection_with_schema(
"papers",
indexes=[
[("paper_id", 1)],
[("title", "text")]
]
)
# Process research queries
results = assistant.search("quantum computing")
response = assistant.process_query(
"Explain recent advances in quantum computing"
)
# Create custom collection with indexes
core.create_collection_with_schema(
"research_papers",
indexes=[
[("paper_id", 1)],
[("title", "text")]
]
)
# Execute query
results = core.execute_query(
"research_papers",
{"title": {"$regex": "neural networks", "$options": "i"}}
)
# Bulk operations
core.bulk_insert(
"research_papers",
documents=[...]
)
# Register template
template_id = core.register_template(
"research_template",
template_data={...},
metadata={"version": "1.0"}
)
# Get template
template = core.get_template("research_template")
# List templates
templates = core.list_templates()
-
Database Management
- Use descriptive collection names
- Implement proper MongoDB indexes
- Regular maintenance of collections
- Back up important data
-
Agent Creation
- Start with templates
- Version control configurations
- Document custom settings
- Test before deployment
-
Error Handling
- Implement proper exception handling
- Log errors and warnings
- Include recovery strategies
- Monitor agent performance
- Fork the repository
- Create a feature branch
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation
- Submit pull request
MIT License - see LICENSE file for details
Leo Borcherding
- GitHub: https://github.com/Leoleojames1/agentCores
- Documentation: https://agentcore.readthedocs.io/
- Issues: https://github.com/Leoleojames1/agentCores/issues
0.1.27 (2024-12-11)