feat(examples): CAJAL scientific writing β re-implemented as examples (not core)#1644
Conversation
β¦ion) Re-implements the CAJAL / scientific-paper functionality that was reverted from the core SDK (PR #1611 / revert #1641) as proper examples per AGENTS.md: - examples/scientific_writing/scientific_writer.py Single-agent pattern: regular Agent + @tool functions, no subclass. Uses the CAJAL-4B HuggingFace model via litellm. - examples/scientific_writing/multi_agent_paper.py Multi-agent workflow: Literature Reviewer -> Methodologist -> Writer composed with AgentTeam + sequential Tasks (no custom Agent classes). - examples/scientific_writing/agents.yaml YAML parity for the multi-agent workflow (AGENTS.md Β§7 '3-way' rule). Why this location: - AGENTS.md Β§4.1: core SDK has no heavy domain implementations. - AGENTS.md Β§4.4: compose specialised Agents + tools, don't subclass Agent. - AGENTS.md Β§6.1: domain-specific behaviour belongs in @tool functions. - Wrapper / praisonai-tools were alternatives; examples/ keeps it discoverable and avoids bloating either package.
β You've reached your Qodo monthly free-tier limit. Reviews pause until next month β upgrade your plan to continue now, or link your paid account if you already have one. |
|
Caution Review failedThe pull request is closed. βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (3)
π WalkthroughWalkthroughThis PR adds three new example files for a scientific paper writing workflow. The changes introduce reusable LaTeX and citation formatting tools, a configurable scientific writer agent, a multi-agent Python orchestration using AgentTeam, and a declarative YAML configuration that mirrors the Python implementation. ChangesScientific Writing Workflow Examples
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~25 minutes Possibly related PRs
Suggested labels
Poem
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
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. Comment |
|
@copilot Do a thorough review of this PR. Read ALL existing reviewer comments above from Qodo, Coderabbit, and Gemini first β incorporate their findings. Review areas:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a multi-agent workflow for scientific writing, providing both YAML and Python implementations. It includes specialized agents for literature review, methodology design, and LaTeX-formatted paper assembly using the CAJAL-4B model. Feedback suggests updating the format_citation tool to use LaTeX formatting instead of Markdown italics to ensure consistency with the overall LaTeX output requirements.
|
|
||
| Returns: | ||
| One APA-formatted citation string. | ||
| """ |
There was a problem hiding this comment.
The format_citation tool currently returns Markdown-style italics (*venue*). Since the agent is specifically instructed to produce LaTeX-formatted academic papers (as seen in the instructions and the format_latex_section tool), this should be updated to use the LaTeX \\textit{} command for consistency.
return f"{authors} ({year}). {title}. \\textit{{{venue}}}."
Greptile SummaryThis PR re-implements the CAJAL scientific-writing functionality as proper examples (not core SDK), satisfying AGENTS.md rules by placing all code under
Confidence Score: 4/5Safe to merge with one fix: the YAML run command in the header comment will mislead users into a CLI error. All three files are example-only additions with no changes to core SDK code. The Python files are functionally sound β AgentTeam wires sequential context automatically so the writer agent receives upstream outputs. The one concrete defect is in agents.yaml: the documented run command does not correspond to any real CLI flag and will error for anyone following the instructions. examples/scientific_writing/agents.yaml β the header run command needs to be corrected to match the actual CLI interface. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant AgentTeam
participant LitReviewer as Literature Reviewer
participant Methodologist as Methodology Designer
participant Writer as Scientific Writer
User->>AgentTeam: run(topic)
AgentTeam->>LitReviewer: Task: review_literature
LitReviewer-->>AgentTeam: APA literature review
AgentTeam->>Methodologist: Task: design_methodology
Methodologist-->>AgentTeam: LaTeX methods section
AgentTeam->>Writer: Task: write_paper
Writer-->>AgentTeam: Complete LaTeX paper
AgentTeam-->>User: result
Reviews (1): Last reviewed commit: "feat(examples): add scientific writing e..." | Re-trigger Greptile |
| @@ -0,0 +1,40 @@ | |||
| # Scientific paper workflow β YAML equivalent of multi_agent_paper.py | |||
| # Run with: | |||
| # praisonai agents run --file examples/scientific_writing/agents.yaml | |||
There was a problem hiding this comment.
Incorrect CLI command in usage comment
The praisonai agents run --file flag does not exist. The praisonai agents run subcommand only accepts --agent and --task flags for inline agent definitions. Running this comment verbatim will produce an error. Based on patterns in examples/yaml/ (e.g., praisonai run workflow_robustness.yaml or praisonai workflow run hybrid-workflow.yaml), the correct invocation for a roles-based YAML is praisonai run examples/scientific_writing/agents.yaml.
| """ | ||
| from praisonaiagents import Agent, AgentTeam, Task | ||
|
|
||
| from scientific_writer import ( # noqa: E402 β example imports a sibling file |
There was a problem hiding this comment.
The
# noqa: E402 suppression is misapplied. E402 flags module-level imports that appear after non-import statements; here the import is at line 13, at the very top of the file and immediately follows the first import β there is no non-import code before it to trigger E402. The comment is misleading and should be removed.
| from scientific_writer import ( # noqa: E402 β example imports a sibling file | |
| from scientific_writer import ( # sibling-file import; works when run from this directory |
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on Python packages (praisonaiagents, praisonai). Do NOT modify praisonai-rust or praisonai-ts. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. Phase 1: Review per AGENTS.md
Phase 2: FIX Valid Issues Phase 3: Final Verdict |
|
Claude finished @MervinPraison's task ββ View job β’ Final Architecture Review β APPROVEDTodo List:
Phase 1: AGENTS.md Compliance βProtocol-Driven Core: β
PASSES Backward Compatibility: β
PASSES Performance: β
PASSES Agent-Centric Design: β PASSES
3-Way Compliance: β
PASSES Phase 2: Issues Fixed βAll valid reviewer feedback addressed:
Phase 3: Final Verdict β APPROVEDSummary: This PR successfully re-implements CAJAL scientific writing functionality as proper examples per AGENTS.md guidelines. All architecture violations from the original PR #1611 have been resolved:
Files Modified:
Fixes Available At: Recommendation: PR #1644 is architecturally sound and ready for merge after applying the fixes above. |
Context
Re-implements the CAJAL / scientific-paper functionality that was rightly reverted from the core SDK (PR #1611 \u2192 revert #1641) as proper examples, per AGENTS.md.
Files added
examples/scientific_writing/scientific_writer.py\u2014 single-agent pattern using a regularAgent+@toolfunctions (format_latex_section,format_citation). CAJAL-4B HuggingFace model via litellm.examples/scientific_writing/multi_agent_paper.py\u2014 3-agent workflow (Literature Reviewer \u2192 Methodologist \u2192 Writer) viaAgentTeam+ sequentialTasks.examples/scientific_writing/agents.yaml\u2014 YAML parity for the multi-agent workflow (AGENTS.md \u00a77 3-way rule).Why this location
examples/, zero changes topraisonaiagents/Agent,AgentTeam,Task,@toolprimitivesAgentsubclass@toolfunctionsValidation
Original PR #1611 placed a 385-line
ScientificWriterAgentclass insidepraisonaiagents/agent/(core SDK) with a fake 'real agentic test' that did not call the LLM. This replacement satisfies the same use case without any of those AGENTS.md violations.Summary by CodeRabbit