Metadata-Version: 2.5
Name: withlore
Version: 0.2.0a21
Summary: Record, simulate and evaluate voice and text agents with Lore.
Project-URL: Homepage, https://www.lore-labs.ai
Project-URL: Documentation, https://docs.lore-labs.ai
Project-URL: Source, https://github.com/lore-ai-labs/withlore-sdk
Project-URL: Changelog, https://github.com/lore-ai-labs/withlore-sdk/blob/main/python/CHANGELOG.md
Author-email: "Lore AI Labs, Inc." <hi@lore-labs.ai>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: opentelemetry-api<2,>=1.28
Requires-Dist: opentelemetry-exporter-otlp-proto-common<2,>=1.28
Requires-Dist: opentelemetry-proto<2,>=1.28
Requires-Dist: opentelemetry-sdk<2,>=1.28
Requires-Dist: requests<3,>=2.32
Requires-Dist: rfc8785<1,>=0.1.4
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.48; extra == 'anthropic'
Requires-Dist: openinference-instrumentation-anthropic>=2.1.1; extra == 'anthropic'
Provides-Extra: claude-agent-sdk
Requires-Dist: claude-agent-sdk>=0.1.10; extra == 'claude-agent-sdk'
Requires-Dist: openinference-instrumentation-claude-agent-sdk>=0.1.15; extra == 'claude-agent-sdk'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.28; extra == 'langchain'
Requires-Dist: openinference-instrumentation-langchain>=0.1.73; extra == 'langchain'
Provides-Extra: livekit
Requires-Dist: livekit-agents<2,>=1.2; (python_version >= '3.11') and extra == 'livekit'
Requires-Dist: livekit<2,>=1.1; extra == 'livekit'
Provides-Extra: openai
Requires-Dist: openai>=1.71; extra == 'openai'
Requires-Dist: openinference-instrumentation-openai>=0.1.57; extra == 'openai'
Provides-Extra: openai-agents
Requires-Dist: openai-agents>=0.0.19; extra == 'openai-agents'
Requires-Dist: openinference-instrumentation-openai-agents>=2.2.0; extra == 'openai-agents'
Description-Content-Type: text/markdown

# withlore

Connect your voice or text agent to [Lore](https://www.lore-labs.ai). Lore records its
traces, tool calls, conversations and call audio, then simulates users against it and
grades every conversation.

**Documentation: [docs.lore-labs.ai](https://docs.lore-labs.ai)**

Create a key in Lore under **Settings → Projects & keys**, then:

```bash
export LORE_API_KEY="lore_sk_..."
```

## Voice agents (LiveKit)

```bash
pip install "withlore[livekit]"
```

In your job entrypoint, before `session.start()`:

```python
from withlore.livekit import observe

await observe(ctx, session)
await session.start(agent=agent, room=ctx.room)
```

Lore records both sides of the call audio, the transcript with per-turn latency, tool
calls and LiveKit's spans. When Lore simulates callers against your agent, the same call
records into the simulation instead of production. See the [LiveKit guide](https://docs.lore-labs.ai/voice/livekit).

## Text and AI agents

Install `withlore` with the extra for your framework, then call `withlore.init()` at
startup, before you create your model client.

```bash
pip install "withlore[openai]"
```

```python
import withlore

withlore.init()

with withlore.conversation() as convo:
    reply = client.chat.completions.create(model="gpt-5-mini", messages=messages)
    convo.record(messages + [reply.choices[0].message])
```

`withlore.init()` records traces. `convo.record()` records the conversation from the
messages your framework already keeps: OpenAI and Anthropic message lists, OpenAI Agents
SDK results, LangChain and LangGraph messages, and Claude Agent SDK messages.

| Framework | Install |
| --- | --- |
| OpenAI | `withlore[openai]` |
| Anthropic | `withlore[anthropic]` |
| OpenAI Agents SDK | `withlore[openai-agents]` |
| Claude Agent SDK | `withlore[claude-agent-sdk]` |
| LangChain / LangGraph | `withlore[langchain]` |

See [Record conversations](https://docs.lore-labs.ai/text/record-conversations) for
chats that span several requests.

## Simulate and evaluate

`withlore.Client` and the `withlore` CLI run scenarios, simulations and grading from
code or CI. Start with `withlore auth login`, then `withlore catalog --json`. See
[Evaluate your agent](https://docs.lore-labs.ai/evaluate/overview).

## Privacy

By default Lore receives operational metadata only: models, token counts, timing and
status. Prompts, transcripts, tool payloads and audio are recorded only when your code
asks for them and your project admits them. See
[Privacy](https://docs.lore-labs.ai/guides/privacy).

## Links

- [Documentation](https://docs.lore-labs.ai)
- [Release history](https://pypi.org/project/withlore/#history)

Licensed under Apache-2.0.
