Introduction & Overview
Relevant source files
The following files were used as context for generating this wiki page:
BrightPath is a lightweight multi-agent AI operations system designed for a training company. The system automates the processing of inbound sales leads and customer service requests by utilizing a sequential pipeline of specialized AI agents powered by Claude. It integrates file-based memory, a SQLite database for persistence, and provides interfaces via both a Streamlit web UI and a terminal-based orchestrator.
The system is architected to classify incoming messages, perform specialist actions based on company policy and customer history, and generate concise briefings for management. By leveraging Large Language Models (LLMs) for decision-making and Markdown files for context, BrightPath enables automated customer interaction management with minimal human intervention.
Sources: README.md:1-15, app.py:534-550
System Architecture
The BrightPath architecture follows a pipeline pattern where an inbound message passes through three distinct agent stages. This flow is managed by either app.py for the web interface or orchestrator.py for CLI and Telegram integrations.
Agent Pipeline Flow
- Triage Agent: Classifies the intent, urgency, and sentiment of the message.
- Specialist Agent: Either the Sales Agent or Customer Service Agent processes the request based on the triage classification.
- Manager Briefing Agent: Summarizes the entire interaction into a format suitable for delivery via Telegram.
The following diagram illustrates the high-level data flow from message reception to output generation.
The diagram shows how the Triage Agent routes messages to specialized agents which then interact with the storage layers before passing data to the final briefing stage.
Sources: README.md:7-15, app.py:433-470, orchestrator.py:255-320
Key Components
Core Agents
The system defines four primary agent roles in Markdown format, allowing for configuration of behavior without modifying Python code.
| Agent | Purpose | Primary Output |
|---|---|---|
| Triage Agent | Classification and routing | JSON containing category, urgency, and next agent. |
| Sales Agent | Lead qualification and follow-up | CRM updates, lead tiering, and draft email responses. |
| Customer Service Agent | Policy enforcement and support | Draft replies based on refund/booking policies. |
| Manager Briefing Agent | Internal summarization | Telegram-ready JSON summary for business owners. |
Sources: agents/triage_agent.md:3-8, agents/sales_agent.md:3-8, agents/customer_service_agent.md:3-8, agents/manager_briefing_agent.md:3-8
Persistence and Memory
BrightPath uses a dual-layer approach for data persistence:
- SQLite Database: Stores structured data for auditing and reporting.
events: Full logs of pipeline runs including raw agent JSON.tasks: Operational tasks requiring human action.crm_log: History of CRM status changes.
- Markdown Memory: Agents read from five
.mdfiles to maintain context across sessions:company_context.md: Policies and pricing.customer_history.md: Per-customer transaction logs.sales_notes.md: Pipeline activity.open_tasks.md: Outstanding actions.decision_log.md: Audit trail of AI decisions.
Sources: README.md:95-120, app.py:192-230, memory_utils.py:11-20
Interaction Logic
Triage Logic
The run_triage function initiates the pipeline. It reads the system prompt from triage_agent.md and combines it with current memory and CRM data to extract key request parameters.
# app.py:347-349
def run_triage(message, memory):
system = f"{load_agent('triage_agent')}\n\n--- MEMORY ---\n{memory}\n\n--- CRM ---\n{load_crm()}"
return call_claude(system, f"Inbound message:\n\n{message}")
Memory Write-Back
Unlike traditional RAG systems, BrightPath performs "write-back" to its Markdown memory. For specific scenarios, the memory_utils.py script updates the text files based on agent decisions, ensuring future runs have updated context.
The sequence shows how the system maintains state by programmatically editing text-based memory files after successful agent operations.
Sources: memory_utils.py:202-218, app.py:479-481
Conclusion
The BrightPath AI Operations System provides a structured framework for automating small business operations using multi-agent orchestration. By separating logic (Python), behavior (Agent Markdown), and memory (File-based Markdown), the project offers a transparent and easily customizable AI pipeline. Its integration of automated CRM logging and manager notifications ensures that while the AI handles the bulk of communications, human oversight is maintained through the Briefing Agent.
Sources: README.md:5-20, orchestrator.py:330-350