Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

Scientific Writer Agent creates LaTeX-formatted academic papers using the specialized CAJAL local model for research publications.

Quick Start

1

Simple Paper Generation

from praisonaiagents import ScientificWriterAgent

agent = ScientificWriterAgent()
paper = agent.write_paper("Machine Learning in Healthcare")

print(f"Title: {paper.title}")
print(f"Sections: {len(paper.sections)}")
print(paper.latex_content)
2

With CAJAL Model

from praisonaiagents import ScientificWriterAgent

agent = ScientificWriterAgent(
    model="Agnuxo/CAJAL-4B-P2PCLAW"
)

paper = agent.write_paper(
    "Quantum Computing Applications",
    style="research",
    citation_style="IEEE"
)
CAJAL is a 2GB local model. Requires: pip install transformers torch

How It Works

MethodPurposeOutput
write_paper()Full paper generationComplete ScientificPaper
write_section()Single section creationIndividual PaperSection
review_and_cite()Literature review with citationsFormatted citation text

Choosing the Right Method


Common Patterns

Single Section Generation

from praisonaiagents import ScientificWriterAgent

agent = ScientificWriterAgent()
section = agent.write_section(
    section_title="Methodology",
    content_request="Machine learning approach for medical diagnosis",
    context="Previous work on CNN architectures"
)

print(section.title)
print(section.content)
print(section.latex_content)

Adding Citations to Existing Content

from praisonaiagents import ScientificWriterAgent

agent = ScientificWriterAgent()
draft = "Machine learning shows promise in healthcare applications."

cited_content = agent.review_and_cite(
    research_query="machine learning healthcare applications",
    existing_content=draft
)
print(cited_content)

Multi-Agent Workflow

from praisonaiagents import Agent, AgentTeam, Task, ScientificWriterAgent

# Create specialized research agents
literature_reviewer = Agent(
    name="Literature Reviewer",
    instructions="Find and analyze academic papers on the topic"
)

methodology_designer = Agent(
    name="Methodology Designer", 
    instructions="Design experimental methodology and approaches"
)

scientific_writer = ScientificWriterAgent(
    model="Agnuxo/CAJAL-4B-P2PCLAW"
)

# Create research workflow
team = AgentTeam(agents=[literature_reviewer, methodology_designer, scientific_writer])

tasks = [
    Task(
        description="Review literature on quantum computing in cryptography",
        agent=literature_reviewer
    ),
    Task(
        description="Design methodology for quantum key distribution analysis", 
        agent=methodology_designer
    ),
    Task(
        description="Write complete academic paper based on research",
        agent=scientific_writer
    )
]

result = team.run(tasks=tasks)

Configuration Options

ScientificWriterAgent Constructor

ParameterTypeDefaultDescription
nameOptional[str]"Scientific Writer"Agent display name
modelOptional[str]"Agnuxo/CAJAL-4B-P2PCLAW"Model identifier (CAJAL default)
instructionsOptional[str]Built-in scientific instructionsCustom behavior instructions
roleOptional[str]"Scientific Paper Writer"Agent role description
goalOptional[str]"Generate high-quality scientific papers..."Agent goal definition
backstoryOptional[str]Built-in academic backstoryAgent background story

Method Parameters

write_paper(topic, sections=None, style="academic", citation_style="APA")

ParameterTypeDefaultDescription
topicstrRequiredResearch topic for the paper
sectionsOptional[List[str]]["Introduction", "Literature Review", "Methodology", "Results", "Discussion", "Conclusion"]Paper section structure
stylestr"academic"Writing style: "academic", "review", "research"
citation_stylestr"APA"Citation format: "APA", "IEEE", "Nature"

write_section(section_title, content_request, context=None)

ParameterTypeDefaultDescription
section_titlestrRequiredTitle of the section
content_requeststrRequiredContent requirements
contextOptional[str]NoneAdditional context information

review_and_cite(research_query, existing_content=None)

ParameterTypeDefaultDescription
research_querystrRequiredResearch query for citations
existing_contentOptional[str]NoneExisting text to add citations to

Return Types

PaperSection (dataclass)

FieldTypeDefaultDescription
titlestrRequiredSection title
contentstrRequiredSection content
latex_contentstr""LaTeX-formatted content

ScientificPaper (dataclass)

FieldTypeDefaultDescription
titlestrRequiredPaper title
abstractstrRequiredPaper abstract
sectionsList[PaperSection][]Paper sections
referencesList[str][]Bibliography entries
latex_contentstr""Full LaTeX document
metadataDict[str, Any]{}Metadata (model, generated_by, is_cajal)

User Interaction Flow

A typical researcher workflow:
  1. Define Research Topic: Specify the subject area and requirements
  2. Configure Agent: Choose model (CAJAL for local) and citation style
  3. Generate Paper: Call write_paper() with topic and preferences
  4. Review Sections: Inspect individual sections in paper.sections
  5. Export LaTeX: Save paper.latex_content to a .tex file
  6. Compile Document: Process with LaTeX compiler for final PDF

Best Practices

CAJAL Model Benefits:
  • Local processing (no API calls)
  • Offline capability
  • Scientific specialization
  • Consistent academic formatting
General LLM Benefits:
  • Broader knowledge base
  • Faster processing
  • No local storage requirements
  • Latest research awareness
Recommendation: Use CAJAL for sensitive research or offline environments; use general LLMs for broader knowledge requirements.
Research Papers:
sections = ["Introduction", "Related Work", "Methodology", "Experiments", "Results", "Discussion", "Conclusion"]
Review Papers:
sections = ["Introduction", "Background", "Literature Survey", "Analysis", "Future Directions", "Conclusion"]
Technical Reports:
sections = ["Executive Summary", "Problem Statement", "Solution Approach", "Implementation", "Evaluation", "Recommendations"]
  • APA: Psychology, education, social sciences
  • IEEE: Engineering, computer science, technology
  • Nature: Natural sciences, physics, chemistry, biology
  • MLA: Literature, humanities (when available)
Match the style to your target publication venue.
Combine Scientific Writer with complementary agents:
  1. Literature Review Agent → Research existing work
  2. Data Analysis Agent → Process experimental data
  3. Scientific Writer Agent → Generate formatted paper
  4. Review Agent → Quality check and feedback
This creates a comprehensive research pipeline for complex projects.

Code Agent

Generate and analyze code for research implementations

Math Agent

Solve mathematical problems and create equations