Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ Parallel critique for stress-testing:
- **DevilsAdvocate** - Technical critique with tool-verified evidence
- **MarketSkeptic** - Market assumptions challenge

### Implementation Team: implementation_team (4 agents)

Builds production-ready code from validated ideas:
- **CodeArchitect** - Designs system architecture and tech stack
- **FullStackEngineer** - Generates production code (backend + frontend)
- **DeploymentSpecialist** - Creates Docker, K8s, and CI/CD configurations
- **QAEngineer** - Designs testing strategy and QA plans

### Frontend: Agent UI
A modern, reactive web interface built with Next.js that provides:
- Real-time streaming of agent activities
Expand Down
23 changes: 23 additions & 0 deletions paper2saas_app/agents/code_architect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from agno.agent import Agent
from agno.tools.reasoning import ReasoningTools
from agno.tools.website import WebsiteTools

from paper2saas_app.config import AgentConfig
from paper2saas_app.utils import get_mistral_model, shared_db
from paper2saas_app.prompts.implementation_agents import CODE_ARCHITECT_INSTRUCTIONS

code_architect = Agent(
name="CodeArchitect",
role="Design production-ready system architectures for SaaS applications",
model=get_mistral_model(AgentConfig.ARCHITECT_MODEL),
tools=[
ReasoningTools(add_instructions=True),
WebsiteTools(),
],
db=shared_db,
reasoning=False,
stream_intermediate_steps=False,
instructions=CODE_ARCHITECT_INSTRUCTIONS,
markdown=True,
tool_call_limit=3,
)
21 changes: 21 additions & 0 deletions paper2saas_app/agents/deployment_specialist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from agno.agent import Agent
from agno.tools.reasoning import ReasoningTools

from paper2saas_app.config import AgentConfig
from paper2saas_app.utils import get_mistral_model, shared_db
from paper2saas_app.prompts.implementation_agents import DEPLOYMENT_SPECIALIST_INSTRUCTIONS

deployment_specialist = Agent(
name="DeploymentSpecialist",
role="Create deployment configurations for production environments",
model=get_mistral_model(AgentConfig.DEPLOYMENT_MODEL),
tools=[
ReasoningTools(add_instructions=True),
],
db=shared_db,
reasoning=False,
stream_intermediate_steps=False,
instructions=DEPLOYMENT_SPECIALIST_INSTRUCTIONS,
markdown=True,
tool_call_limit=2,
)
25 changes: 25 additions & 0 deletions paper2saas_app/agents/fullstack_engineer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from agno.agent import Agent
from agno.tools.reasoning import ReasoningTools
from agno.tools.website import WebsiteTools
from agno.tools.firecrawl import FirecrawlTools

from paper2saas_app.config import AgentConfig
from paper2saas_app.utils import get_mistral_model, shared_db
from paper2saas_app.prompts.implementation_agents import FULLSTACK_ENGINEER_INSTRUCTIONS

fullstack_engineer = Agent(
name="FullStackEngineer",
role="Generate production-ready code for SaaS applications",
model=get_mistral_model(AgentConfig.ENGINEER_MODEL),
tools=[
ReasoningTools(add_instructions=True),
WebsiteTools(),
FirecrawlTools(enable_search=True, enable_scrape=True),
],
db=shared_db,
reasoning=False,
stream_intermediate_steps=False,
instructions=FULLSTACK_ENGINEER_INSTRUCTIONS,
markdown=True,
tool_call_limit=5,
)
21 changes: 21 additions & 0 deletions paper2saas_app/agents/qa_engineer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from agno.agent import Agent
from agno.tools.reasoning import ReasoningTools

from paper2saas_app.config import AgentConfig
from paper2saas_app.utils import get_mistral_model, shared_db
from paper2saas_app.prompts.implementation_agents import QA_ENGINEER_INSTRUCTIONS

qa_engineer = Agent(
name="QAEngineer",
role="Design comprehensive testing strategies for SaaS applications",
model=get_mistral_model(AgentConfig.QA_MODEL),
tools=[
ReasoningTools(add_instructions=True),
],
db=shared_db,
reasoning=False,
stream_intermediate_steps=False,
instructions=QA_ENGINEER_INSTRUCTIONS,
markdown=True,
tool_call_limit=2,
)
6 changes: 6 additions & 0 deletions paper2saas_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ class AgentConfig:
STORE_EVENTS = os.getenv("STORE_EVENTS", "true").lower() == "true"
SHOW_MEMBER_RESPONSES = os.getenv("SHOW_MEMBER_RESPONSES", "true").lower() == "true"
DEBUG_MODE = os.getenv("DEBUG_MODE", "false").lower() == "true"

# Implementation Team Models
ARCHITECT_MODEL = os.getenv("ARCHITECT_MODEL", LARGE_MODEL)
ENGINEER_MODEL = os.getenv("ENGINEER_MODEL", LARGE_MODEL)
DEPLOYMENT_MODEL = os.getenv("DEPLOYMENT_MODEL", SMALL_MODEL)
QA_MODEL = os.getenv("QA_MODEL", SMALL_MODEL)
21 changes: 17 additions & 4 deletions paper2saas_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@
from .agents.devils_advocate import devils_advocate
from .agents.market_skeptic import market_skeptic

# Implementation Team Agents
from .agents.code_architect import code_architect
from .agents.fullstack_engineer import fullstack_engineer
from .agents.deployment_specialist import deployment_specialist
from .agents.qa_engineer import qa_engineer

from .teams.paper2saas import paper2saas_team
from .teams.roaster import idea_roaster_team
from .teams.implementation import implementation_team
from .config import AgentConfig

p2s_os = AgentOS(
name="p2s-os",
description="Turns academic papers into battle-tested SaaS opportunities",
description="Turns academic papers into battle-tested SaaS opportunities with production-ready implementation",
agents=[
paper_analyzer,
market_researcher,
Expand All @@ -28,11 +35,17 @@
product_engineer,
fact_checker,
devils_advocate,
market_skeptic
market_skeptic,
# Implementation Team Agents
code_architect,
fullstack_engineer,
deployment_specialist,
qa_engineer,
],
teams=[
paper2saas_team, # Main flow
idea_roaster_team, # Brutal critique
paper2saas_team, # Main flow: Paper analysis -> SaaS ideas
idea_roaster_team, # Critique: Stress-test ideas
implementation_team, # Build: Production-ready code
],
tracing=False,
)
Expand Down
66 changes: 65 additions & 1 deletion paper2saas_app/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional, Literal
from typing import List, Optional, Literal, Dict
from pydantic import BaseModel, Field

# --- STRUCTURED OUTPUT MODELS ---
Expand Down Expand Up @@ -101,3 +101,67 @@ class ProductEngineerOutput(BaseModel):

class Paper2SaaSInput(BaseModel):
arxiv_id: str = Field(..., description="The arXiv paper ID to analyze")


# --- IMPLEMENTATION TEAM OUTPUT MODELS ---

class CodeFile(BaseModel):
"""Represents a single code file in the implementation"""
file_path: str = Field(..., description="Relative path e.g. src/api/routes.py")
language: str = Field(..., description="Programming language")
content: str = Field(..., description="File content")
description: str = Field(default="", description="Purpose of this file")


class ArchitectureDesign(BaseModel):
"""Output from CodeArchitect agent"""
idea_name: str
components: List[str] = Field(..., min_length=2, description="System components")
architecture_diagram: str = Field(..., description="ASCII diagram of the system")
tech_stack: Dict[str, str] = Field(..., description="Technology choices with justifications")
design_rationale: str = Field(..., description="Why this architecture was chosen")
api_endpoints: List[str] = Field(default_factory=list, description="REST/GraphQL endpoints")
database_schema: str = Field(default="", description="Database tables/collections")
confidence_level: Literal["HIGH", "MEDIUM", "LOW"] = "MEDIUM"


class ImplementationCode(BaseModel):
"""Output from FullStackEngineer agent"""
idea_name: str
files: List[CodeFile] = Field(..., min_length=1)
setup_instructions: str = Field(..., description="How to set up the project")
dependencies: List[str] = Field(..., min_length=1, description="npm/pip packages")
environment_variables: List[str] = Field(default_factory=list)
run_instructions: str = Field(default="", description="How to run the application")


class DeploymentConfig(BaseModel):
"""Output from DeploymentSpecialist agent"""
idea_name: str
dockerfile: str = Field(..., description="Dockerfile content")
docker_compose: Optional[str] = Field(default=None, description="docker-compose.yml content")
kubernetes_manifests: Optional[str] = Field(default=None, description="K8s deployment YAML")
ci_cd_pipeline: str = Field(..., description="GitHub Actions or similar CI/CD workflow")
environment_setup: str = Field(..., description="Environment variables and secrets setup")
cloud_provider_notes: str = Field(default="", description="AWS/GCP/Azure specific notes")


class QAStrategy(BaseModel):
"""Output from QAEngineer agent"""
idea_name: str
test_cases: List[str] = Field(..., min_length=3, description="Core test cases")
edge_cases: List[str] = Field(default_factory=list, description="Edge case scenarios")
integration_test_plan: str = Field(..., description="How to test component integration")
load_test_approach: str = Field(default="", description="Performance testing strategy")
security_checklist: List[str] = Field(default_factory=list, description="Security validations")


class ImplementationPackage(BaseModel):
"""Complete implementation package combining all agents' output"""
idea_name: str
architecture: ArchitectureDesign
code: ImplementationCode
deployment: DeploymentConfig
qa_strategy: Optional[QAStrategy] = None
estimated_dev_hours: int = Field(..., description="Estimated hours to build MVP")
confidence_score: float = Field(..., ge=0.0, le=1.0, description="Overall confidence")
Loading