agentleFS
lauren-frameworklauren-framework/lauren-ai/skills/migrating-to-lauren-ai/SKILL.md

migrating-to-lauren-ai

Skill0 starsChanged 6 months agoMITView on GitHub

Ports AI agent code from LangChain or the raw OpenAI SDK to the lauren-ai framework. Provides side-by-side equivalents for chains, agents, tools, memory, and prompts. Use when converting LangChain or OpenAI-SDK-based agent code to lauren-ai, or when a user is familiar with those frameworks and needs the lauren-ai equivalents.

The file

Files
SKILL.md

Migrating to Lauren AI

Use codemap find "SymbolName" to locate any symbol before reading — it gives exact file + line range and is faster than grep.

Quick comparison table

LangChainOpenAI SDKLauren AI
Tool / @toolfunction + tools=[{...}]@tool() async function or class
AgentExecutormanual loop + tool dispatchAgentRunnerBase / AgentRunner[X]
ChatOpenAI / ChatAnthropicopenai.Client / anthropic.AnthropicLLMModule.for_root(LLMConfig(...))
ConversationBufferMemorymanual message listInMemoryConversationStore
ChatPromptTemplate[{"role": ..., "content": ...}] list@agent(system=...) + message list
RunnableSequence / `` chainmanual loop@agent with multiple @tools
BaseTool.invoketool_call dispatchToolContext injected by the runner
AgentType.OPENAI_FUNCTIONSassistants API@agent + @use_tools(...)
LLMChainsingle chat.completions.createLLMService.complete() (low-level)
  • LangChain migration: from-langchain.md
  • OpenAI SDK migration: from-openai-sdk.md

The key conceptual shift

LangChain and the OpenAI SDK are call-time frameworks: you assemble chains or message lists and call them. Lauren AI is declaration-time: you declare agents and tools with decorators, and the framework builds the agentic loop, tool dispatch, memory management, and streaming for you.

# OpenAI SDK — manual loop
while True:
    response = client.chat.completions.create(model="gpt-4o", messages=messages, tools=tools)
    if response.choices[0].finish_reason == "tool_calls":
        # dispatch each tool call manually
        ...
    else:
        break

# Lauren AI — declarative loop
@agent(model="gpt-4o", system="...", max_turns=10)
@use_tools(MyTool, AnotherTool)
class MyAgent: ...

result = await runner.run(my_agent, "user message")  # loop runs automatically

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.