Skip to content

Latest commit

Β 

History

History
146 lines (135 loc) Β· 7.43 KB

File metadata and controls

146 lines (135 loc) Β· 7.43 KB

Project Structure

Complete overview of the actual files and directories in this project.

Backend

backend/
β”œβ”€β”€ app.py                       # Quart app β€” REST routes + Blueprint registration
β”œβ”€β”€ agent_builder/               # Config-driven agent module (see docs/AGENT_BUILDER.md)
β”‚   β”œβ”€β”€ __init__.py              # Public API facade
β”‚   β”œβ”€β”€ models/                  # Pure data (Pydantic/SQLModel)
β”‚   β”‚   β”œβ”€β”€ agent.py             # AgentDefinition, Create/Update DTOs
β”‚   β”‚   β”œβ”€β”€ run.py               # AgentRun, RunStatus
β”‚   β”‚   β”œβ”€β”€ evaluation.py        # AgentEvaluation, SuccessCriteria
β”‚   β”‚   └── chat.py              # AgentRequest/Response
β”‚   β”œβ”€β”€ tools/                   # Tool layer
β”‚   β”‚   β”œβ”€β”€ registry.py          # ToolRegistry (dependency injection)
β”‚   β”‚   β”œβ”€β”€ schema_converter.py  # JSON Schema β†’ Pydantic
β”‚   β”‚   └── mcp_adapter.py       # MCP tool β†’ LangChain adapter
β”‚   β”œβ”€β”€ engine/                  # Execution engine
β”‚   β”‚   β”œβ”€β”€ react_runner.py      # Build & invoke ReAct agents
β”‚   β”‚   β”œβ”€β”€ prompt_builder.py    # System prompt composition
β”‚   β”‚   └── callbacks.py         # LLM & tool call logging
β”‚   β”œβ”€β”€ evaluator.py             # Success criteria evaluation
β”‚   β”œβ”€β”€ service.py               # WorkbenchService (deep module)
β”‚   β”œβ”€β”€ chat_service.py          # ChatService (deep module)
β”‚   β”œβ”€β”€ persistence/             # Database layer
β”‚   β”‚   β”œβ”€β”€ database.py          # SQLite engine + migrations
β”‚   β”‚   └── repository.py        # Agent/Run/Evaluation CRUD
β”‚   β”œβ”€β”€ routes.py                # Quart Blueprint (/api/workbench/*)
β”‚   └── tests/                   # 132 tests (pytest)
β”‚       β”œβ”€β”€ test_models.py       # Model validation
β”‚       β”œβ”€β”€ test_evaluator.py    # Criteria evaluation
β”‚       β”œβ”€β”€ test_registry.py     # ToolRegistry
β”‚       β”œβ”€β”€ test_prompt_builder.py
β”‚       β”œβ”€β”€ test_schema_converter.py
β”‚       β”œβ”€β”€ test_engine.py       # extract_tools_used
β”‚       β”œβ”€β”€ test_service.py      # WorkbenchService CRUD
β”‚       β”œβ”€β”€ test_persistence.py  # Repository layer
β”‚       └── test_e2e.py          # Full REST API flow
β”œβ”€β”€ agent_workbench/             # Backward-compat shim (re-exports from agent_builder)
β”‚   └── __init__.py
β”œβ”€β”€ agents.py                    # Legacy chat agent (AgentService for /api/agents/run)
β”œβ”€β”€ operations.py                # @operation definitions β€” REST + MCP + LangChain tools
β”œβ”€β”€ api_decorators.py            # Unified @operation decorator system
β”œβ”€β”€ csv_data.py                  # CSVTicketService β€” loads/queries csv/data.csv
β”œβ”€β”€ tickets.py                   # Ticket Pydantic models + enums
β”œβ”€β”€ tasks.py                     # Task models + TaskService (in-memory)
β”œβ”€β”€ mcp_handler.py               # MCP JSON-RPC request routing
β”œβ”€β”€ workbench_integration.py     # Wires project tools into agent_builder services
β”œβ”€β”€ usecase_demo.py              # Background agent run service for demo pages
β”œβ”€β”€ data/                        # SQLite databases (gitignored)
β”œβ”€β”€ tests/                       # Backend tests (pytest)
β”‚   β”œβ”€β”€ test_agents.py           # Operation registry + LangChain integration
β”‚   β”œβ”€β”€ test_tickets.py          # CSV ticket parsing + SLA logic
β”‚   β”œβ”€β”€ test_usecase_demo.py     # Demo run service
β”‚   └── test_workbench_integration_e2e.py  # Original E2E test
└── requirements.txt             # Python dependencies

Frontend

frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.jsx                  # Root component β€” tab navigation + routing
β”‚   β”œβ”€β”€ main.jsx                 # React entry point
β”‚   β”œβ”€β”€ index.css                # Global styles
β”‚   β”œβ”€β”€ features/                # Feature modules (one per tab)
β”‚   β”‚   β”œβ”€β”€ workbench/           # Agent Fabric β€” create/run/evaluate agents
β”‚   β”‚   β”‚   └── WorkbenchPage.jsx
β”‚   β”‚   β”œβ”€β”€ agent/               # Agent Chat β€” one-shot conversation
β”‚   β”‚   β”‚   └── AgentChat.jsx
β”‚   β”‚   β”œβ”€β”€ csvtickets/          # CSV Ticket Table β€” browse/filter/paginate
β”‚   β”‚   β”‚   └── CSVTicketTable.jsx
β”‚   β”‚   β”œβ”€β”€ tickets/             # Ticket Visualizations (Nivo charts)
β”‚   β”‚   β”‚   β”œβ”€β”€ NivoTicketsDemo.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SankeyTicketsDemo.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ StreamTicketsDemo.jsx
β”‚   β”‚   β”‚   └── TicketsWithoutAnAssignee.jsx
β”‚   β”‚   β”œβ”€β”€ usecase-demo/        # Pre-built demo pages
β”‚   β”‚   β”‚   β”œβ”€β”€ UsecaseDemoPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ demoDefinitions.js
β”‚   β”‚   β”‚   β”œβ”€β”€ resultViews/
β”‚   β”‚   β”‚   └── utils/
β”‚   β”‚   β”œβ”€β”€ dashboard/           # Dashboard with SSE streaming
β”‚   β”‚   β”‚   └── Dashboard.jsx
β”‚   β”‚   β”œβ”€β”€ fields/              # CSV field documentation
β”‚   β”‚   β”‚   └── FieldsDocs.jsx
β”‚   β”‚   β”œβ”€β”€ kitchensink/         # FluentUI component showcase
β”‚   β”‚   β”‚   └── KitchenSink.jsx
β”‚   β”‚   └── tasks/               # Task management UI
β”‚   β”‚       β”œβ”€β”€ TaskList.jsx
β”‚   β”‚       └── TaskDialog.jsx
β”‚   β”œβ”€β”€ components/              # Shared components
β”‚   β”‚   └── About.jsx
β”‚   └── services/
β”‚       └── api.js               # Backend API client (fetchJSON helper)
β”œβ”€β”€ index.html                   # HTML entry point
β”œβ”€β”€ vite.config.js               # Vite build config (proxy to backend:5001)
└── package.json                 # Dependencies + scripts

Tests

tests/
└── e2e/                         # Playwright E2E tests
    β”œβ”€β”€ app.spec.js              # App shell, tickets, usecase demo, agent
    β”œβ”€β”€ workbench.spec.js        # Agent Fabric create/run/delete
    β”œβ”€β”€ menu-screenshots.spec.js # Capture menu screenshots
    └── debug.spec.js            # Smoke test

Docs

docs/
β”œβ”€β”€ AGENT_BUILDER.md             # Agent builder architecture (mermaid diagrams)
β”œβ”€β”€ AGENTS.md                    # LangGraph agent setup + config
β”œβ”€β”€ CSV_AI_GUIDANCE.md           # How agents query CSV data
β”œβ”€β”€ INSTALL_UBUNTU.md            # Ubuntu 22.04 prerequisites
β”œβ”€β”€ LEARNING.md                  # Design principles guide
β”œβ”€β”€ LEVEL_UP.md                  # Day 4 teaching material
β”œβ”€β”€ NIVO.md                      # Nivo chart visualization guide
β”œβ”€β”€ PROJECT_STRUCTURE.md         # This file
β”œβ”€β”€ PYDANTIC_ARCHITECTURE.md     # Pydantic patterns
β”œβ”€β”€ QUICKSTART.md                # 5-minute setup
β”œβ”€β”€ TROUBLESHOOTING.md           # Common issues + fixes
β”œβ”€β”€ UNIFIED_ARCHITECTURE.md      # REST + MCP via @operation
└── ticker_reminder/             # Feature spec (ticket reminders)
    β”œβ”€β”€ RULES.md                 # German version
    └── RULES_EN.md              # English version

Config Files

File Purpose
setup.sh Automated bootstrap (venv, deps, Playwright)
start-dev.sh Start backend + frontend + Ollama
playwright.config.js E2E test config (3 browsers, web servers)
Dockerfile Multi-stage build for deployment
.env.example OpenAI API key template
package.json (root) Playwright + npm scripts