From 21e60c2db5aa10d29057cbf895d01e0b7d2646d6 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Wed, 15 Jan 2025 13:09:46 -0500 Subject: [PATCH] Update readme --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++ src/marvin/settings.py | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 730cfd42f..5159bec6d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,48 @@ ![Marvin Banner](docs/assets/img/it_hates_me_hero.png) +## MIGRATION NOTES + +> ⚠️ **Important:** Marvin 3.0 is currently in very active development. The API may undergo breaking changes, and documentation is still being updated. Use with caution. + + +Marvin 3.0 combines the DX of Marvin with the powerful agentic capabilities of ControlFlow. Both Marvin and ControlFlow users will find a familiar interface, but there are some key changes to be aware of, in particular for ControlFlow users: + +### Key Changes +- **Pydantic AI**: Marvin 3.0 uses Pydantic AI for LLM interactions, and supports the full range of LLM providers that Pydantic AI supports. ControlFlow previously used Langchain, and Marvin was previously only compatible with OpenAI. +- **Flow → Thread**: The `Flow` concept has been renamed to `Thread`. Update your imports and usage: + ```python + import marvin + + with marvin.Thread(thread_id="optional-id-for-recovery"): + marvin.run("do something") + marvin.run("do another thing") + ``` + +- **Database Changes**: Thread/message history is now stored in SQLite. During development: + - Set `MARVIN_DATABASE_URL=":memory:"` for an in-memory database + - No migrations are currently available; expect to reset data during updates + +### New Features +- **Swarms**: Use `marvin.Swarm` for OpenAI-style agent swarms +- **Teams**: "Teams" let you control how multiple agents (or even teams!) work together. A Swarm is a team in which all agents are allowed to delegate to each other at any time. +- **Marvin Functions**: All your favorite Marvin functions are back: + - `@marvin.fn` + - `marvin.classify` + - `marvin.cast` + - `marvin.extract` + - `marvin.cast` + - + and more! + +### Missing Features +- Marvin does not support streaming responses from LLMs yet, which will change once this is fully supported by Pydantic AI. + +### Migration Tips +1. Replace `import controlflow` with `import marvin` +2. Update all `Flow` references to `Thread` +3. Review database persistence needs and configure accordingly +4. Test thoroughly as you migrate - APIs may change during the 3.0 development + # Marvin **✨ A delightful framework for building AI agents ✨** diff --git a/src/marvin/settings.py b/src/marvin/settings.py index 1f76b8fa1..9674b478a 100644 --- a/src/marvin/settings.py +++ b/src/marvin/settings.py @@ -46,7 +46,7 @@ def validate_home_path(cls, v: Path) -> Path: ) @model_validator(mode="after") - def validate_database_path(self) -> Self: + def validate_database_url(self) -> Self: """Set and validate the database path.""" # Set default if not provided if self.database_url is None: