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.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/building-agents/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- adding-guardrailsSkill
- agent-health-timeoutSkill
- agent-permission-scopingSkill
- agent-session-isolationSkill
- agent-step-loggingSkill
- agent-supervisor-routerSkill
- agent-telemetrySkill
- async-agent-backgroundSkill
- building-agentsSkill
- building-teamsSkill
- building-toolsSkill
- calendar-scheduling-toolSkill
- callback-tracing-handlerSkill
- chain-of-thought-promptingSkill
- chat-model-configurationSkill
- code-execution-sandboxSkill
- common-agent-patternsSkill
- context-window-managementSkill
- conversation-memorySkill
- conversation-state-dbSkill
- database-query-toolSkill
- document-loadersSkill
- document-rerankingSkill
- email-notification-toolSkill
- embedding-model-ingestionSkill
- fallback-model-chainSkill
- few-shot-injectionSkill
- filesystem-toolSkill
- human-in-the-loopSkill
- hybrid-searchSkill
- inspecting-streamsSkill
- integrating-with-laurenSkill
- json-schema-enforcementSkill
- llm-provider-connectionSkill
- llm-rate-limitingSkill
- long-term-vector-memorySkill
- managing-memorySkill
- multi-agent-delegationSkill
- multi-tool-orchestrationSkill
- multi-turn-tool-stateSkill
- output-guardrailsSkill
- plan-and-execute-agentSkill
- prompt-injection-defenseSkill
- prompt-versioningSkill
- rag-pipelineSkill
- react-agent-loopSkill
- response-validation-retrySkill
- rest-api-toolSkill
- securing-agentsSkill
- semantic-cacheSkill
- streaming-response-handlerSkill
- structured-output-parsingSkill
- sub-agent-spawningSkill
- system-prompt-templatingSkill
- testing-agentsSkill
- The first 60 shown.
The file
Files
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
| LangChain | OpenAI SDK | Lauren AI | |
Tool / @tool | function + tools=[{...}] | @tool() async function or class | |
AgentExecutor | manual loop + tool dispatch | AgentRunnerBase / AgentRunner[X] | |
ChatOpenAI / ChatAnthropic | openai.Client / anthropic.Anthropic | LLMModule.for_root(LLMConfig(...)) | |
ConversationBufferMemory | manual message list | InMemoryConversationStore | |
ChatPromptTemplate | [{"role": ..., "content": ...}] list | @agent(system=...) + message list | |
RunnableSequence / ` | ` chain | manual loop | @agent with multiple @tools |
BaseTool.invoke | tool_call dispatch | ToolContext injected by the runner | |
AgentType.OPENAI_FUNCTIONS | assistants API | @agent + @use_tools(...) | |
LLMChain | single chat.completions.create | LLMService.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 automaticallyDoes 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
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.

