Skip to content

v0.3 Documentation Update#422

Merged
ultmaster merged 12 commits intomainfrom
docs/v0-3-update
Dec 17, 2025
Merged

v0.3 Documentation Update#422
ultmaster merged 12 commits intomainfrom
docs/v0-3-update

Conversation

@ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Dec 17, 2025

Documents TBD:

  • Store parallelization
  • OTLP lightning store and store capabilities

Copilot AI review requested due to automatic review settings December 17, 2025 05:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation structure for v0.3, reorganizing content into more focused sections and improving API reference organization. The changes move emitter documentation to a dedicated tutorial page, extract utilities and semantic conventions into separate reference pages, and enhance code documentation.

Key changes:

  • Reorganized documentation navigation with dedicated pages for emitters, utilities, and semantic conventions
  • Moved emitter content from write-agents.md to a new standalone emitter.md tutorial
  • Enhanced utility functions with docstrings for better API documentation

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mkdocs.yml Updated navigation structure with new pages for emitters, semantic conventions, and utilities; renamed existing navigation items for consistency
docs/tutorials/write-agents.md Removed emitter section and updated link to point to new standalone emitter documentation
docs/tutorials/emitter.md New comprehensive tutorial covering emitter functions, operations, and span linking with detailed examples
docs/reference/utilities.md New reference page documenting utility functions for ID generation, metrics, server launcher, OpenTelemetry, OTLP, and system snapshots
docs/reference/types.md Removed semantic conventions section (moved to dedicated page)
docs/reference/semconv.md New dedicated reference page for semantic conventions
docs/reference/internal.md Removed utilities section (promoted to public reference page)
docs/how-to/examples-catalog.md Removed outdated Search-R1 RL example
agentlightning/utils/system_snapshot.py Added docstring to system_snapshot function
agentlightning/utils/otel.py Added missing functions to all exports list
agentlightning/utils/id.py Added docstring to generate_id function
agentlightning/emitter/object.py Fixed error message to correctly reference "object span" instead of "annotation span"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Agent-lightning provides an **emitter** module that allows you to record custom spans from within your agent's logic. Like many common operations (like LLM calls) that are automatically instrumented by [Tracer][agentlightning.Tracer], the emitter will also send a [Span][agentlightning.Span] that records an Agent-lightning-specific operation. Then algorithms can query and read those spans later. See [Working with Traces](./traces.md) for more details.

For multi-step routines (function calls, tools, or adapters) you can wrap code with [`operation`][agentlightning.operation], either as a decorator or a context manager,to capture inputs, outputs, and metadata on a dedicated [`operation`][agentlightning.operation] span. This makes it easier to correlate downstream annotations (like rewards or messages) with the higher-level work that produced them.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma in the sentence. Should be "context manager, to capture" instead of "context manager,to capture".

Copilot uses AI. Check for mistakes.

### Operations

The [`operation`][agentlightning.operation] helper tracks logical units of work within your agent, capturing inputs, outputs, timing, and success/failure status. Unlike point-in-time emitters, operations create a span representing a time interval. Use operations for tool calls, multi-step workflows, debugging, and performance monitoring. [`operation][agentlightning.operation] can be used either as a decorator or a context manager.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the markdown reference. Missing closing bracket before the link reference. Should be "[operation][agentlightning.operation]" instead of "[`operation][agentlightning.operation]".

Copilot uses AI. Check for mistakes.
from opentelemetry.semconv.attributes import server_attributes
from agentlightning import emit_annotation

emit_object({
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect function call: using emit_object but importing and intending to use emit_annotation. The code imports emit_annotation on line 60 but then calls emit_object on line 62. This should be emit_annotation to match the import statement.

Copilot uses AI. Check for mistakes.
mkdocs.yml Outdated
Comment on lines 110 to 112
- Debug: tutorials/debug.md
- Work with Traces: tutorials/traces.md
- Use Emitters: tutorials/emitter.md
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent naming pattern: The navigation items use inconsistent verb forms. "Debug" and "Write Agents" are in imperative form, while "Work with Traces" and "Use Emitters" include prepositions. Consider either using "Debugging" (gerund) or ensuring all use the imperative form without prepositions (e.g., "Debug", "Trace", "Emit").

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

```python
with agl.operation(tool_name="web_search") as op:
op.set_input(query="latest AI research", filters={"date": "2024"})
results = search_web(query, filters)
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example has a logic error. Line 157 calls op.set_input(query="latest AI research", filters={"date": "2024"}) which sets keyword arguments, but line 158 tries to use query and filters as variables in search_web(query, filters). These variables are not defined in the local scope. Either define them before the operation context or use string literals in the function call to fix this example.

Suggested change
results = search_web(query, filters)
results = search_web("latest AI research", {"date": "2024"})

Copilot uses AI. Check for mistakes.
@ultmaster ultmaster merged commit 22b80b3 into main Dec 17, 2025
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant