Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vrashmanyu605-eng/Agentic_Sales-Markerting/llms.txt

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

The pipeline is designed to be extensible. Because each agent is a plain Python function and edges between nodes are declared explicitly, you can insert a new agent at any point in the deterministic sequential chain without touching the supervisor or changing how other agents behave.
The supervisor only routes to lead_research_agent or finished. Custom agents must be inserted inside the sequential chain — not after the supervisor’s conditional branch.
1

Write the agent function

Every agent in the pipeline takes state: dict and returns a dict containing the fields it produces. It reads what it needs from state, does its work, and returns only its output keys.Create a new file in the agents/ directory, for example agents/my_custom_agent.py:
def my_custom_agent(state: dict) -> dict:
    # Read from state
    lead_research = state["lead_research"]

    # ... do work ...
    result = f"Processed: {lead_research[:100]}"

    return {
        "my_custom_output": result
    }
Keep agents single-responsibility — one task per agent makes the pipeline easier to debug. If an agent is doing two distinct things, split it into two separate agents.
2

Add a state field

The output key your agent returns must be declared in SalesMarketingState in graph/state.py. Open the file and add your field under the # AGENT OUTPUTS section:
# graph/state.py

class SalesMarketingState(TypedDict, total=False):

    # ... existing fields ...

    # =====================================================
    # AGENT OUTPUTS
    # =====================================================

    lead_research: str
    icp_analysis: str
    competitor_analysis: str
    outreach_content: str
    proposal_document: str
    crm_update: str

    my_custom_output: str   # <-- add your field here
Because SalesMarketingState uses total=False, all fields are optional — you don’t need to provide a default value.
3

Register the node

Open graph/workflow.py and import your agent, then register it as a node on the StateGraph:
# graph/workflow.py

from agents.my_custom_agent import my_custom_agent

# ... existing imports and node registrations ...

graph.add_node("my_custom_agent", my_custom_agent)
The node name (first argument) is the string identifier used when wiring edges.
4

Wire the edges

Edges define the order agents run. The current sequential pipeline in workflow.py looks like this:
# ── Deterministic sequential pipeline ─────────────────────────────────────────
graph.add_edge("lead_research_agent",       "icp_matching_agent")
graph.add_edge("icp_matching_agent",        "competitor_analysis_agent")
graph.add_edge("competitor_analysis_agent", "outreach_generation_agent")
graph.add_edge("outreach_generation_agent", "proposal_generation_agent")
graph.add_edge("proposal_generation_agent", "crm_update_agent")
graph.add_edge("crm_update_agent",          "supervisor")
To insert your agent after proposal_generation_agent and before crm_update_agent, replace the edge between them and add two new edges:
graph.add_edge("outreach_generation_agent", "proposal_generation_agent")
graph.add_edge("proposal_generation_agent", "my_custom_agent")   # <-- insert before
graph.add_edge("my_custom_agent",           "crm_update_agent")  # <-- insert after
graph.add_edge("crm_update_agent",          "supervisor")
You can insert your agent at any position in the chain using the same pattern — remove the existing edge between two nodes and replace it with two edges that route through your new agent.
5

Test the pipeline

Run the workflow from the project root:
python main.py
As each lead is processed, main.py prints a section header for every node that executes. Confirm your agent appears in the output:
============================================================
NODE: MY_CUSTOM_AGENT
============================================================
If the node does not appear, check that graph.add_node and both graph.add_edge calls are present in workflow.py, and that the agent file is importable without errors.

Build docs developers (and LLMs) love