Marvin is a Python framework for building AI applications with LLMs.
Marvin provides a clean, intuitive interface for working with large language models (LLMs) while handling all the complexity of state management, conversation history, and agent coordination.
Create agents with specific skills and personalities:
Copy
Ask AI
import marvin# Create specialized agentspoet = marvin.Agent( name="Poet", instructions="You are an expert poet who writes in various styles.")scientist = marvin.Agent( name="Scientist", instructions="You are a scientist who explains complex topics clearly.")# Use them for specific tasksexplanation = marvin.run( "Explain entropy briefly", agents=[scientist])poem = marvin.run( "Write a haiku about entropy", agents=[poet], context={"scientific_background": explanation})print(poem)
Give your agents memory that persists across conversations:
Copy
Ask AI
import marvin# Create a memory modulepreferences = marvin.Memory( key="user_preferences", instructions="Remember user preferences and style")# Create an agent with memoryassistant = marvin.Agent(memories=[preferences])# The agent will remember information across conversationsmarvin.run( "Learn about the user's writing style preferences", agents=[assistant], cli=True)