Skip to content

Conversation

@pushpitkamboj
Copy link

Added the missing API documentation as outlined in issue #31.

  • Removed manually written documentation from markdown files.
  • Included Sphinx automodule directives, following the approach used in the Mesa documentation.
  • attached the video of documentation for reference.
docs_mesa-llm.mp4

Note: Work on examples and other documentation requirements mentioned in the issue is still in progress.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@colinfrisch
Copy link
Collaborator

Thanks a lot for your work !
I haven't had the time to check out the mesa documentation system, maybe @EwoutH or @wang-boyu could help you with this more than me...

@EwoutH
Copy link
Member

EwoutH commented Dec 27, 2025

Thanks for your PR!

I just reviewed and merged #33, which does something similar. If your PR does anything more than #33, please update (rebase / resolve update) your PR and let me know! :)

@colinfrisch
Copy link
Collaborator

In the meantime, I'm going to close it for organization purposes. Feel free to reopen it if you add some work on it :)

@pushpitkamboj
Copy link
Author

  • While the hardcoded documentation in PR docs: Add examples page and expand API documentation structure #33 works for now, it creates a maintenance burden by requiring manual updates every time the code changes. Following the approach used in the Mesa documentation, I suggest we use the Sphinx autodoc directive. This ensures the code remains the source of truth, making the documentation easier to maintain and more reliable as the project grows.
  • In PR Implemented API documentation using Sphinx #46, I’ve integrated API documentation using Sphinx autodoc, following the approach used in the Mesa documentation.
  • I am happy to follow whichever approach the team prefers, but I thought this would be a helpful step toward easier maintenance :)

@EwoutH
Copy link
Member

EwoutH commented Dec 28, 2025

  • Following the approach used in the Mesa documentation, I suggest we use the Sphinx autodoc directive.

This would be useful. An updated or new PR would be appreciated!

Copilot AI review requested due to automatic review settings December 29, 2025 04:46
Copy link

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 pull request replaces manually written API documentation with Sphinx automodule directives to automatically generate documentation from Python docstrings. The approach follows the Mesa documentation pattern and aims to reduce maintenance overhead while ensuring documentation stays synchronized with the codebase.

Key changes:

  • Removed detailed manual API documentation (~500+ lines) from 7 markdown files
  • Added Sphinx automodule directives to auto-generate docs from source code docstrings
  • Restructured documentation files with clearer section headings for different module components

Reviewed changes

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

Show a summary per file
File Description
docs/apis/tools.md Replaced manual documentation of @tool decorator, ToolManager class, and built-in tools with automodule directives for inbuilt_tools, tool_manager, and tool_decorator modules
docs/apis/recording.md Replaced detailed documentation of SimulationRecorder, @record_model decorator, SimulationEvent, and AgentViewer with automodule directives for simulation_recorder, agent_analysis, and record_model modules
docs/apis/reasoning.md Replaced manual documentation of Observation, Plan, Reasoning base class, and strategy implementations (CoT, ReAct, ReWOO) with automodule directives organized by strategy type
docs/apis/parallel_stepping.md Replaced extensive documentation about asyncio/threading modes and usage examples with a single automodule directive for the parallel_stepping module
docs/apis/module_llm.md Replaced detailed ModuleLLM class documentation, provider information, and usage examples with a single automodule directive
docs/apis/memory.md Replaced manual documentation of MemoryEntry, Memory base class, and memory implementations (STLTMemory, ShortTermMemory, EpisodicMemory) with automodule directives organized by memory type
docs/apis/llm_agent.md Replaced detailed LLMAgent class documentation and usage examples with a single automodule directive including inherited members

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

Comment on lines +7 to +11
```{eval-rst}
.. automodule:: mesa_llm.reasoning.reasoning
:members:
:undoc-members:
:show-inheritance:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.reasoning.reasoning is missing the :undoc-members: option that is present in other sections. This inconsistency may result in incomplete documentation if there are members without docstrings. Consider adding :undoc-members: for consistency with the other reasoning module sections.

Copilot uses AI. Check for mistakes.
from mesa_llm.reasoning.rewoo import ReWOOReasoning
```{eval-rst}
.. automodule:: mesa_llm.reasoning.react
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.reasoning.react is missing the :undoc-members: option that is present in the main reasoning section. This inconsistency should be fixed - either add :undoc-members: here or remove it from the reasoning.reasoning section for consistency.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.
## Usage in Mesa Simulations
```{eval-rst}
.. automodule:: mesa_llm.memory.st_memory
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.memory.st_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.
)
```{eval-rst}
.. automodule:: mesa_llm.memory.st_lt_memory
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.memory.st_lt_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.
Comment on lines +3 to 6
```{eval-rst}
.. automodule:: mesa_llm.module_llm
:members:
```
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Consider adding a brief introductory paragraph or sentence before the Sphinx automodule directive to explain what ModuleLLM provides. The old documentation had explanatory text that helped readers understand the unified interface for LLM providers. Even a single sentence would improve readability.

Copilot uses AI. Check for mistakes.
self.apply_plan(plan)
```{eval-rst}
.. automodule:: mesa_llm.reasoning.rewoo
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.reasoning.rewoo is missing the :undoc-members: option that is present in the main reasoning section. This inconsistency should be fixed - either add :undoc-members: here or remove it from the reasoning.reasoning section for consistency.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.
from mesa_llm.memory.st_lt_memory import STLTMemory
```{eval-rst}
.. automodule:: mesa_llm.memory.lt_memory
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.memory.lt_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.

```{eval-rst}
.. automodule:: mesa_llm.memory.episodic_memory
:members:
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The automodule directive for mesa_llm.memory.episodic_memory is missing the :undoc-members: option that is present in the "Memory Base Classes" section. For consistency across all memory module sections, consider adding :undoc-members: to this directive.

Suggested change
:members:
:members:
:undoc-members:

Copilot uses AI. Check for mistakes.
selected_tools=["move_one_step", "change_state"] # Restrict available tools for LLM calling
)
self.apply_plan(plan)
## Inbuilt Tools
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The section title "Inbuilt Tools" uses inconsistent terminology. The old documentation and other parts of the codebase refer to these as "Built-in Tools". Consider changing "Inbuilt" to "Built-in" for consistency with standard English terminology and the rest of the documentation.

Suggested change
## Inbuilt Tools
## Built-in Tools

Copilot uses AI. Check for mistakes.
Comment on lines +3 to 6
```{eval-rst}
.. automodule:: mesa_llm.parallel_stepping
:members:
```
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Consider adding a brief introductory paragraph or sentence before the Sphinx automodule directive to explain what this module provides. The old documentation had explanatory text that helped readers understand the context before diving into the auto-generated API docs. Even a single sentence would improve readability.

Copilot uses AI. Check for mistakes.
@pushpitkamboj
Copy link
Author

updated the PR and resolved the conflict, this PR can be safely merged now!

Copy link
Collaborator

@colinfrisch colinfrisch left a comment

Choose a reason for hiding this comment

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

I think that this looks good. @EwoutH would you change anything ?

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.

3 participants