stresspilot_agent is a Python-based intelligent orchestrator. It acts as an expert assistant, helping users automate testing workflows, analyze errors, and generate complex test scenarios using Natural Language.
Technology Stack
The agent is built on a modern AI stack leveraging Python 3.13+.LangChain
Provides the core LLM application logic. We use
langchain to manage prompts, parse outputs, and interact with various LLM providers (Google GenAI, OpenAI, Anthropic, Ollama).LangGraph
Manages complex, stateful AI workflows.
langgraph allows us to define the agent’s behavior as a directed graph, enabling cyclic reasoning and state checkpoints via langgraph-checkpoint-sqlite.Rich & Questionary
Power the interactive CLI experience.
rich provides beautiful terminal formatting (tables, progress bars), while questionary handles user prompts.Pydantic Settings
Ensures robust configuration management and data validation for environment variables and LLM responses.
Core Capabilities
Natural Language to Test Flow
Describe your test scenario in plain English (e.g., “Create a login flow and then fetch the user profile”). The agent parses this intent and generates the corresponding
stresspilot project and flow objects.Intelligent Error Analysis
When a test fails, the agent can analyze the execution context, response body, and headers to suggest potential root causes or actionable fixes.
Agent Architecture Pattern
The agent follows an Actor-Observer or ReAct (Reason + Act) pattern implemented via LangGraph.- State: The agent maintains a
Stateobject containing the conversation history and current context. - Nodes: Different Python functions act as graph nodes (e.g.,
llm_node,tool_execution_node). - Edges: Conditional logic determines the flow. If the LLM decides to call a tool, the graph routes to the tool executor, then loops back to the LLM to evaluate the result.