In-Memory Storage for Workflows
Example using InMemoryDb with workflows for multi-step processes.
Usage
1from kern.agent import Agent2from kern.db.in_memory import InMemoryDb3from kern.models.openai import OpenAIResponses4from kern.team import Team5from kern.tools.hackernews import HackerNewsTools6from kern.workflow.step import Step7from kern.workflow.workflow import Workflow89# Setup in-memory database10db = InMemoryDb()1112# Create agents and team13research_agent = Agent(14 name="Research Agent",15 model=OpenAIResponses(id="gpt-5.2"),16 tools=[HackerNewsTools()],17)1819content_agent = Agent(20 name="Content Agent",21 model=OpenAIResponses(id="gpt-5.2"),22)2324# Define workflow steps25research_step = Step(name="Research", agent=research_agent)26content_step = Step(name="Content", agent=content_agent)2728# Create workflow29workflow = Workflow(30 name="Content Workflow",31 db=db,32 steps=[research_step, content_step],33)3435workflow.print_response("AI trends in 2024")