First-party AI/LLM companion to the Lauren web framework
Project description
lauren-ai
lauren-ai: the first-party AI/LLM companion to the Lauren web framework. Agents, tools, memory, workflows, RAG, and evaluation in the same decorator-first, DI-driven programming model.
Documentation: https://ai.lauren-py.dev
Source Code: https://github.com/lauren-framework/lauren-ai
For AI Agents & Coding Assistants
Install all skills in one command
# Claude Code, Cursor, Copilot, Continue, Codex CLI -- auto-detected
npx skills add lauren-framework/lauren-ai
This copies the repository's skill packs into your agent's global skills
directory (~/.claude/skills/, ~/.cursor/skills/, etc.). The next time your
agent opens a lauren-ai project it has pre-loaded guidance on agents, tools,
memory, evaluation, workflows, and Lauren integration patterns.
| Resource | What it contains |
|---|---|
llms.txt |
2 KB overview -- start here |
llms-full.txt |
Complete reference -- all decorators, memory, guardrails, teams, and common errors |
AGENTS.md |
By-task lookup, common errors, skills index, definition of done |
CLAUDE.md |
Architecture invariants, commands, pattern selection, codemap navigation |
skills/ |
Copy-paste skill guides covering common lauren-ai tasks |
Skills index: skills/
lauren-ai is the first-party AI/LLM companion to the
Lauren web framework. It
brings large language model agents into the same decorator-first, DI-driven,
module-scoped programming model the rest of Lauren uses. It is built on these
core ideas:
- Decorator-first metadata. Agents, tools, teams, guardrails, prompt templates, and memory behaviors are declared with decorators and metadata rather than custom runtime glue.
- Module-scoped integration.
LLMModule.for_root()andAgentModule.for_root()plug into Lauren's module system so transports, runners, tools, and stores compose like the rest of your application. - Provider-agnostic execution. Anthropic, OpenAI, Ollama, LiteLLM, and
MockTransportall flow through a unified transport layer and consistent agent runner API. - AI-ready by default. The public surface is mirrored in
llms.txt,llms-full.txt,AGENTS.md,CLAUDE.md, andskills/so both human and AI contributors can navigate the package quickly.
Features
- Provider-agnostic transport - Anthropic, OpenAI, Ollama, LiteLLM, and
MockTransportfor zero-network-call tests. @tool()decorator - Function-form and class-form (DI-injected), with JSON Schema auto-generated from type hints and docstrings.@agent()decorator - Autonomous agentic loop withuse_tools(), lifecycle hooks, retry/error policies, and budget guards.- Four memory tiers -
ShortTermMemory,ConversationStore,UserMemoryStoreplus@remember(), and vector-backed retrieval for RAG. - Typed extractors -
Agent[T],Completion[T],Embed[T], andStreamCompletion[T]as Lauren handler parameters. - Module factories -
LLMModule.for_root()andAgentModule.for_root()feel like the rest of Lauren's DI-first module configuration. - Knowledge Base and agentic RAG -
KnowledgeBasewith document loaders, hybrid retrieval, andkb.as_tool(). - Structured workflows -
Workflow,Step,Parallel,Condition, andLoopfor deterministic multi-agent pipelines. - Tool enhancements - Human-in-the-loop confirmation, pre/post hooks, and result caching.
- Extended thinking - First-class support for Claude extended thinking and OpenAI reasoning models.
- Evaluation framework -
AccuracyEval,AgentJudge,TrajectoryEval, andPerformanceEval. - Signals -
ModelCallComplete,ToolCallComplete, andAgentRunCompletefor observability. - Pre-built skills -
WebSearchTool,CodeExecutionTool, andHttpFetchTool. - Testable - Zero API calls needed in unit tests via
MockTransport.
Requirements
Python 3.11, 3.12, 3.13, and 3.14 are supported. Core dependencies:
- Lauren - the host web framework and DI/module runtime.
- Pydantic - structured models, schemas, and validation.
- httpx - provider HTTP transport.
- anyio - concurrency primitives and async portability.
Installation
# Core (no LLM provider extras)
pip install lauren-ai
# With Anthropic
pip install "lauren-ai[anthropic]"
# With OpenAI
pip install "lauren-ai[openai]"
# With everything
pip install "lauren-ai[all]"
Quick start
import os
from pydantic import BaseModel
from lauren import LaurenFactory, controller, module, post
from lauren.types import Json
from lauren_ai import (
Agent,
AgentModule,
AgentRunner,
InMemoryConversationStore,
LLMConfig,
LLMModule,
agent,
tool,
use_tools,
)
@tool()
async def get_weather(city: str) -> dict:
"""Get current weather for a city.
Args:
city: The city name.
"""
return {"city": city, "temperature_c": 18, "condition": "cloudy"}
# @agent() is outermost; @use_tools() is below it (applied first)
@agent(model="claude-opus-4-6", system="You are a helpful travel assistant.")
@use_tools(get_weather)
class TravelAgent: ...
class AskRequest(BaseModel):
question: str
@controller("/travel")
class TravelController:
def __init__(self, runner: AgentRunner) -> None:
self._runner = runner
@post("/ask")
async def ask(self, body: Json[AskRequest], agent: Agent[TravelAgent]) -> dict:
response = await self._runner.run(agent, body.question)
return {"answer": response.content, "turns": response.turns}
LLMProviderModule = LLMModule.for_root(
LLMConfig.for_anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
)
AIAgentModule = AgentModule.for_root(
agents=[TravelAgent],
tools=[get_weather],
conversation_store=InMemoryConversationStore(), # history persists across requests
)
@module(controllers=[TravelController], imports=[LLMProviderModule, AIAgentModule])
class AppModule: ...
app = LaurenFactory.create(AppModule)
uvicorn main:app --reload
Development
# Install with dev dependencies
uv sync --extra dev --extra anthropic
# Run tests
uv run nox -s tests
# Run linter
uv run nox -s lint
# Run typecheck
uv run nox -s typecheck
# Build docs
uv run nox -s docs
License
MIT - see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lauren_ai-1.1.0.tar.gz.
File metadata
- Download URL: lauren_ai-1.1.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e4caf96aacef12c410f8b1ab0381564507974e29134ab7c5dc583e4aebc31b1
|
|
| MD5 |
75a781e5b67750be67c9d97b60fd69f3
|
|
| BLAKE2b-256 |
12c14befe74beda5e76e1d1c106323f9be64b1872344f090fe9dfcefa818772e
|
Provenance
The following attestation bundles were made for lauren_ai-1.1.0.tar.gz:
Publisher:
release.yml on lauren-framework/lauren-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lauren_ai-1.1.0.tar.gz -
Subject digest:
7e4caf96aacef12c410f8b1ab0381564507974e29134ab7c5dc583e4aebc31b1 - Sigstore transparency entry: 1591595923
- Sigstore integration time:
-
Permalink:
lauren-framework/lauren-ai@aab48b9cb03f3eba715f67e9b0f9f5274092f2db -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/lauren-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aab48b9cb03f3eba715f67e9b0f9f5274092f2db -
Trigger Event:
push
-
Statement type:
File details
Details for the file lauren_ai-1.1.0-py3-none-any.whl.
File metadata
- Download URL: lauren_ai-1.1.0-py3-none-any.whl
- Upload date:
- Size: 198.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e731f0fbb12e3e849e4a7ce54a7d5b7ec1ecfe9cb5a86b7e25b952d51fb9bd
|
|
| MD5 |
755531a822728d26008d899e2664edc2
|
|
| BLAKE2b-256 |
32add48ec5e84ef9417caf3655dcee0a3ead889e28d7cbee27605fec08ef3e59
|
Provenance
The following attestation bundles were made for lauren_ai-1.1.0-py3-none-any.whl:
Publisher:
release.yml on lauren-framework/lauren-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lauren_ai-1.1.0-py3-none-any.whl -
Subject digest:
d9e731f0fbb12e3e849e4a7ce54a7d5b7ec1ecfe9cb5a86b7e25b952d51fb9bd - Sigstore transparency entry: 1591596022
- Sigstore integration time:
-
Permalink:
lauren-framework/lauren-ai@aab48b9cb03f3eba715f67e9b0f9f5274092f2db -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/lauren-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aab48b9cb03f3eba715f67e9b0f9f5274092f2db -
Trigger Event:
push
-
Statement type: