Merge branch 'feat/pagination' into feat/real-estate
moved documentation
This commit is contained in:
commit
7fd29a4ee5
129 changed files with 22653 additions and 11 deletions
1046
docs/code-documentation/aicore-component.md
Normal file
1046
docs/code-documentation/aicore-component.md
Normal file
File diff suppressed because it is too large
Load diff
209
docs/code-documentation/architecture-overview.md
Normal file
209
docs/code-documentation/architecture-overview.md
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
# Architecture Overview
|
||||
|
||||
High-level architecture diagram of the Gateway project.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
%% Entry Point
|
||||
App[app.py<br/>FastAPI Application]
|
||||
|
||||
%% Middleware Layer
|
||||
App --> Security[Security<br/>Auth, CSRF, JWT, Token Refresh]
|
||||
App --> CORS[CORS Middleware]
|
||||
|
||||
%% API Layer
|
||||
App --> Routes[Routes<br/>API Endpoints]
|
||||
|
||||
%% Business Logic Layer
|
||||
Routes --> Features[Features<br/>Business Logic Modules]
|
||||
Routes --> Services[Services<br/>Service Layer]
|
||||
|
||||
%% Features can use Services
|
||||
Features --> Services
|
||||
|
||||
%% Data Access Layer
|
||||
Services --> Interfaces[Interfaces<br/>Data Access Layer]
|
||||
Features --> Interfaces
|
||||
|
||||
%% External Connections
|
||||
Interfaces --> Connectors[Connectors<br/>External System Connections]
|
||||
Interfaces --> Database[(Database<br/>PostgreSQL)]
|
||||
|
||||
%% Connectors connect to external systems
|
||||
Connectors --> Database
|
||||
Connectors --> External[External Systems<br/>Jira, ClickUp, Google, etc.]
|
||||
|
||||
%% Shared Resources
|
||||
App -.-> Shared[Shared Modules<br/>Configuration, Logging, Utils]
|
||||
Routes -.-> Shared
|
||||
Features -.-> Shared
|
||||
Services -.-> Shared
|
||||
Interfaces -.-> Shared
|
||||
|
||||
%% Data Models used throughout
|
||||
Routes -.-> DataModels[Data Models<br/>Request/Response Schemas]
|
||||
Features -.-> DataModels
|
||||
Services -.-> DataModels
|
||||
Interfaces -.-> DataModels
|
||||
|
||||
%% Feature Lifecycle Management
|
||||
App --> FeaturesLifecycle[Features Lifecycle<br/>Startup/Shutdown Management]
|
||||
FeaturesLifecycle --> Features
|
||||
|
||||
%% Styling
|
||||
classDef entryPoint fill:#e1f5ff,stroke:#01579b,stroke-width:3px
|
||||
classDef apiLayer fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
|
||||
classDef businessLogic fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px
|
||||
classDef dataAccess fill:#fff3e0,stroke:#e65100,stroke-width:2px
|
||||
classDef external fill:#fce4ec,stroke:#880e4f,stroke-width:2px
|
||||
classDef shared fill:#f5f5f5,stroke:#424242,stroke-width:1px,stroke-dasharray: 5 5
|
||||
|
||||
class App entryPoint
|
||||
class Routes,Security,CORS apiLayer
|
||||
class Features,Services businessLogic
|
||||
class Interfaces,Connectors dataAccess
|
||||
class Database,External external
|
||||
class Shared,DataModels,FeaturesLifecycle shared
|
||||
```
|
||||
|
||||
## Data Flow Diagram
|
||||
|
||||
The following sequence diagram shows how data flows through the same architectural layers from the architecture diagram above.
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant App as app.py<br/>FastAPI Application
|
||||
participant Security as Security<br/>Auth, CSRF, JWT
|
||||
participant Routes as Routes<br/>API Endpoints
|
||||
participant Features as Features<br/>Business Logic
|
||||
participant Services as Services<br/>Service Layer
|
||||
participant Interfaces as Interfaces<br/>Data Access Layer
|
||||
participant Connectors as Connectors<br/>External Connections
|
||||
participant Database as Database<br/>PostgreSQL
|
||||
participant External as External Systems<br/>Jira, ClickUp, etc.
|
||||
|
||||
%% Request Flow
|
||||
Client->>App: HTTP Request
|
||||
App->>Security: Validate Auth & CSRF
|
||||
Security-->>App: Authenticated
|
||||
App->>Routes: Validated Request
|
||||
Routes->>Routes: Validate Data Models
|
||||
|
||||
alt Route delegates to Features
|
||||
Routes->>Features: Delegate Request
|
||||
Features->>Services: Use Service (optional)
|
||||
Services-->>Features: Service Result
|
||||
Features->>Interfaces: Request Data Access
|
||||
else Route delegates to Services
|
||||
Routes->>Services: Delegate Request
|
||||
Services->>Interfaces: Request Data Access
|
||||
end
|
||||
|
||||
Interfaces->>Connectors: Query Request
|
||||
|
||||
alt Database Query
|
||||
Connectors->>Database: Execute Query
|
||||
Database-->>Connectors: Raw Data
|
||||
else External API Call
|
||||
Connectors->>External: API Call
|
||||
External-->>Connectors: API Response
|
||||
end
|
||||
|
||||
%% Response Flow
|
||||
Connectors-->>Interfaces: Raw Data
|
||||
Interfaces->>Interfaces: Transform to Domain Objects
|
||||
Interfaces-->>Features: Domain Objects
|
||||
Interfaces-->>Services: Domain Objects
|
||||
|
||||
Features->>Features: Process Business Logic
|
||||
Services->>Services: Process Service Logic
|
||||
|
||||
Features-->>Routes: Processed Data
|
||||
Services-->>Routes: Processed Data
|
||||
|
||||
Routes->>Routes: Serialize to Response Models
|
||||
Routes-->>App: HTTP Response
|
||||
App-->>Client: HTTP Response
|
||||
```
|
||||
|
||||
### Request Flow (Top to Bottom)
|
||||
|
||||
1. **Client** sends HTTP request to **app.py**
|
||||
2. **app.py** forwards to **Security** middleware for authentication and CSRF validation
|
||||
3. **Security** validates and returns authenticated request to **app.py**
|
||||
4. **app.py** forwards validated request to **Routes**
|
||||
5. **Routes** validate request data using Data Models, then delegate to either:
|
||||
- **Features** (which may use **Services**), or
|
||||
- **Services** directly
|
||||
6. **Features/Services** call **Interfaces** for data access
|
||||
7. **Interfaces** use **Connectors** to execute queries
|
||||
8. **Connectors** query **Database** or call **External Systems**
|
||||
|
||||
### Response Flow (Bottom to Top)
|
||||
|
||||
1. **Database/External Systems** return raw data to **Connectors**
|
||||
2. **Connectors** pass raw data to **Interfaces**
|
||||
3. **Interfaces** transform raw data into domain objects
|
||||
4. **Interfaces** return domain objects to **Features/Services**
|
||||
5. **Features/Services** process business logic and return processed data to **Routes**
|
||||
6. **Routes** serialize data to response models and return HTTP response to **app.py**
|
||||
7. **app.py** returns HTTP response to **Client**
|
||||
|
||||
### Data Transformations
|
||||
|
||||
- **Routes**: HTTP Request ↔ Validated Data Models (Pydantic)
|
||||
- **Features/Services**: Data Models ↔ Domain Objects (Business Logic Processing)
|
||||
- **Interfaces**: Domain Objects ↔ Raw Data (SQL/API Format)
|
||||
- **Connectors**: Raw Data ↔ Database Queries/API Calls
|
||||
|
||||
## Layer Descriptions
|
||||
|
||||
### Entry Point Layer
|
||||
**app.py** - The FastAPI application entry point that orchestrates the entire system. It initializes logging, configures CORS and security middleware, registers all route routers, and manages the application lifecycle (startup/shutdown). This is where the application server starts and all components are wired together.
|
||||
|
||||
### API Layer
|
||||
**Routes** - HTTP endpoints that define the REST API surface. Routes receive client requests, validate input using data models, delegate to features or services for business logic, and return structured responses. Each route module handles a specific domain (e.g., Real Estate, Chat, Workflows, Security).
|
||||
|
||||
**Security** - Middleware and services that handle authentication, authorization, CSRF protection, JWT token management, and token refresh. Ensures all requests are properly authenticated and authorized before reaching business logic. See [Security Component Documentation](./security-component.md) for detailed documentation.
|
||||
|
||||
**CORS** - Cross-Origin Resource Sharing middleware that controls which external domains can access the API, enabling secure cross-origin requests from web applications.
|
||||
|
||||
### Business Logic Layer
|
||||
**Features** - Domain-specific business logic modules that implement core functionality for specific use cases (e.g., Real Estate management, Chat workflows, Data neutralization). Features are stateless and orchestrate services to fulfill business requirements. They can be called directly from routes or managed by the Features Lifecycle for background processing.
|
||||
|
||||
**Services** - Reusable, composable service components that provide cross-cutting functionality (AI processing, document extraction, content generation, chat operations, ticket management, etc.). Services encapsulate complex operations and can be used by multiple features. They typically use interfaces to access data and may call other services.
|
||||
|
||||
### Data Access Layer
|
||||
**Interfaces** - Abstraction layer that provides a clean, domain-oriented API for accessing data. Interfaces hide the complexity of database connections and external system integrations, offering high-level methods for CRUD operations. They handle user context, access control, and data transformation between the application and persistence layers.
|
||||
|
||||
**Connectors** - Concrete implementations that handle low-level communication with external systems. Database connectors manage PostgreSQL connections, query execution, and transaction handling. External connectors integrate with third-party services (Jira, ClickUp, Google Voice, SharePoint) using their specific APIs and protocols.
|
||||
|
||||
### External Systems Layer
|
||||
**Database** - PostgreSQL databases that persist application data. Multiple databases may exist for different domains (e.g., chat data, real estate data, management data). Connectors handle all database interactions.
|
||||
|
||||
**External Systems** - Third-party services and APIs that the application integrates with. These include ticketing systems (Jira, ClickUp), cloud services (Google Voice, SharePoint), and other external platforms. Connectors abstract away the specifics of each integration.
|
||||
|
||||
### Shared Resources Layer
|
||||
**Shared Modules** - Common utilities and infrastructure used throughout the application. Includes configuration management, logging utilities, time/date helpers, JSON processing, attribute utilities, and audit logging. These modules provide cross-cutting concerns that don't belong to any specific domain.
|
||||
|
||||
**Data Models** - Pydantic models that define data structures for requests, responses, and database entities. They provide validation, serialization, and type safety across all layers. Models are organized by domain (e.g., Real Estate, Chat, Security, AI).
|
||||
|
||||
**Features Lifecycle** - Manages the startup and shutdown of features that require background processing, scheduled tasks, or event-driven operations. Coordinates initialization and cleanup of features that need persistent processes or event listeners.
|
||||
|
||||
## Request/Response Flow Summary
|
||||
|
||||
For a detailed visual representation, see the [Data Flow Diagram](#data-flow-diagram) above.
|
||||
|
||||
**Simplified Request Flow**: `Client Request` → `CORS` → `Security (Auth/CSRF)` → `Routes` → `Features/Services` → `Interfaces` → `Connectors` → `Database/External Systems`
|
||||
|
||||
**Simplified Response Flow**: `Database/External Systems` → `Connectors` → `Interfaces` → `Features/Services` → `Routes` → `Transform & Log` → `Client Response`
|
||||
|
||||
## Key Architectural Patterns
|
||||
|
||||
- **Layered Architecture**: Clear separation between API, business logic, and data access layers
|
||||
- **Dependency Injection**: Services and interfaces are injected where needed
|
||||
- **Interface Abstraction**: Interfaces abstract away database and connector details
|
||||
- **Stateless Design**: Features operate statelessly without session management
|
||||
- **Shared Utilities**: Common functionality centralized in shared modules
|
||||
|
||||
1241
docs/code-documentation/connectors-component.md
Normal file
1241
docs/code-documentation/connectors-component.md
Normal file
File diff suppressed because it is too large
Load diff
1832
docs/code-documentation/datamodels-interfaces-component.md
Normal file
1832
docs/code-documentation/datamodels-interfaces-component.md
Normal file
File diff suppressed because it is too large
Load diff
981
docs/code-documentation/features-component.md
Normal file
981
docs/code-documentation/features-component.md
Normal file
|
|
@ -0,0 +1,981 @@
|
|||
# Features Component Documentation
|
||||
|
||||
Comprehensive documentation of the Features layer in the Gateway application, explaining the architecture, patterns, and implementation details of all feature modules and their relationship to connectors, services, and workflows.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Overview](#overview)
|
||||
2. [What is a Feature?](#what-is-a-feature)
|
||||
3. [Features vs Services vs Workflows](#features-vs-services-vs-workflows)
|
||||
4. [Feature Architecture](#feature-architecture)
|
||||
5. [Feature Lifecycle Management](#feature-lifecycle-management)
|
||||
6. [Connectors in the Architecture](#connectors-in-the-architecture)
|
||||
7. [Individual Features](#individual-features)
|
||||
8. [Feature Patterns and Best Practices](#feature-patterns-and-best-practices)
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The **Features Layer** is a domain-specific business logic layer that implements core functionality for specific use cases. Features serve as **temporary solutions** that bridge the gap between initial requirements and full service implementation or workflow integration. They provide rapid prototyping capabilities while maintaining clean architectural boundaries.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Application Layers"
|
||||
Routes[Routes Layer<br/>API Endpoints]
|
||||
Features[Features Layer<br/>Domain-Specific Logic]
|
||||
Services[Services Layer<br/>Reusable Components]
|
||||
Workflows[Workflows Layer<br/>Orchestration Engine]
|
||||
Interfaces[Interfaces Layer<br/>Data Access]
|
||||
Connectors[Connectors Layer<br/>External Systems]
|
||||
end
|
||||
|
||||
Routes --> Features
|
||||
Routes --> Services
|
||||
Routes --> Workflows
|
||||
Features --> Services
|
||||
Features --> Interfaces
|
||||
Workflows --> Services
|
||||
Services --> Interfaces
|
||||
Interfaces --> Connectors
|
||||
|
||||
style Features fill:#e8f5e9,stroke:#1b5e20,stroke-width:3px
|
||||
style Connectors fill:#fff3e0,stroke:#e65100,stroke-width:2px
|
||||
```
|
||||
|
||||
### Key Characteristics
|
||||
|
||||
- **Domain-Specific**: Each feature addresses a specific business domain or use case
|
||||
- **Temporary by Design**: Features are intended to be migrated to services or workflows over time
|
||||
- **Stateless**: Features operate without maintaining session state
|
||||
- **Service-Dependent**: Features leverage services for cross-cutting functionality
|
||||
- **Interface-Dependent**: Features use interfaces to access data through connectors
|
||||
- **Lifecycle-Managed**: Background features are managed through the Features Lifecycle system
|
||||
|
||||
---
|
||||
|
||||
## What is a Feature?
|
||||
|
||||
A **Feature** is a domain-specific business logic module that implements functionality for a particular use case. Features are designed to:
|
||||
|
||||
1. **Rapid Prototyping**: Enable quick implementation of new functionality without full service architecture
|
||||
2. **Domain Encapsulation**: Group related business logic for a specific domain (e.g., Real Estate, Chat, Data Synchronization)
|
||||
3. **Temporary Solutions**: Serve as interim implementations before migration to services or workflows
|
||||
4. **Orchestration**: Coordinate between services, interfaces, and external systems to fulfill business requirements
|
||||
5. **Background Processing**: Support scheduled tasks, event-driven operations, and background managers
|
||||
|
||||
### Feature Lifecycle Philosophy
|
||||
|
||||
Features follow a natural evolution path:
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Initial Requirement] --> B[Feature Implementation]
|
||||
B --> C{Stability & Usage}
|
||||
C -->|Mature| D[Service Migration]
|
||||
C -->|Complex Workflow| E[Workflow Integration]
|
||||
C -->|Still Experimental| B
|
||||
|
||||
D --> F[Production Service]
|
||||
E --> G[Workflow Component]
|
||||
|
||||
style B fill:#fff3e0,stroke:#e65100
|
||||
style D fill:#e8f5e9,stroke:#1b5e20
|
||||
style E fill:#e1f5ff,stroke:#01579b
|
||||
```
|
||||
|
||||
**When to Use Features:**
|
||||
- New functionality that needs rapid development
|
||||
- Domain-specific logic that may not be reusable
|
||||
- Experimental or proof-of-concept implementations
|
||||
- Background tasks requiring scheduled execution
|
||||
- Integrations that are still being refined
|
||||
|
||||
**When to Migrate to Services:**
|
||||
- Functionality becomes reusable across multiple domains
|
||||
- The feature is stable and well-tested
|
||||
- Multiple features or routes need the same functionality
|
||||
- The logic should be part of the core service layer
|
||||
|
||||
**When to Migrate to Workflows:**
|
||||
- The feature involves complex multi-step user interactions
|
||||
- Task planning and adaptive learning are required
|
||||
- The feature needs workflow orchestration capabilities
|
||||
- User interactions require state management and progress tracking
|
||||
|
||||
---
|
||||
|
||||
## Features vs Services vs Workflows
|
||||
|
||||
Understanding the distinction between Features, Services, and Workflows is crucial for architectural decisions.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Comparison Matrix"
|
||||
A[Route Request] --> B{What Type?}
|
||||
B -->|Domain-Specific<br/>Single Use Case| C[Feature]
|
||||
B -->|Reusable<br/>Cross-Cutting| D[Service]
|
||||
B -->|Complex Multi-Step<br/>User Interaction| E[Workflow]
|
||||
|
||||
C --> F[Uses Services]
|
||||
C --> G[Uses Interfaces]
|
||||
D --> H[Uses Other Services]
|
||||
D --> G
|
||||
E --> D
|
||||
E --> I[Uses Methods]
|
||||
|
||||
G --> J[Uses Connectors]
|
||||
end
|
||||
|
||||
style C fill:#fff3e0,stroke:#e65100
|
||||
style D fill:#e8f5e9,stroke:#1b5e20
|
||||
style E fill:#e1f5ff,stroke:#01579b
|
||||
style J fill:#fce4ec,stroke:#880e4f
|
||||
```
|
||||
|
||||
| Aspect | Feature | Service | Workflow |
|
||||
|--------|---------|---------|----------|
|
||||
| **Purpose** | Domain-specific business logic | Cross-cutting, reusable functionality | Complex multi-step orchestration |
|
||||
| **Scope** | Single use case or domain | Multiple use cases | User interaction flows |
|
||||
| **Reusability** | Low (domain-specific) | High (cross-domain) | Medium (workflow patterns) |
|
||||
| **State Management** | Stateless | Stateless | Stateful (workflow state) |
|
||||
| **Dependencies** | Uses services and interfaces | Uses other services and interfaces | Uses services and methods |
|
||||
| **Lifecycle** | Temporary, may migrate | Permanent core component | Permanent orchestration engine |
|
||||
| **Examples** | Real Estate queries, Chat Althaus scheduler | AI processing, Document extraction | Chat workflows, Task planning |
|
||||
|
||||
### Decision Flow
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start[New Functionality Required] --> Q1{Is it reusable<br/>across domains?}
|
||||
Q1 -->|Yes| Service[Implement as Service]
|
||||
Q1 -->|No| Q2{Does it require<br/>complex multi-step<br/>user interaction?}
|
||||
Q2 -->|Yes| Workflow[Implement as Workflow]
|
||||
Q2 -->|No| Q3{Is it domain-specific<br/>or experimental?}
|
||||
Q3 -->|Yes| Feature[Implement as Feature]
|
||||
Q3 -->|No| Service
|
||||
|
||||
Feature --> Q4{Feature Matures}
|
||||
Q4 -->|Stable & Reusable| Service
|
||||
Q4 -->|Complex Interactions| Workflow
|
||||
Q4 -->|Still Experimental| Feature
|
||||
|
||||
style Feature fill:#fff3e0,stroke:#e65100
|
||||
style Service fill:#e8f5e9,stroke:#1b5e20
|
||||
style Workflow fill:#e1f5ff,stroke:#01579b
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Feature Architecture
|
||||
|
||||
### High-Level Architecture
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Entry Point"
|
||||
App[app.py<br/>FastAPI Application]
|
||||
Lifecycle[Features Lifecycle<br/>featuresLifecycle.py]
|
||||
end
|
||||
|
||||
subgraph "API Layer"
|
||||
Routes[Routes<br/>routeRealEstate.py<br/>routeChatPlayground.py<br/>routeDataNeutralization.py]
|
||||
end
|
||||
|
||||
subgraph "Feature Layer"
|
||||
RE[Real Estate Feature<br/>mainRealEstate.py]
|
||||
CA[Chat Althaus Feature<br/>mainChatAlthaus.py]
|
||||
SD[Sync Delta Feature<br/>mainSyncDelta.py]
|
||||
CP[Chat Playground Feature<br/>mainChatPlayground.py]
|
||||
NP[Neutralize Playground Feature<br/>mainNeutralizePlayground.py]
|
||||
end
|
||||
|
||||
subgraph "Service Layer"
|
||||
Services[Services Container<br/>AI, Chat, SharePoint, etc.]
|
||||
end
|
||||
|
||||
subgraph "Interface Layer"
|
||||
Interfaces[Interfaces<br/>Database, Ticket, etc.]
|
||||
end
|
||||
|
||||
subgraph "Connector Layer"
|
||||
DBConn[Database Connector<br/>connectorDbPostgre.py]
|
||||
TicketConn[Ticket Connectors<br/>connectorTicketsJira.py<br/>connectorTicketsClickup.py]
|
||||
VoiceConn[Voice Connector<br/>connectorVoiceGoogle.py]
|
||||
JsonConn[JSON Connector<br/>connectorDbJson.py]
|
||||
end
|
||||
|
||||
subgraph "External Systems"
|
||||
DB[(PostgreSQL Database)]
|
||||
Jira[Jira API]
|
||||
ClickUp[ClickUp API]
|
||||
SharePoint[SharePoint API]
|
||||
GoogleVoice[Google Voice API]
|
||||
end
|
||||
|
||||
App --> Lifecycle
|
||||
App --> Routes
|
||||
Lifecycle --> CA
|
||||
Lifecycle --> SD
|
||||
Routes --> RE
|
||||
Routes --> CP
|
||||
Routes --> NP
|
||||
|
||||
RE --> Services
|
||||
CA --> Services
|
||||
SD --> Services
|
||||
CP --> Services
|
||||
NP --> Services
|
||||
|
||||
Services --> Interfaces
|
||||
Interfaces --> DBConn
|
||||
Interfaces --> TicketConn
|
||||
Interfaces --> VoiceConn
|
||||
Interfaces --> JsonConn
|
||||
|
||||
DBConn --> DB
|
||||
TicketConn --> Jira
|
||||
TicketConn --> ClickUp
|
||||
VoiceConn --> GoogleVoice
|
||||
Services --> SharePoint
|
||||
|
||||
style Features fill:#fff3e0,stroke:#e65100
|
||||
style Connectors fill:#fce4ec,stroke:#880e4f
|
||||
```
|
||||
|
||||
### Feature Request Flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant Route as Route<br/>routeRealEstate.py
|
||||
participant Feature as Feature<br/>mainRealEstate.py
|
||||
participant Service as Service<br/>Services Container
|
||||
participant Interface as Interface<br/>interfaceDbRealEstateObjects.py
|
||||
participant Connector as Connector<br/>connectorDbPostgre.py
|
||||
participant DB as Database<br/>PostgreSQL
|
||||
|
||||
Client->>Route: HTTP Request
|
||||
Route->>Route: Validate Request Data
|
||||
Route->>Feature: Call Feature Function
|
||||
Feature->>Service: Use Service (e.g., AI Service)
|
||||
Service-->>Feature: Service Result
|
||||
Feature->>Interface: Request Data Access
|
||||
Interface->>Connector: Execute Query
|
||||
Connector->>DB: SQL Query
|
||||
DB-->>Connector: Raw Data
|
||||
Connector-->>Interface: Raw Data
|
||||
Interface->>Interface: Transform to Domain Objects
|
||||
Interface-->>Feature: Domain Objects
|
||||
Feature->>Feature: Process Business Logic
|
||||
Feature-->>Route: Processed Result
|
||||
Route->>Route: Serialize Response
|
||||
Route-->>Client: HTTP Response
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Feature Lifecycle Management
|
||||
|
||||
Features that require background processing, scheduled tasks, or event-driven operations are managed through the **Features Lifecycle** system.
|
||||
|
||||
### Lifecycle Architecture
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Application Startup"
|
||||
App[app.py<br/>FastAPI Application]
|
||||
Lifespan[Lifespan Context Manager]
|
||||
end
|
||||
|
||||
subgraph "Features Lifecycle"
|
||||
Lifecycle[featuresLifecycle.py]
|
||||
Start[start function]
|
||||
Stop[stop function]
|
||||
end
|
||||
|
||||
subgraph "Background Features"
|
||||
SyncDelta[SyncDelta Manager<br/>startSyncManager]
|
||||
ChatAlthaus[ChatAlthaus Manager<br/>startDataScheduler]
|
||||
AutomationEvents[Automation Events<br/>syncAutomationEvents]
|
||||
end
|
||||
|
||||
App --> Lifespan
|
||||
Lifespan -->|On Startup| Lifecycle
|
||||
Lifecycle --> Start
|
||||
Start --> SyncDelta
|
||||
Start --> ChatAlthaus
|
||||
Start --> AutomationEvents
|
||||
|
||||
Lifespan -->|On Shutdown| Lifecycle
|
||||
Lifecycle --> Stop
|
||||
Stop --> SyncDelta
|
||||
Stop --> ChatAlthaus
|
||||
|
||||
style Lifecycle fill:#e8f5e9,stroke:#1b5e20
|
||||
style SyncDelta fill:#fff3e0,stroke:#e65100
|
||||
style ChatAlthaus fill:#fff3e0,stroke:#e65100
|
||||
```
|
||||
|
||||
### Lifecycle Sequence
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant App as app.py
|
||||
participant Lifespan as Lifespan Manager
|
||||
participant Lifecycle as featuresLifecycle
|
||||
participant EventUser as Event User
|
||||
participant SyncDelta as SyncDelta Manager
|
||||
participant ChatAlthaus as ChatAlthaus Manager
|
||||
|
||||
App->>Lifespan: Application Startup
|
||||
Lifespan->>Lifecycle: start()
|
||||
Lifecycle->>EventUser: getRootInterface().getUserByUsername("event")
|
||||
EventUser-->>Lifecycle: Event User Object
|
||||
|
||||
Lifecycle->>ChatAlthaus: syncAutomationEvents()
|
||||
ChatAlthaus-->>Lifecycle: Events Synced
|
||||
|
||||
Lifecycle->>SyncDelta: startSyncManager(eventUser)
|
||||
SyncDelta->>SyncDelta: Initialize Background Thread
|
||||
SyncDelta-->>Lifecycle: Manager Started
|
||||
|
||||
Lifecycle->>ChatAlthaus: startDataScheduler(eventUser)
|
||||
ChatAlthaus->>ChatAlthaus: Initialize Scheduler
|
||||
ChatAlthaus-->>Lifecycle: Scheduler Started
|
||||
|
||||
Lifecycle->>ChatAlthaus: performDataUpdate(eventUser)
|
||||
ChatAlthaus-->>Lifecycle: Initial Update Complete
|
||||
|
||||
Lifecycle-->>Lifespan: Startup Complete
|
||||
Lifespan-->>App: Application Ready
|
||||
|
||||
Note over App: Application Running...
|
||||
|
||||
App->>Lifespan: Application Shutdown
|
||||
Lifespan->>Lifecycle: stop()
|
||||
Lifecycle->>SyncDelta: Stop Manager
|
||||
Lifecycle->>ChatAlthaus: Stop Scheduler
|
||||
Lifecycle-->>Lifespan: Shutdown Complete
|
||||
```
|
||||
|
||||
### Lifecycle-Managed Features
|
||||
|
||||
Features managed through the lifecycle system include:
|
||||
|
||||
1. **SyncDelta**: Background synchronization manager for ticket synchronization
|
||||
2. **ChatAlthaus**: Scheduled data updates for Althaus preprocessing service
|
||||
3. **Automation Events**: Event synchronization for chat automation
|
||||
|
||||
These features run continuously in the background and require proper initialization and cleanup during application startup and shutdown.
|
||||
|
||||
---
|
||||
|
||||
## Connectors in the Architecture
|
||||
|
||||
Connectors are the lowest-level abstraction for communicating with external systems. They provide concrete implementations for database connections, API integrations, and external service communication.
|
||||
|
||||
### Connector Architecture
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Connector Types"
|
||||
DBConn[Database Connectors<br/>connectorDbPostgre.py<br/>connectorDbJson.py]
|
||||
TicketConn[Ticket Connectors<br/>connectorTicketsJira.py<br/>connectorTicketsClickup.py]
|
||||
VoiceConn[Voice Connectors<br/>connectorVoiceGoogle.py]
|
||||
end
|
||||
|
||||
subgraph "Connector Responsibilities"
|
||||
Connection[Connection Management<br/>Establish & Maintain Connections]
|
||||
Query[Query Execution<br/>Execute Queries & API Calls]
|
||||
Transform[Data Transformation<br/>Raw Data ↔ Application Format]
|
||||
Error[Error Handling<br/>Connection Errors & Retries]
|
||||
end
|
||||
|
||||
subgraph "External Systems"
|
||||
PostgreSQL[(PostgreSQL Database)]
|
||||
JSONFile[JSON Files]
|
||||
JiraAPI[Jira API]
|
||||
ClickUpAPI[ClickUp API]
|
||||
GoogleVoiceAPI[Google Voice API]
|
||||
end
|
||||
|
||||
DBConn --> Connection
|
||||
TicketConn --> Connection
|
||||
VoiceConn --> Connection
|
||||
|
||||
Connection --> Query
|
||||
Query --> Transform
|
||||
Transform --> Error
|
||||
|
||||
DBConn --> PostgreSQL
|
||||
DBConn --> JSONFile
|
||||
TicketConn --> JiraAPI
|
||||
TicketConn --> ClickUpAPI
|
||||
VoiceConn --> GoogleVoiceAPI
|
||||
|
||||
style DBConn fill:#fce4ec,stroke:#880e4f
|
||||
style TicketConn fill:#fce4ec,stroke:#880e4f
|
||||
style VoiceConn fill:#fce4ec,stroke:#880e4f
|
||||
```
|
||||
|
||||
### Connector Usage Flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Feature as Feature
|
||||
participant Service as Service
|
||||
participant Interface as Interface
|
||||
participant Connector as Connector
|
||||
participant External as External System
|
||||
|
||||
Feature->>Service: Use Service
|
||||
Service->>Interface: Request Data Access
|
||||
Interface->>Connector: Initialize Connection
|
||||
Connector->>External: Establish Connection
|
||||
External-->>Connector: Connection Established
|
||||
|
||||
Interface->>Connector: Execute Query/API Call
|
||||
Connector->>Connector: Format Request
|
||||
Connector->>External: Send Request
|
||||
External-->>Connector: Raw Response
|
||||
Connector->>Connector: Parse Response
|
||||
Connector-->>Interface: Formatted Data
|
||||
Interface->>Interface: Transform to Domain Objects
|
||||
Interface-->>Service: Domain Objects
|
||||
Service-->>Feature: Processed Result
|
||||
```
|
||||
|
||||
### Available Connectors
|
||||
|
||||
#### Database Connectors
|
||||
|
||||
**connectorDbPostgre.py** - PostgreSQL Database Connector
|
||||
- Manages PostgreSQL database connections
|
||||
- Executes SQL queries with parameterization
|
||||
- Handles JSONB column types
|
||||
- Provides transaction support
|
||||
- Used by: Real Estate interfaces, Chat interfaces, Application interfaces
|
||||
|
||||
**connectorDbJson.py** - JSON File Database Connector
|
||||
- Provides file-based data storage using JSON
|
||||
- Useful for development and testing
|
||||
- Lightweight alternative to PostgreSQL
|
||||
- Used by: Development environments, Testing scenarios
|
||||
|
||||
#### Ticket Connectors
|
||||
|
||||
**connectorTicketsJira.py** - Jira Ticket Connector
|
||||
- Integrates with Jira REST API
|
||||
- Manages Jira tickets, issues, and projects
|
||||
- Handles field mapping and synchronization
|
||||
- Used by: SyncDelta feature, Ticket interfaces
|
||||
|
||||
**connectorTicketsClickup.py** - ClickUp Ticket Connector
|
||||
- Integrates with ClickUp API
|
||||
- Manages ClickUp tasks and lists
|
||||
- Handles task synchronization
|
||||
- Used by: Ticket interfaces
|
||||
|
||||
#### Voice Connectors
|
||||
|
||||
**connectorVoiceGoogle.py** - Google Voice Connector
|
||||
- Integrates with Google Voice API
|
||||
- Handles voice transcription and processing
|
||||
- Manages voice data and audio files
|
||||
- Used by: Voice-related services and features
|
||||
|
||||
### Connector Integration Pattern
|
||||
|
||||
Connectors are never directly accessed by features. Instead, they follow this integration pattern:
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Feature] --> B[Service]
|
||||
B --> C[Interface]
|
||||
C --> D[Connector]
|
||||
D --> E[External System]
|
||||
|
||||
style A fill:#fff3e0,stroke:#e65100
|
||||
style B fill:#e8f5e9,stroke:#1b5e20
|
||||
style C fill:#e1f5ff,stroke:#01579b
|
||||
style D fill:#fce4ec,stroke:#880e4f
|
||||
style E fill:#f5f5f5,stroke:#424242
|
||||
```
|
||||
|
||||
**Why This Pattern?**
|
||||
- **Abstraction**: Interfaces hide connector implementation details
|
||||
- **Flexibility**: Connectors can be swapped without affecting features
|
||||
- **Testability**: Interfaces can be mocked for testing
|
||||
- **Consistency**: All data access follows the same pattern
|
||||
- **User Context**: Interfaces handle user context and access control
|
||||
|
||||
---
|
||||
|
||||
## Individual Features
|
||||
|
||||
### Real Estate Feature
|
||||
|
||||
**Location**: `modules/features/realEstate/mainRealEstate.py`
|
||||
|
||||
**Purpose**: Provides AI-powered natural language processing for Real Estate database operations. Enables users to interact with Real Estate data using natural language commands that are translated into CRUD operations.
|
||||
|
||||
**Architecture**:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Real Estate Feature"
|
||||
Route[routeRealEstate.py]
|
||||
Feature[mainRealEstate.py]
|
||||
Intent[Intent Analysis<br/>analyzeUserIntent]
|
||||
CRUD[CRUD Operations<br/>executeIntentBasedOperation]
|
||||
Query[Direct Queries<br/>executeDirectQuery]
|
||||
end
|
||||
|
||||
subgraph "Dependencies"
|
||||
AIService[AI Service<br/>Intent Recognition]
|
||||
REInterface[Real Estate Interface<br/>interfaceDbRealEstateObjects.py]
|
||||
DBConnector[Database Connector<br/>connectorDbPostgre.py]
|
||||
end
|
||||
|
||||
subgraph "Data Models"
|
||||
REModels[Real Estate Models<br/>Projekt, Parzelle, etc.]
|
||||
end
|
||||
|
||||
Route --> Feature
|
||||
Feature --> Intent
|
||||
Feature --> CRUD
|
||||
Feature --> Query
|
||||
|
||||
Intent --> AIService
|
||||
CRUD --> REInterface
|
||||
Query --> REInterface
|
||||
|
||||
REInterface --> DBConnector
|
||||
REInterface --> REModels
|
||||
|
||||
style Feature fill:#fff3e0,stroke:#e65100
|
||||
```
|
||||
|
||||
**Key Functions**:
|
||||
- `processNaturalLanguageCommand()`: Main entry point for natural language processing
|
||||
- `analyzeUserIntent()`: Uses AI to analyze user input and extract intent, entity, and parameters
|
||||
- `executeIntentBasedOperation()`: Executes CRUD operations based on analyzed intent
|
||||
- `executeDirectQuery()`: Executes direct SQL queries without AI processing
|
||||
|
||||
**Connector Usage**:
|
||||
- Uses **Database Connector** (`connectorDbPostgre.py`) through the Real Estate Interface
|
||||
- Accesses PostgreSQL database for Real Estate data
|
||||
- Handles CRUD operations on entities like Projekt, Parzelle, Dokument
|
||||
|
||||
**Service Integration**:
|
||||
- Uses **AI Service** for intent recognition and natural language understanding
|
||||
- Leverages AI planning capabilities to analyze user commands
|
||||
|
||||
**Migration Path**:
|
||||
- May evolve into a **Service** if Real Estate operations become reusable across domains
|
||||
- Could integrate with **Workflows** for complex multi-step Real Estate processes
|
||||
|
||||
---
|
||||
|
||||
### Chat Althaus Feature
|
||||
|
||||
**Location**: `modules/features/chatAlthaus/mainChatAlthaus.py`
|
||||
|
||||
**Purpose**: Manages scheduled data updates for the Althaus preprocessing service. Triggers daily updates to synchronize database configuration with external preprocessing service.
|
||||
|
||||
**Architecture**:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Chat Althaus Feature"
|
||||
Lifecycle[featuresLifecycle.py]
|
||||
Manager[ManagerChatAlthaus]
|
||||
Scheduler[Data Scheduler]
|
||||
Updater[Data Updater<br/>updateDatabaseWithConfig]
|
||||
end
|
||||
|
||||
subgraph "Dependencies"
|
||||
Services[Services Container]
|
||||
HTTPClient[HTTP Client<br/>aiohttp]
|
||||
Config[Configuration<br/>APP_CONFIG]
|
||||
end
|
||||
|
||||
subgraph "External System"
|
||||
AlthausAPI[Althaus Preprocessing API<br/>Azure Function]
|
||||
end
|
||||
|
||||
Lifecycle --> Manager
|
||||
Manager --> Scheduler
|
||||
Manager --> Updater
|
||||
|
||||
Updater --> Services
|
||||
Updater --> HTTPClient
|
||||
Updater --> Config
|
||||
|
||||
Updater --> AlthausAPI
|
||||
|
||||
style Manager fill:#fff3e0,stroke:#e65100
|
||||
```
|
||||
|
||||
**Key Functions**:
|
||||
- `startDataScheduler()`: Initializes and starts the scheduled data update manager
|
||||
- `performDataUpdate()`: Executes immediate data update
|
||||
- `updateDatabaseWithConfig()`: Sends configuration to Althaus preprocessing service
|
||||
|
||||
**Scheduling**:
|
||||
- Runs daily at 01:00 UTC
|
||||
- Uses background scheduler for automated execution
|
||||
- Managed through Features Lifecycle system
|
||||
|
||||
**Connector Usage**:
|
||||
- Uses **HTTP Client** (aiohttp) for API communication
|
||||
- No database connector (uses external API)
|
||||
|
||||
**Service Integration**:
|
||||
- Uses **Services Container** for configuration access
|
||||
- Leverages shared configuration utilities
|
||||
|
||||
**Migration Path**:
|
||||
- Could become a **Service** if data synchronization becomes a core capability
|
||||
- May integrate with **Workflows** for complex data processing pipelines
|
||||
|
||||
---
|
||||
|
||||
### Sync Delta Feature
|
||||
|
||||
**Location**: `modules/features/syncDelta/mainSyncDelta.py`
|
||||
|
||||
**Purpose**: Synchronizes tickets between Jira and SharePoint. Manages bidirectional synchronization of ticket data, supporting both CSV and Excel file formats.
|
||||
|
||||
**Architecture**:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Sync Delta Feature"
|
||||
Lifecycle[featuresLifecycle.py]
|
||||
Manager[ManagerSyncDelta]
|
||||
Sync[syncTicketsOverSharepoint]
|
||||
Merge[Data Merging Logic]
|
||||
Audit[Audit Logging]
|
||||
end
|
||||
|
||||
subgraph "Dependencies"
|
||||
TicketService[Ticket Service]
|
||||
SharePointService[SharePoint Service]
|
||||
JiraConnector[Jira Connector<br/>connectorTicketsJira.py]
|
||||
end
|
||||
|
||||
subgraph "External Systems"
|
||||
Jira[Jira API]
|
||||
SharePoint[SharePoint API]
|
||||
end
|
||||
|
||||
Lifecycle --> Manager
|
||||
Manager --> Sync
|
||||
Sync --> Merge
|
||||
Sync --> Audit
|
||||
|
||||
Sync --> TicketService
|
||||
Sync --> SharePointService
|
||||
|
||||
TicketService --> JiraConnector
|
||||
JiraConnector --> Jira
|
||||
SharePointService --> SharePoint
|
||||
|
||||
style Manager fill:#fff3e0,stroke:#e65100
|
||||
```
|
||||
|
||||
**Key Functions**:
|
||||
- `startSyncManager()`: Initializes background synchronization manager
|
||||
- `syncTicketsOverSharepoint()`: Performs synchronization between Jira and SharePoint
|
||||
- `initializeInterface()`: Sets up connectors and validates connections
|
||||
- `_logAuditEvent()`: Logs synchronization events for auditing
|
||||
|
||||
**Synchronization Modes**:
|
||||
- **CSV Mode**: Uses CSV files for data exchange
|
||||
- **Excel Mode**: Uses Excel (.xlsx) files for data exchange
|
||||
|
||||
**Connector Usage**:
|
||||
- Uses **Jira Connector** (`connectorTicketsJira.py`) through Ticket Service
|
||||
- Uses **SharePoint Service** for file operations
|
||||
- Manages field mapping between Jira and SharePoint formats
|
||||
|
||||
**Service Integration**:
|
||||
- Uses **Ticket Service** for ticket interface creation
|
||||
- Uses **SharePoint Service** for file upload/download
|
||||
- Leverages **Services Container** for configuration and utilities
|
||||
|
||||
**Migration Path**:
|
||||
- Likely candidate for **Service** migration as ticket synchronization becomes core functionality
|
||||
- Could integrate with **Workflows** for complex synchronization scenarios
|
||||
|
||||
---
|
||||
|
||||
### Chat Playground Feature
|
||||
|
||||
**Location**: `modules/features/chatPlayground/mainChatPlayground.py`
|
||||
|
||||
**Purpose**: Provides entry point for chat workflow functionality. Acts as a thin wrapper around the WorkflowManager for chat-based interactions.
|
||||
|
||||
**Architecture**:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Chat Playground Feature"
|
||||
Route[routeChatPlayground.py]
|
||||
Feature[mainChatPlayground.py]
|
||||
Start[chatStart]
|
||||
Stop[chatStop]
|
||||
end
|
||||
|
||||
subgraph "Workflow System"
|
||||
WorkflowManager[WorkflowManager]
|
||||
WorkflowProcessor[WorkflowProcessor]
|
||||
Methods[Workflow Methods]
|
||||
end
|
||||
|
||||
subgraph "Dependencies"
|
||||
Services[Services Container]
|
||||
end
|
||||
|
||||
Route --> Feature
|
||||
Feature --> Start
|
||||
Feature --> Stop
|
||||
|
||||
Start --> WorkflowManager
|
||||
Stop --> WorkflowManager
|
||||
|
||||
WorkflowManager --> WorkflowProcessor
|
||||
WorkflowProcessor --> Methods
|
||||
|
||||
WorkflowManager --> Services
|
||||
|
||||
style Feature fill:#fff3e0,stroke:#e65100
|
||||
style WorkflowManager fill:#e1f5ff,stroke:#01579b
|
||||
```
|
||||
|
||||
**Key Functions**:
|
||||
- `chatStart()`: Starts a new chat workflow or continues an existing one
|
||||
- `chatStop()`: Stops a running chat workflow
|
||||
|
||||
**Relationship to Workflows**:
|
||||
- This feature is a **bridge** between routes and the workflow system
|
||||
- Delegates all processing to WorkflowManager
|
||||
- Demonstrates how features can integrate with workflows
|
||||
|
||||
**Connector Usage**:
|
||||
- No direct connector usage (delegates to workflows)
|
||||
- Workflows use connectors through services and methods
|
||||
|
||||
**Service Integration**:
|
||||
- Uses **Services Container** for workflow management
|
||||
- Leverages workflow services for chat operations
|
||||
|
||||
**Migration Path**:
|
||||
- Already integrated with **Workflows** system
|
||||
- May be simplified or removed as workflows become the primary interface
|
||||
|
||||
---
|
||||
|
||||
### Neutralize Playground Feature
|
||||
|
||||
**Location**: `modules/features/neutralizePlayground/mainNeutralizePlayground.py`
|
||||
|
||||
**Purpose**: Provides a playground interface for data neutralization functionality. Wraps the Neutralization Service for testing and experimentation.
|
||||
|
||||
**Architecture**:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Neutralize Playground Feature"
|
||||
Route[routeDataNeutralization.py]
|
||||
Feature[NeutralizationPlayground]
|
||||
ProcessText[processText]
|
||||
ProcessFiles[processFiles]
|
||||
CleanAttributes[cleanAttributes]
|
||||
Stats[getStats]
|
||||
Config[getConfig/saveConfig]
|
||||
end
|
||||
|
||||
subgraph "Dependencies"
|
||||
NeutralizationService[Neutralization Service]
|
||||
end
|
||||
|
||||
Route --> Feature
|
||||
Feature --> ProcessText
|
||||
Feature --> ProcessFiles
|
||||
Feature --> CleanAttributes
|
||||
Feature --> Stats
|
||||
Feature --> Config
|
||||
|
||||
ProcessText --> NeutralizationService
|
||||
ProcessFiles --> NeutralizationService
|
||||
CleanAttributes --> NeutralizationService
|
||||
Stats --> NeutralizationService
|
||||
Config --> NeutralizationService
|
||||
|
||||
style Feature fill:#fff3e0,stroke:#e65100
|
||||
style NeutralizationService fill:#e8f5e9,stroke:#1b5e20
|
||||
```
|
||||
|
||||
**Key Functions**:
|
||||
- `processText()`: Processes text for data neutralization
|
||||
- `processFiles()`: Processes files for data neutralization
|
||||
- `cleanAttributes()`: Cleans neutralization attributes
|
||||
- `getStats()`: Retrieves neutralization statistics
|
||||
- `getConfig()` / `saveConfig()`: Manages neutralization configuration
|
||||
|
||||
**Purpose as Playground**:
|
||||
- Provides testing interface for neutralization functionality
|
||||
- Allows experimentation with neutralization patterns
|
||||
- Demonstrates service usage patterns
|
||||
|
||||
**Connector Usage**:
|
||||
- No direct connector usage (uses Neutralization Service)
|
||||
- Service handles all data access internally
|
||||
|
||||
**Service Integration**:
|
||||
- Wraps **Neutralization Service** for easy access
|
||||
- Provides playground-specific functionality
|
||||
|
||||
**Migration Path**:
|
||||
- May be removed once neutralization is fully integrated
|
||||
- Functionality may move directly to routes using the service
|
||||
|
||||
---
|
||||
|
||||
## Feature Patterns and Best Practices
|
||||
|
||||
### Pattern 1: Stateless Feature Design
|
||||
|
||||
Features should be stateless and operate without session management. Each request should be independent and self-contained.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Request] --> B[Feature Function]
|
||||
B --> C[Process Request]
|
||||
C --> D[Return Result]
|
||||
|
||||
style B fill:#fff3e0,stroke:#e65100
|
||||
```
|
||||
|
||||
**Benefits**:
|
||||
- Simpler implementation
|
||||
- Better scalability
|
||||
- Easier testing
|
||||
- No state management overhead
|
||||
|
||||
### Pattern 2: Service Delegation
|
||||
|
||||
Features should delegate cross-cutting functionality to services rather than implementing it directly.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
A[Feature] --> B{Needs Functionality}
|
||||
B -->|AI Processing| C[AI Service]
|
||||
B -->|Data Access| D[Interface]
|
||||
B -->|File Operations| E[File Service]
|
||||
B -->|Other| F[Other Services]
|
||||
|
||||
style A fill:#fff3e0,stroke:#e65100
|
||||
style C fill:#e8f5e9,stroke:#1b5e20
|
||||
style D fill:#e1f5ff,stroke:#01579b
|
||||
```
|
||||
|
||||
**Benefits**:
|
||||
- Code reuse
|
||||
- Consistent behavior
|
||||
- Easier maintenance
|
||||
- Better separation of concerns
|
||||
|
||||
### Pattern 3: Interface Abstraction
|
||||
|
||||
Features should never directly access connectors. All data access should go through interfaces.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Feature] --> B[Interface]
|
||||
B --> C[Connector]
|
||||
C --> D[External System]
|
||||
|
||||
style A fill:#fff3e0,stroke:#e65100
|
||||
style B fill:#e1f5ff,stroke:#01579b
|
||||
style C fill:#fce4ec,stroke:#880e4f
|
||||
```
|
||||
|
||||
**Benefits**:
|
||||
- Abstraction of implementation details
|
||||
- Flexibility to change connectors
|
||||
- Consistent data access patterns
|
||||
- User context handling
|
||||
|
||||
### Pattern 4: Background Processing
|
||||
|
||||
Features requiring background processing should use the Features Lifecycle system.
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant App as Application
|
||||
participant Lifecycle as Features Lifecycle
|
||||
participant Feature as Background Feature
|
||||
participant Scheduler as Scheduler
|
||||
|
||||
App->>Lifecycle: Startup
|
||||
Lifecycle->>Feature: Initialize Manager
|
||||
Feature->>Scheduler: Start Background Task
|
||||
Scheduler-->>Feature: Task Running
|
||||
|
||||
Note over Feature,Scheduler: Background Processing...
|
||||
|
||||
App->>Lifecycle: Shutdown
|
||||
Lifecycle->>Feature: Stop Manager
|
||||
Feature->>Scheduler: Stop Background Task
|
||||
Scheduler-->>Feature: Task Stopped
|
||||
```
|
||||
|
||||
**Benefits**:
|
||||
- Proper lifecycle management
|
||||
- Clean startup/shutdown
|
||||
- Resource management
|
||||
- Error handling
|
||||
|
||||
### Pattern 5: Migration Planning
|
||||
|
||||
Features should be designed with migration in mind. Consider future migration to services or workflows during design.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Feature Design] --> B{Consider Migration}
|
||||
B -->|Reusable Logic| C[Design as Service]
|
||||
B -->|Complex Flow| D[Design for Workflow]
|
||||
B -->|Temporary| E[Keep as Feature]
|
||||
|
||||
style A fill:#fff3e0,stroke:#e65100
|
||||
style C fill:#e8f5e9,stroke:#1b5e20
|
||||
style D fill:#e1f5ff,stroke:#01579b
|
||||
```
|
||||
|
||||
**Best Practices**:
|
||||
- Document migration path
|
||||
- Keep dependencies minimal
|
||||
- Use standard patterns
|
||||
- Plan for refactoring
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
The Features component provides a flexible, domain-specific business logic layer that enables rapid development while maintaining architectural boundaries. Features serve as temporary solutions that bridge the gap between initial requirements and full service or workflow implementation.
|
||||
|
||||
**Key Takeaways**:
|
||||
|
||||
1. **Features are Temporary**: Designed to be migrated to services or workflows as they mature
|
||||
2. **Domain-Specific**: Each feature addresses a specific business domain or use case
|
||||
3. **Service-Dependent**: Features leverage services for cross-cutting functionality
|
||||
4. **Interface-Abstracted**: Features access data through interfaces, never directly through connectors
|
||||
5. **Lifecycle-Managed**: Background features are managed through the Features Lifecycle system
|
||||
6. **Connector Integration**: Connectors are accessed through interfaces, providing abstraction and flexibility
|
||||
|
||||
The architecture supports a natural evolution path from features to services or workflows, ensuring that the codebase remains maintainable and scalable as functionality matures.
|
||||
|
||||
2281
docs/code-documentation/gateway-development-framework.md
Normal file
2281
docs/code-documentation/gateway-development-framework.md
Normal file
File diff suppressed because it is too large
Load diff
1133
docs/code-documentation/interactive-workflow-planning-ui.md
Normal file
1133
docs/code-documentation/interactive-workflow-planning-ui.md
Normal file
File diff suppressed because it is too large
Load diff
508
docs/code-documentation/security-api.md
Normal file
508
docs/code-documentation/security-api.md
Normal file
|
|
@ -0,0 +1,508 @@
|
|||
# Security API Documentation
|
||||
|
||||
API documentation for security-related endpoints and how to use security components in routes.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Overview](#overview)
|
||||
2. [Authentication Endpoints](#authentication-endpoints)
|
||||
3. [Authentication Flows](#authentication-flows)
|
||||
4. [Using Security in Routes](#using-security-in-routes)
|
||||
5. [API Examples](#api-examples)
|
||||
|
||||
## Overview
|
||||
|
||||
The Security component provides authentication endpoints and utilities that routes can use to protect their endpoints and access user context. This document focuses on the API surface and how to use security components from route handlers.
|
||||
|
||||
For detailed information about the Security component architecture and internal workings, see [Security Component Documentation](./security-component.md).
|
||||
|
||||
## Authentication Endpoints
|
||||
|
||||
### Local Authentication
|
||||
|
||||
**Base Path**: `/api/local`
|
||||
|
||||
#### POST `/api/local/login`
|
||||
Authenticate with username and password.
|
||||
|
||||
**Request**:
|
||||
- Content-Type: `application/x-www-form-urlencoded`
|
||||
- Headers: `X-CSRF-Token` (required)
|
||||
- Body: `username`, `password` (form data)
|
||||
|
||||
**Response**:
|
||||
- Status: `200 OK`
|
||||
- Cookies: `auth_token` (httpOnly), `refresh_token` (httpOnly)
|
||||
- Body:
|
||||
```json
|
||||
{
|
||||
"type": "local_auth_success",
|
||||
"message": "Login successful - tokens set in httpOnly cookies",
|
||||
"authenticationAuthority": "local",
|
||||
"expires_at": "2024-01-01T12:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
**Rate Limit**: 30 requests per minute
|
||||
|
||||
#### POST `/api/local/register`
|
||||
Register a new user account.
|
||||
|
||||
**Request**:
|
||||
- Content-Type: `application/json`
|
||||
- Body: User object + password
|
||||
|
||||
**Response**: User object
|
||||
|
||||
**Rate Limit**: 10 requests per minute
|
||||
|
||||
#### GET `/api/local/me`
|
||||
Get current authenticated user information.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: User object
|
||||
|
||||
**Rate Limit**: 30 requests per minute
|
||||
|
||||
#### POST `/api/local/refresh`
|
||||
Refresh access token using refresh token.
|
||||
|
||||
**Request**:
|
||||
- Cookie: `refresh_token` (httpOnly)
|
||||
|
||||
**Response**:
|
||||
- Cookies: New `auth_token` and `refresh_token`
|
||||
- Body: Token refresh response
|
||||
|
||||
**Rate Limit**: 60 requests per minute
|
||||
|
||||
#### POST `/api/local/logout`
|
||||
Logout current user and invalidate tokens.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: Logout confirmation
|
||||
|
||||
**Rate Limit**: 10 requests per minute
|
||||
|
||||
### Microsoft OAuth Authentication
|
||||
|
||||
**Base Path**: `/api/msft`
|
||||
|
||||
#### GET `/api/msft/login`
|
||||
Initiate Microsoft OAuth login flow.
|
||||
|
||||
**Response**: Redirects to Microsoft OAuth login page
|
||||
|
||||
#### GET `/api/msft/auth/callback`
|
||||
OAuth callback endpoint (handled by Microsoft).
|
||||
|
||||
**Query Parameters**:
|
||||
- `code`: Authorization code from Microsoft
|
||||
- `state`: State parameter for CSRF protection
|
||||
|
||||
**Response**: HTML page that sets cookies and redirects
|
||||
|
||||
#### GET `/api/msft/me`
|
||||
Get current authenticated user information.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: User object
|
||||
|
||||
#### POST `/api/msft/logout`
|
||||
Logout current user.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: Logout confirmation
|
||||
|
||||
### Google OAuth Authentication
|
||||
|
||||
**Base Path**: `/api/google`
|
||||
|
||||
#### GET `/api/google/login`
|
||||
Initiate Google OAuth login flow.
|
||||
|
||||
**Query Parameters**:
|
||||
- `state`: Optional state parameter (default: "login")
|
||||
- `connectionId`: Optional connection ID for connection flow
|
||||
|
||||
**Response**: Redirects to Google OAuth login page
|
||||
|
||||
#### GET `/api/google/auth/callback`
|
||||
OAuth callback endpoint (handled by Google).
|
||||
|
||||
**Query Parameters**:
|
||||
- `code`: Authorization code from Google
|
||||
- `state`: State parameter for CSRF protection
|
||||
|
||||
**Response**: HTML page that sets cookies and redirects
|
||||
|
||||
#### GET `/api/google/me`
|
||||
Get current authenticated user information.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: User object
|
||||
|
||||
#### POST `/api/google/logout`
|
||||
Logout current user.
|
||||
|
||||
**Request**:
|
||||
- Headers: `Authorization: Bearer <token>` OR Cookie: `auth_token`
|
||||
|
||||
**Response**: Logout confirmation
|
||||
|
||||
## Authentication Flows
|
||||
|
||||
### Login Flow (Local Authentication)
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant Route as Login Route<br/>POST /api/local/login
|
||||
participant Auth as auth.py
|
||||
participant JWT as jwtService.py
|
||||
participant Interface as Interface Layer
|
||||
participant DB as Database
|
||||
|
||||
Client->>Route: POST /api/local/login<br/>(username, password, X-CSRF-Token)
|
||||
Route->>Route: Validate CSRF Token
|
||||
Route->>Interface: authenticateLocalUser(username, password)
|
||||
Interface->>DB: Query User & Verify Password
|
||||
DB-->>Interface: User Record
|
||||
|
||||
alt Invalid Credentials
|
||||
Interface-->>Route: None
|
||||
Route-->>Client: HTTPException 401
|
||||
end
|
||||
|
||||
Route->>JWT: createAccessToken(userData)
|
||||
JWT->>JWT: Generate JTI (UUID)
|
||||
JWT->>JWT: Set Expiration
|
||||
JWT->>JWT: Sign JWT
|
||||
JWT-->>Route: Access Token + Expires At
|
||||
|
||||
Route->>JWT: createRefreshToken(userData)
|
||||
JWT-->>Route: Refresh Token + Expires At
|
||||
|
||||
Route->>Interface: Save Token to DB<br/>(for LOCAL authority)
|
||||
Interface->>DB: Insert Token Record
|
||||
|
||||
Route->>JWT: setAccessTokenCookie(response, token)
|
||||
JWT->>JWT: Set httpOnly Cookie<br/>(secure, samesite=strict)
|
||||
|
||||
Route->>JWT: setRefreshTokenCookie(response, token)
|
||||
JWT->>JWT: Set httpOnly Cookie
|
||||
|
||||
Route-->>Client: HTTP Response<br/>(with Cookies)
|
||||
```
|
||||
|
||||
### OAuth Flow (Microsoft/Google)
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant Route as OAuth Route<br/>GET /api/{provider}/login
|
||||
participant Provider as OAuth Provider<br/>(MSFT/Google)
|
||||
participant JWT as jwtService.py
|
||||
participant Interface as Interface Layer
|
||||
participant DB as Database
|
||||
|
||||
Client->>Route: GET /api/{provider}/login
|
||||
Route->>Route: Generate OAuth State
|
||||
Route->>Provider: Redirect to OAuth URL<br/>(with state, client_id, redirect_uri)
|
||||
Provider-->>Client: OAuth Login Page
|
||||
|
||||
Client->>Provider: User Authenticates
|
||||
Provider->>Route: GET /api/{provider}/callback<br/>(code, state)
|
||||
|
||||
Route->>Route: Validate State
|
||||
Route->>Provider: Exchange Code for Tokens<br/>(POST /token)
|
||||
Provider-->>Route: Access Token + Refresh Token
|
||||
|
||||
Route->>Provider: Get User Info<br/>(using Access Token)
|
||||
Provider-->>Route: User Profile Data
|
||||
|
||||
Route->>Interface: Find/Create User<br/>(by external ID)
|
||||
Interface->>DB: Query/Create User
|
||||
DB-->>Interface: User Record
|
||||
Interface-->>Route: User Object
|
||||
|
||||
Route->>Interface: Save/Create Connection
|
||||
Interface->>DB: Save Connection Record
|
||||
|
||||
Route->>Interface: Save Token
|
||||
Interface->>DB: Save Token Record
|
||||
|
||||
Route->>JWT: createAccessToken(userData)
|
||||
JWT-->>Route: Gateway JWT Token
|
||||
|
||||
Route->>JWT: setAccessTokenCookie(response, token)
|
||||
Route->>JWT: setRefreshTokenCookie(response, token)
|
||||
|
||||
Route-->>Client: HTTP Response<br/>(with Gateway Cookies)
|
||||
```
|
||||
|
||||
## Using Security in Routes
|
||||
|
||||
### Basic Authentication Pattern
|
||||
|
||||
All protected routes use the `getCurrentUser` dependency to access the authenticated user:
|
||||
|
||||
```python
|
||||
from fastapi import APIRouter, Depends
|
||||
from modules.security.auth import getCurrentUser
|
||||
from modules.datamodels.datamodelUam import User
|
||||
|
||||
router = APIRouter(prefix="/api/example", tags=["Example"])
|
||||
|
||||
@router.get("/protected")
|
||||
async def protected_endpoint(
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> dict:
|
||||
"""
|
||||
Protected endpoint that requires authentication.
|
||||
The currentUser parameter is automatically populated by getCurrentUser.
|
||||
"""
|
||||
return {
|
||||
"message": f"Hello, {currentUser.username}!",
|
||||
"userId": currentUser.id,
|
||||
"mandateId": currentUser.mandateId
|
||||
}
|
||||
```
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
Use the `limiter` from the security module to add rate limiting:
|
||||
|
||||
```python
|
||||
from modules.security.auth import getCurrentUser, limiter
|
||||
from fastapi import Request
|
||||
|
||||
@router.post("/action")
|
||||
@limiter.limit("30/minute")
|
||||
async def rate_limited_endpoint(
|
||||
request: Request,
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> dict:
|
||||
"""Endpoint with rate limiting (30 requests per minute)"""
|
||||
return {"status": "success"}
|
||||
```
|
||||
|
||||
### Cookie vs Header Authentication
|
||||
|
||||
The security component supports both authentication methods:
|
||||
|
||||
1. **Cookie-based** (preferred for web apps):
|
||||
- Tokens are automatically sent via httpOnly cookies
|
||||
- More secure (not accessible via JavaScript)
|
||||
- Automatically included in requests from same origin
|
||||
|
||||
2. **Header-based** (for API clients):
|
||||
- Use `Authorization: Bearer <token>` header
|
||||
- Required for programmatic API access
|
||||
- Tokens can be obtained from login endpoints
|
||||
|
||||
The `CookieAuth` class checks cookies first, then falls back to headers.
|
||||
|
||||
### Creating Tokens in Routes
|
||||
|
||||
When implementing custom authentication endpoints, use the JWT service:
|
||||
|
||||
```python
|
||||
from modules.security.jwtService import (
|
||||
createAccessToken,
|
||||
createRefreshToken,
|
||||
setAccessTokenCookie,
|
||||
setRefreshTokenCookie
|
||||
)
|
||||
from modules.datamodels.datamodelUam import AuthAuthority
|
||||
|
||||
@router.post("/custom-login")
|
||||
async def custom_login(
|
||||
response: Response,
|
||||
username: str,
|
||||
password: str
|
||||
):
|
||||
# Verify credentials...
|
||||
user = verify_user(username, password)
|
||||
|
||||
# Create token data
|
||||
token_data = {
|
||||
"sub": user.username,
|
||||
"mandateId": str(user.mandateId),
|
||||
"userId": str(user.id),
|
||||
"authenticationAuthority": AuthAuthority.LOCAL
|
||||
}
|
||||
|
||||
# Create tokens
|
||||
access_token, expires_at = createAccessToken(token_data)
|
||||
refresh_token, _ = createRefreshToken(token_data)
|
||||
|
||||
# Set cookies
|
||||
setAccessTokenCookie(response, access_token)
|
||||
setRefreshTokenCookie(response, refresh_token)
|
||||
|
||||
return {"status": "success", "expires_at": expires_at.isoformat()}
|
||||
```
|
||||
|
||||
### Clearing Tokens (Logout)
|
||||
|
||||
Use the JWT service cookie clearing functions:
|
||||
|
||||
```python
|
||||
from modules.security.jwtService import (
|
||||
clearAccessTokenCookie,
|
||||
clearRefreshTokenCookie
|
||||
)
|
||||
|
||||
@router.post("/logout")
|
||||
async def logout(
|
||||
response: Response,
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
):
|
||||
# Clear cookies
|
||||
clearAccessTokenCookie(response)
|
||||
clearRefreshTokenCookie(response)
|
||||
|
||||
# Optionally revoke token in database
|
||||
# interface.revokeToken(tokenId)
|
||||
|
||||
return {"status": "logged_out"}
|
||||
```
|
||||
|
||||
## API Examples
|
||||
|
||||
### Example: Protected Endpoint
|
||||
|
||||
```python
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from modules.security.auth import getCurrentUser, limiter
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from fastapi import Request
|
||||
|
||||
router = APIRouter(prefix="/api/data", tags=["Data"])
|
||||
|
||||
@router.get("/items")
|
||||
@limiter.limit("60/minute")
|
||||
async def get_items(
|
||||
request: Request,
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> list:
|
||||
"""
|
||||
Get items for the current user.
|
||||
Requires authentication.
|
||||
"""
|
||||
# User is guaranteed to be authenticated and enabled
|
||||
# Access user properties: currentUser.id, currentUser.mandateId, etc.
|
||||
|
||||
items = fetch_user_items(currentUser.id)
|
||||
return items
|
||||
```
|
||||
|
||||
### Example: Role-Based Access
|
||||
|
||||
```python
|
||||
from modules.datamodels.datamodelUam import UserPrivilege
|
||||
|
||||
@router.delete("/admin/items/{item_id}")
|
||||
async def delete_item(
|
||||
item_id: str,
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
):
|
||||
"""
|
||||
Delete item (admin only).
|
||||
"""
|
||||
# Check user privilege
|
||||
if currentUser.privilege not in [UserPrivilege.ADMIN, UserPrivilege.SYSADMIN]:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Admin access required"
|
||||
)
|
||||
|
||||
delete_item_by_id(item_id)
|
||||
return {"status": "deleted"}
|
||||
```
|
||||
|
||||
### Example: Mandate-Scoped Access
|
||||
|
||||
```python
|
||||
@router.get("/mandate/data")
|
||||
async def get_mandate_data(
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
):
|
||||
"""
|
||||
Get data scoped to user's mandate.
|
||||
"""
|
||||
# User's mandateId is automatically validated during authentication
|
||||
# Token context must match user's current mandate
|
||||
|
||||
data = fetch_mandate_data(currentUser.mandateId)
|
||||
return data
|
||||
```
|
||||
|
||||
### Example: CSRF Protection
|
||||
|
||||
For state-changing operations, ensure CSRF token is included:
|
||||
|
||||
```python
|
||||
@router.post("/update")
|
||||
async def update_data(
|
||||
request: Request,
|
||||
data: dict,
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
):
|
||||
"""
|
||||
Update data (requires CSRF token).
|
||||
CSRF middleware automatically validates X-CSRF-Token header.
|
||||
"""
|
||||
# CSRF validation happens automatically via middleware
|
||||
# Just ensure client sends X-CSRF-Token header
|
||||
|
||||
update_user_data(currentUser.id, data)
|
||||
return {"status": "updated"}
|
||||
```
|
||||
|
||||
### Example: Error Handling
|
||||
|
||||
```python
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
@router.get("/sensitive")
|
||||
async def get_sensitive_data(
|
||||
currentUser: User = Depends(getCurrentUser)
|
||||
):
|
||||
"""
|
||||
Get sensitive data with proper error handling.
|
||||
"""
|
||||
try:
|
||||
# getCurrentUser already validates:
|
||||
# - Token is valid and not expired
|
||||
# - User exists and is enabled
|
||||
# - Context matches (mandateId, userId)
|
||||
|
||||
data = fetch_sensitive_data(currentUser.id)
|
||||
return data
|
||||
|
||||
except ValueError as e:
|
||||
# Handle business logic errors
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=str(e)
|
||||
)
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Security Component Documentation](./security-component.md) - Component architecture and internal workings
|
||||
- [Architecture Overview](./architecture-overview.md) - Overall system architecture
|
||||
|
||||
|
||||
1399
docs/code-documentation/security-component.md
Normal file
1399
docs/code-documentation/security-component.md
Normal file
File diff suppressed because it is too large
Load diff
2399
docs/code-documentation/services-api-reference.md
Normal file
2399
docs/code-documentation/services-api-reference.md
Normal file
File diff suppressed because it is too large
Load diff
1530
docs/code-documentation/services-component.md
Normal file
1530
docs/code-documentation/services-component.md
Normal file
File diff suppressed because it is too large
Load diff
1245
docs/code-documentation/workflows-component.md
Normal file
1245
docs/code-documentation/workflows-component.md
Normal file
File diff suppressed because it is too large
Load diff
1677
docs/frontend-documentation/workflow-routes-frontend.md
Normal file
1677
docs/frontend-documentation/workflow-routes-frontend.md
Normal file
File diff suppressed because it is too large
Load diff
19
logs/debug/messages/20251127-113948-147_m_1_0_0/message.json
Normal file
19
logs/debug/messages/20251127-113948-147_m_1_0_0/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_d93206d0-bce6-48bb-aa24-df4ee6b52335",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "test",
|
||||
"role": "user",
|
||||
"status": "first",
|
||||
"sequenceNr": 1,
|
||||
"publishedAt": 1764243585.056298,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 0,
|
||||
"actionNumber": 0,
|
||||
"documentsLabel": "round1_usercontext",
|
||||
"actionId": null,
|
||||
"actionMethod": null,
|
||||
"actionName": null,
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
test
|
||||
19
logs/debug/messages/20251127-113957-841_m_1_1_0/message.json
Normal file
19
logs/debug/messages/20251127-113957-841_m_1_1_0/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_e290a3f2-1d32-4eaf-96c1-522c6e3c50cf",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "📋 **Task Plan**\n\nWe have created a task plan to accomplish your main business objective efficiently.\n\n💬 This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 2,
|
||||
"publishedAt": 1764243597.686788,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 0,
|
||||
"documentsLabel": "task_plan",
|
||||
"actionId": null,
|
||||
"actionMethod": null,
|
||||
"actionName": null,
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
📋 **Task Plan**
|
||||
|
||||
We have created a task plan to accomplish your main business objective efficiently.
|
||||
|
||||
💬 This task will accomplish the entire business objective you have requested.
|
||||
|
||||
19
logs/debug/messages/20251127-113958-980_m_1_1_0/message.json
Normal file
19
logs/debug/messages/20251127-113958-980_m_1_1_0/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_2a59133b-7b54-43e5-a42a-a26574dc6431",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "🚀 **Task 1/1**\n\n💬 This task will accomplish the entire business objective you have requested.",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 3,
|
||||
"publishedAt": 1764243598.8484213,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 0,
|
||||
"documentsLabel": "task_1_start",
|
||||
"actionId": null,
|
||||
"actionMethod": null,
|
||||
"actionName": null,
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
🚀 **Task 1/1**
|
||||
|
||||
💬 This task will accomplish the entire business objective you have requested.
|
||||
19
logs/debug/messages/20251127-114024-001_m_1_1_1/message.json
Normal file
19
logs/debug/messages/20251127-114024-001_m_1_1_1/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_b5e92d78-7260-46b2-a95a-b64b8d329e50",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "**Action 1 (ai.generateDocument)**\n\n✅ This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 4,
|
||||
"publishedAt": 1764243623.799448,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 1,
|
||||
"documentsLabel": "round1_task1_action1_results",
|
||||
"actionId": "action_3679cfd2-c66d-4ed5-a125-7c8ea9d93b6c",
|
||||
"actionMethod": "ai",
|
||||
"actionName": "generateDocument",
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
**Action 1 (ai.generateDocument)**
|
||||
|
||||
✅ This task will accomplish the entire business objective you have requested.
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "08c7d2e7-e3ac-44c6-b305-2696f7de627a",
|
||||
"messageId": "msg_b5e92d78-7260-46b2-a95a-b64b8d329e50",
|
||||
"fileId": "16a9c803-a59b-43d3-9fc9-7ae9d6242e17",
|
||||
"fileName": "test_document_memo.docx",
|
||||
"fileSize": 36938,
|
||||
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 1,
|
||||
"actionId": "action_3679cfd2-c66d-4ed5-a125-7c8ea9d93b6c"
|
||||
}
|
||||
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "da1fa51f-68d2-41f1-bc25-aaff26beaab7",
|
||||
"messageId": "msg_b5e92d78-7260-46b2-a95a-b64b8d329e50",
|
||||
"fileId": "c6cb75d8-5a4f-4774-aa32-4c769507d8d4",
|
||||
"fileName": "structured_content.json",
|
||||
"fileSize": 2612,
|
||||
"mimeType": "application/json",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 1,
|
||||
"actionId": "action_3679cfd2-c66d-4ed5-a125-7c8ea9d93b6c"
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation",
|
||||
"title": "Test Document"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Test Document",
|
||||
"filename": "test_document_memo.docx",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_1",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Memo"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_heading_2",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "To: All Employees"
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_heading_3",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "From: Management"
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_heading_4",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "Date: October 10, 2023"
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_heading_5",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "Subject: Placeholder Content"
|
||||
}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_1",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "This memo serves as a placeholder for future content. Please review the structure and format to ensure it meets your needs."
|
||||
}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_1",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Introduction to the topic",
|
||||
"Detailed analysis",
|
||||
"Conclusion and recommendations"
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_2",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "For further information, please contact the management team. We appreciate your attention to this matter and look forward to your feedback."
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
19
logs/debug/messages/20251127-114110-763_m_1_1_2/message.json
Normal file
19
logs/debug/messages/20251127-114110-763_m_1_1_2/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_fd67f067-be0d-45fe-9a53-40507b83be9b",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "**Action 2 (ai.analyzeDocuments)**\n\n✅ This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 5,
|
||||
"publishedAt": 1764243670.5022125,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 2,
|
||||
"documentsLabel": "round1_task1_action2_results",
|
||||
"actionId": "action_65fdae54-0864-45f7-921e-4872ec5849d6",
|
||||
"actionMethod": "ai",
|
||||
"actionName": "analyzeDocuments",
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
**Action 2 (ai.analyzeDocuments)**
|
||||
|
||||
✅ This task will accomplish the entire business objective you have requested.
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
Memo Analysis Report
|
||||
====================
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.
|
||||
|
||||
Key Insights
|
||||
============
|
||||
|
||||
Trends and Patterns
|
||||
===================
|
||||
|
||||
The document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation.
|
||||
|
||||
Important Findings
|
||||
==================
|
||||
|
||||
Actionable Insights
|
||||
===================
|
||||
|
||||
|
||||
Generated: 2025-11-27 11:41:09 UTC
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "937cbc15-3df6-45b7-8d24-80964746a4be",
|
||||
"messageId": "msg_fd67f067-be0d-45fe-9a53-40507b83be9b",
|
||||
"fileId": "0ff8956e-2a0c-4251-bb85-06713416e004",
|
||||
"fileName": "memo_analysis_report.txt",
|
||||
"fileSize": 780,
|
||||
"mimeType": "text/plain",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 2,
|
||||
"actionId": "action_65fdae54-0864-45f7-921e-4872ec5849d6"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "b129c6dc-f9ac-45de-9789-7ca73002d314",
|
||||
"messageId": "msg_fd67f067-be0d-45fe-9a53-40507b83be9b",
|
||||
"fileId": "c8b9d523-ed09-4670-80b7-a40d64688344",
|
||||
"fileName": "structured_content_1.json",
|
||||
"fileSize": 4399,
|
||||
"mimeType": "application/json",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 2,
|
||||
"actionId": "action_65fdae54-0864-45f7-921e-4872ec5849d6"
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation",
|
||||
"title": "Memo Analysis Report"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report",
|
||||
"filename": "memo_analysis_report.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_overview",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Overview"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_overview_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Key Insights"
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.",
|
||||
"It is explicitly labeled as a placeholder, indicating it is not the final content but a template for future use.",
|
||||
"The memo encourages feedback from employees, suggesting an open line of communication between management and staff."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Trends and Patterns"
|
||||
}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation."
|
||||
}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Important Findings"
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo is issued by management, underscoring their role in overseeing communication standards.",
|
||||
"By soliciting feedback, the document reflects a collaborative environment where employee input is valued."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Actionable Insights"
|
||||
}
|
||||
],
|
||||
"order": 8
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Review and standardize document templates to maintain consistency across the organization.",
|
||||
"Establish regular channels for employees to provide feedback on communication tools and practices.",
|
||||
"Provide training sessions for employees on how to utilize document templates effectively.",
|
||||
"Regularly review and update document templates to reflect any changes in organizational needs."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
19
logs/debug/messages/20251127-114147-275_m_1_1_3/message.json
Normal file
19
logs/debug/messages/20251127-114147-275_m_1_1_3/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_23fba067-7b15-4079-bc8e-6d82f00c38c0",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "**Action 3 (ai.summarizeDocument)**\n\n✅ This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 6,
|
||||
"publishedAt": 1764243707.10735,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 3,
|
||||
"documentsLabel": "round1_task1_action3_results",
|
||||
"actionId": "action_d585b2e1-8682-4b46-bc30-94d802161981",
|
||||
"actionMethod": "ai",
|
||||
"actionName": "summarizeDocument",
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
**Action 3 (ai.summarizeDocument)**
|
||||
|
||||
✅ This task will accomplish the entire business objective you have requested.
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
Memo Analysis Report Summary
|
||||
============================
|
||||
|
||||
Key Insights
|
||||
============
|
||||
|
||||
The memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency.
|
||||
|
||||
|
||||
Generated: 2025-11-27 11:41:46 UTC
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "04546e10-67f0-4e89-aecf-67e6261ab919",
|
||||
"messageId": "msg_23fba067-7b15-4079-bc8e-6d82f00c38c0",
|
||||
"fileId": "5d220ab1-9b07-490f-91ca-b06317bc3971",
|
||||
"fileName": "memo_analysis_summary.txt",
|
||||
"fileSize": 390,
|
||||
"mimeType": "text/plain",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 3,
|
||||
"actionId": "action_d585b2e1-8682-4b46-bc30-94d802161981"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "05e4eb1c-451f-4a88-b96b-3767ba13a8b5",
|
||||
"messageId": "msg_23fba067-7b15-4079-bc8e-6d82f00c38c0",
|
||||
"fileId": "a109b999-23b8-4e48-8821-dc49c3e55f21",
|
||||
"fileName": "structured_content_2.json",
|
||||
"fileSize": 1803,
|
||||
"mimeType": "application/json",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 3,
|
||||
"actionId": "action_d585b2e1-8682-4b46-bc30-94d802161981"
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation",
|
||||
"title": "Memo Analysis Report Summary"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report Summary",
|
||||
"filename": "memo_analysis_summary.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Key Insights"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_summary",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_insights",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Conventional Structure: The memo follows a traditional format with sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency.",
|
||||
"Placeholder Nature: The document is labeled as a placeholder, indicating flexibility and adaptability in content creation.",
|
||||
"Encouragement of Feedback: The memo invites feedback from employees, promoting open communication and a collaborative environment."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
19
logs/debug/messages/20251127-114229-639_m_1_1_4/message.json
Normal file
19
logs/debug/messages/20251127-114229-639_m_1_1_4/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_a18f6389-b07f-40b9-9c9f-3d4c889201bf",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "**Action 4 (ai.analyzeDocuments)**\n\n✅ This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 7,
|
||||
"publishedAt": 1764243749.4128509,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 4,
|
||||
"documentsLabel": "round1_task1_action4_results",
|
||||
"actionId": "action_67646482-4149-485b-9075-0f404d6d7d55",
|
||||
"actionMethod": "ai",
|
||||
"actionName": "analyzeDocuments",
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
**Action 4 (ai.analyzeDocuments)**
|
||||
|
||||
✅ This task will accomplish the entire business objective you have requested.
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
Memo Analysis Report
|
||||
====================
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.
|
||||
|
||||
Key Insights
|
||||
============
|
||||
|
||||
Trends and Patterns
|
||||
===================
|
||||
|
||||
Important Findings
|
||||
==================
|
||||
|
||||
Actionable Insights
|
||||
===================
|
||||
|
||||
|
||||
Generated: 2025-11-27 11:42:28 UTC
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "84940888-ac72-4433-af74-00b9ad866f0c",
|
||||
"messageId": "msg_a18f6389-b07f-40b9-9c9f-3d4c889201bf",
|
||||
"fileId": "f066d5f7-8793-4258-9667-febf5b3b47b4",
|
||||
"fileName": "memo_analysis_report_1.txt",
|
||||
"fileSize": 469,
|
||||
"mimeType": "text/plain",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 4,
|
||||
"actionId": "action_67646482-4149-485b-9075-0f404d6d7d55"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "d5d8e687-129e-44f3-aea3-09c665c3d54d",
|
||||
"messageId": "msg_a18f6389-b07f-40b9-9c9f-3d4c889201bf",
|
||||
"fileId": "d48e3112-bd6c-478b-ae2c-d409922ac210",
|
||||
"fileName": "structured_content_3.json",
|
||||
"fileSize": 4815,
|
||||
"mimeType": "application/json",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 4,
|
||||
"actionId": "action_67646482-4149-485b-9075-0f404d6d7d55"
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation",
|
||||
"title": "Memo Analysis Report"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report",
|
||||
"filename": "memo_analysis_report.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_overview",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Overview"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_overview_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Key Insights"
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Structured Communication: The memo emphasizes the importance of having a well-defined structure in official communications, suggesting that the organization prioritizes clarity and consistency.",
|
||||
"Proactive Document Preparation: The use of placeholders indicates a proactive approach to document preparation, allowing flexibility and adaptability in content creation."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Trends and Patterns"
|
||||
}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Emphasis on Clarity and Consistency: The structured format reflects a trend towards minimizing misunderstandings and ensuring alignment in organizational updates.",
|
||||
"Adaptability in Communication: The placeholder nature suggests a trend towards adaptability, enabling quick responses to changing circumstances."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Important Findings"
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Organizational Values: The memo's structure indicates values of clarity, consistency, and adaptability, likely reflected in other organizational operations.",
|
||||
"Potential for Improved Efficiency: Using placeholders and structured formats can improve communication efficiency by reducing the time and effort needed for drafting new communications."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Actionable Insights"
|
||||
}
|
||||
],
|
||||
"order": 8
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Standardize Communication Templates: Develop standardized templates to enhance clarity and consistency across communications.",
|
||||
"Training on Effective Communication: Provide training for employees on using structured templates effectively and adapting them to various contexts.",
|
||||
"Regular Review and Update of Templates: Regularly review and update communication templates to ensure they meet evolving organizational needs.",
|
||||
"Feedback Mechanism: Implement a feedback mechanism for employees to provide input on communication practices, ensuring alignment with employee needs and organizational goals."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
19
logs/debug/messages/20251127-114301-221_m_1_1_5/message.json
Normal file
19
logs/debug/messages/20251127-114301-221_m_1_1_5/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_e945a952-5733-476f-90d0-b2bfa125d9be",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "**Action 5 (ai.summarizeDocument)**\n\n✅ This task will accomplish the entire business objective you have requested.\n\n",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 8,
|
||||
"publishedAt": 1764243780.9853323,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 5,
|
||||
"documentsLabel": "round1_task1_action5_results",
|
||||
"actionId": "action_9608f071-b799-419a-b396-8f8ffe9ee4f3",
|
||||
"actionMethod": "ai",
|
||||
"actionName": "summarizeDocument",
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
**Action 5 (ai.summarizeDocument)**
|
||||
|
||||
✅ This task will accomplish the entire business objective you have requested.
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
Memo Summary
|
||||
============
|
||||
|
||||
Memo Summary
|
||||
============
|
||||
|
||||
The memo, dated October 10, 2023, is addressed to all employees from management and serves as a placeholder for future content. It outlines the structure and format for upcoming communications and emphasizes the importance of reviewing this structure to meet organizational needs.
|
||||
|
||||
The memo highlights the importance of employee input and collaboration in refining communication tools within the organization.
|
||||
|
||||
|
||||
Generated: 2025-11-27 11:42:59 UTC
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "f420bacd-393f-4e84-8087-584a22738532",
|
||||
"messageId": "msg_e945a952-5733-476f-90d0-b2bfa125d9be",
|
||||
"fileId": "9aed6bd3-0d00-404d-bc59-7ec9f818b950",
|
||||
"fileName": "memo_summary.txt",
|
||||
"fileSize": 500,
|
||||
"mimeType": "text/plain",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 5,
|
||||
"actionId": "action_9608f071-b799-419a-b396-8f8ffe9ee4f3"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "84ca0709-e5ce-490c-b56c-3860d9825289",
|
||||
"messageId": "msg_e945a952-5733-476f-90d0-b2bfa125d9be",
|
||||
"fileId": "6e4c958c-adea-4ce6-aab7-aea912bf19ec",
|
||||
"fileName": "structured_content_4.json",
|
||||
"fileSize": 1983,
|
||||
"mimeType": "application/json",
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 5,
|
||||
"actionId": "action_9608f071-b799-419a-b396-8f8ffe9ee4f3"
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation",
|
||||
"title": "Memo Summary"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Summary",
|
||||
"filename": "memo_summary.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_1",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Memo Summary"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_1",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The memo, dated October 10, 2023, is addressed to all employees from management and serves as a placeholder for future content. It outlines the structure and format for upcoming communications and emphasizes the importance of reviewing this structure to meet organizational needs."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_1",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Purpose: The memo is a template for future communications, seeking feedback on its structure and format.",
|
||||
"Content Structure: Includes an introduction, detailed analysis, and conclusion with recommendations.",
|
||||
"Call to Action: Employees are encouraged to contact management for more information and provide feedback."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_2",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The memo highlights the importance of employee input and collaboration in refining communication tools within the organization."
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
19
logs/debug/messages/20251127-114309-479_m_1_1_0/message.json
Normal file
19
logs/debug/messages/20251127-114309-479_m_1_1_0/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_c7cd6b0f-1811-4e5b-a8b9-5899a2c816a9",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "🎯 **Task 1**\n\n✅ The content validation indicates that the objective is not fully met due to incomplete summaries and inadequate document sizes, requiring further work to ensure comprehensiveness and quality.\n📊 Score 5.0/10",
|
||||
"role": "assistant",
|
||||
"status": "step",
|
||||
"sequenceNr": 9,
|
||||
"publishedAt": 1764243789.1994853,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 1,
|
||||
"actionNumber": 0,
|
||||
"documentsLabel": "task_1_completion",
|
||||
"actionId": null,
|
||||
"actionMethod": null,
|
||||
"actionName": null,
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
🎯 **Task 1**
|
||||
|
||||
✅ The content validation indicates that the objective is not fully met due to incomplete summaries and inadequate document sizes, requiring further work to ensure comprehensiveness and quality.
|
||||
📊 Score 5.0/10
|
||||
19
logs/debug/messages/20251127-114310-696_m_1_0_0/message.json
Normal file
19
logs/debug/messages/20251127-114310-696_m_1_0_0/message.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "msg_abbfe2bb-4fef-46d4-9927-f01282d03673",
|
||||
"workflowId": "c6d18dcc-937a-4112-9596-9eedc5a45d6a",
|
||||
"parentMessageId": null,
|
||||
"message": "Workflow completed.\n\nProcessed 1 user inputs and generated 8 responses.\nAll tasks completed successfully.",
|
||||
"role": "assistant",
|
||||
"status": "last",
|
||||
"sequenceNr": 10,
|
||||
"publishedAt": 1764243790.4648964,
|
||||
"roundNumber": 1,
|
||||
"taskNumber": 0,
|
||||
"actionNumber": 0,
|
||||
"documentsLabel": "workflow_feedback",
|
||||
"actionId": null,
|
||||
"actionMethod": null,
|
||||
"actionName": null,
|
||||
"success": null,
|
||||
"documents": []
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Workflow completed.
|
||||
|
||||
Processed 1 user inputs and generated 8 responses.
|
||||
All tasks completed successfully.
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
You are an input analyzer. From the user's message, perform ALL of the following in one pass:
|
||||
1) detectedLanguage: detect ISO 639-1 language code (e.g., de, en).
|
||||
2) normalizedRequest: full, explicit restatement of the user's request in the detected language; do NOT summarize; preserve ALL constraints and details.
|
||||
3) intent: concise single-paragraph core request in the detected language for high-level routing.
|
||||
4) contextItems: supportive data blocks to attach as separate documents if significantly larger than the intent (large literal content, long lists/tables, code/JSON blocks, transcripts, CSV fragments, detailed specs). Keep URLs in the intent unless they embed large pasted content.
|
||||
|
||||
Rules:
|
||||
- If total content (intent + data) is < 10% of model max tokens, do not extract; return empty contextItems and keep intent compact and self-contained.
|
||||
- If content exceeds that threshold, move bulky parts into contextItems; keep intent short and clear.
|
||||
- Preserve critical references (URLs, filenames) in intent.
|
||||
- Normalize to the primary detected language if mixed-language.
|
||||
|
||||
Return ONLY JSON (no markdown) with this shape:
|
||||
{
|
||||
"detectedLanguage": "de|en|fr|it|...",
|
||||
"normalizedRequest": "Full explicit instruction in detected language",
|
||||
"intent": "Concise normalized request...",
|
||||
"contextItems": [
|
||||
{
|
||||
"title": "User context 1",
|
||||
"mimeType": "text/plain",
|
||||
"content": "Full extracted content block here"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
User message:
|
||||
'test'
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
```json
|
||||
{
|
||||
"detectedLanguage": "en",
|
||||
"normalizedRequest": "Test",
|
||||
"intent": "Test",
|
||||
"contextItems": []
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
You are an intent analyzer. Analyze the user's request to understand what they want delivered.
|
||||
|
||||
USER REQUEST: 'Test'
|
||||
|
||||
CONTEXT: None
|
||||
|
||||
Analyze the user's intent and determine:
|
||||
1. What type of data/content they want (numbers, text, documents, analysis, code, etc.)
|
||||
2. What file format(s) they expect - provide matching file format extensions list
|
||||
- If multiple formats requested, list all of them (e.g., ["xlsx", "pdf"])
|
||||
- If format is unclear or not specified, use empty list []
|
||||
3. What quality requirements they have (accuracy, completeness)
|
||||
4. What specific success criteria define completion
|
||||
5. What language the user is communicating in (detect from the user request)
|
||||
|
||||
CRITICAL: Respond with ONLY the JSON object below. Do not include any explanatory text, analysis, or other content before or after the JSON.
|
||||
|
||||
{
|
||||
"primaryGoal": "The main objective the user wants to achieve",
|
||||
"dataType": "numbers|text|documents|analysis|code|unknown",
|
||||
"expectedFormats": ["pdf", "docx", "xlsx", "txt", "json", "csv", "html", "md"],
|
||||
"qualityRequirements": {
|
||||
"accuracyThreshold": 0.0-1.0,
|
||||
"completenessThreshold": 0.0-1.0
|
||||
},
|
||||
"successCriteria": ["specific criterion 1", "specific criterion 2"],
|
||||
"languageUserDetected": "en",
|
||||
"confidenceScore": 0.0-1.0
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
```json
|
||||
{
|
||||
"primaryGoal": "The main objective the user wants to achieve",
|
||||
"dataType": "unknown",
|
||||
"expectedFormats": [],
|
||||
"qualityRequirements": {
|
||||
"accuracyThreshold": 0.0,
|
||||
"completenessThreshold": 0.0
|
||||
},
|
||||
"successCriteria": [],
|
||||
"languageUserDetected": "en",
|
||||
"confidenceScore": 0.1
|
||||
}
|
||||
```
|
||||
100
logs/debug/prompts/20251127-113951-047-taskplan_prompt.txt
Normal file
100
logs/debug/prompts/20251127-113951-047-taskplan_prompt.txt
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# Task Planning
|
||||
|
||||
Break down user requests into logical, executable task steps.
|
||||
|
||||
**IMPORTANT**: If the user asks for ONE complete business objective, create ONLY ONE task that accomplishes the entire objective. Do NOT split it into multiple micro-tasks.
|
||||
|
||||
## 📋 Context
|
||||
|
||||
### User Request
|
||||
The main objective the user wants to achieve
|
||||
|
||||
### Available Documents
|
||||
0 documents available from previous tasks
|
||||
|
||||
### Previous Workflow Rounds
|
||||
Available documents: 0
|
||||
|
||||
## 📝 Task Planning Rules
|
||||
|
||||
### Strategic Task Grouping
|
||||
- **GROUP RELATED ACTIONS** - Combine all actions for the same business topic into ONE task
|
||||
- **ONE TOPIC PER TASK** - Each task should handle one complete business objective
|
||||
- **HIGH-LEVEL FOCUS** - Plan strategic outcomes, not implementation steps
|
||||
- **AVOID MICRO-TASKS** - Don't create separate tasks for each small action
|
||||
- **CRITICAL**: If the user asks for ONE thing (like "analyse document list and produce summary"), create ONLY ONE task that does the complete job
|
||||
|
||||
### Task Grouping Examples
|
||||
- **Research + Analysis + Report** → ONE task: "Web research report"
|
||||
- **Data Collection + Processing + Visualization** → ONE task: "Collect and present data"
|
||||
- **Document splitting** (analyze + extract + create files) → ONE task: "Split document into separate files"
|
||||
- **Different topics** (email + flowers) → SEPARATE tasks: "Send formal email..." + "Order flowers from Fleurop for delivery to 123 Main St, include card message"
|
||||
|
||||
### Common Single-Task Scenarios
|
||||
- **"Split document into sections"** → ONE task: "Split document into separate files"
|
||||
- **"Extract data and create report"** → ONE task: "Extract data and create report"
|
||||
- **"Analyze and summarize document"** → ONE task: "Analyze and summarize document"
|
||||
- **"Convert file to different format"** → ONE task: "Convert file to different format"
|
||||
|
||||
### Retry Handling
|
||||
- **If retry request**: Analyze previous rounds to understand what failed
|
||||
- **Learn from mistakes**: Improve the plan based on previous failures
|
||||
|
||||
## 📊 Required JSON Structure
|
||||
|
||||
```json
|
||||
{{
|
||||
"overview": "Brief description of the overall plan",
|
||||
"userMessage": "User-friendly message explaining the task plan in language 'en'",
|
||||
"tasks": [
|
||||
{{
|
||||
"id": "task_1",
|
||||
"objective": "Clear business objective focusing on what to deliver",
|
||||
"dependencies": ["task_0"],
|
||||
"successCriteria": ["measurable criteria 1", "measurable criteria 2"],
|
||||
"estimatedComplexity": "low|medium|high",
|
||||
"userMessage": "What this task will accomplish in language 'en'",
|
||||
"expectedFormats": ["pdf", "docx", "xlsx", "txt", "json", "csv", "html", "md",...]
|
||||
}}
|
||||
],
|
||||
}}
|
||||
```
|
||||
|
||||
## 🎯 Task Structure Guidelines
|
||||
|
||||
### Task ID Format
|
||||
- Use sequential numbering: `task_1`, `task_2`, `task_3`
|
||||
- Keep IDs simple and clear
|
||||
|
||||
### Objective Writing
|
||||
- **Be VERY SPECIFIC** - Include exact details needed for action planning
|
||||
- **Include all requirements** - recipient, attachments, format, recipients, etc.
|
||||
- **State the complete deliverable** - What exactly will be produced
|
||||
- **Include context and constraints** - When, where, how, with what
|
||||
- **Make it actionable** - Clear enough to plan specific actions
|
||||
|
||||
### Specific Objective Examples
|
||||
- **Good**: "Send formal email to ceo and board of directors with annual report as attachment"
|
||||
- **Bad**: "Handle email communication"
|
||||
- **Good**: "Order flowers from Fleurop for delivery to 123 Main St, include card message 'Happy Birthday', deliver on March 15th"
|
||||
- **Bad**: "Order flowers"
|
||||
|
||||
### Action Planning Requirements
|
||||
- **Include all necessary details** - The objective must contain everything needed to plan actions
|
||||
- **Specify recipients and destinations** - Who should receive what
|
||||
- **Include file names and formats** - What documents to use/create
|
||||
- **State timing and deadlines** - When things need to be done
|
||||
- **Include context and constraints** - Any special requirements or limitations
|
||||
|
||||
### Success Criteria
|
||||
- **Make them measurable** - specific, quantifiable outcomes
|
||||
- **Focus on deliverables** - what the user will receive
|
||||
- **Keep criteria realistic** - achievable within the task scope
|
||||
- **Include all related actions** - success means completing the entire business objective
|
||||
- **Be specific about requirements** - Include exact details like recipients, formats, deadlines
|
||||
- **State clear completion criteria** - How to know the task is fully done
|
||||
|
||||
### Complexity Estimation
|
||||
- **Low**: Simple, single-action tasks (1-2 actions)
|
||||
- **Medium**: Multi-action tasks for one topic (3-5 actions)
|
||||
- **High**: Complex strategic tasks (6+ actions)
|
||||
20
logs/debug/prompts/20251127-113957-048-taskplan_response.txt
Normal file
20
logs/debug/prompts/20251127-113957-048-taskplan_response.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
```json
|
||||
{
|
||||
"overview": "Plan a task to achieve the user's main business objective.",
|
||||
"userMessage": "We have created a task plan to accomplish your main business objective efficiently.",
|
||||
"tasks": [
|
||||
{
|
||||
"id": "task_1",
|
||||
"objective": "Complete the user's main business objective as specified in their request.",
|
||||
"dependencies": [],
|
||||
"successCriteria": [
|
||||
"The task fully addresses the user's main objective",
|
||||
"The deliverable meets the user's expectations and requirements"
|
||||
],
|
||||
"estimatedComplexity": "medium",
|
||||
"userMessage": "This task will accomplish the entire business objective you have requested.",
|
||||
"expectedFormats": ["pdf", "docx", "xlsx", "txt", "json", "csv", "html", "md"]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
87
logs/debug/prompts/20251127-113959-049-actionplan_prompt.txt
Normal file
87
logs/debug/prompts/20251127-113959-049-actionplan_prompt.txt
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
Select exactly one next action to advance the task incrementally.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
Test
|
||||
|
||||
OBJECTIVE:
|
||||
Complete the user's main business objective as specified in their request.
|
||||
|
||||
AVAILABLE_DOCUMENTS_SUMMARY:
|
||||
0 documents available from previous tasks
|
||||
|
||||
AVAILABLE_METHODS:
|
||||
{
|
||||
"ai.analyzeDocuments": "\n GENERAL:\n - Purpose: Analyze documents and find insights, patterns, trends, and key information.\n - Input requirements: documentList (required); optional analysisType, focus.\n - Output format: Analysis report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Document(s) to analyze.\n - analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.\n - focus (str, optional): Specific aspect to focus on (e.g., \"trends\", \"risks\", \"opportunities\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.compareDocuments": "\n GENERAL:\n - Purpose: Compare multiple documents and identify differences, similarities, and changes.\n - Input requirements: documentList (required, should contain 2+ documents); optional comparisonType, focus.\n - Output format: Comparison report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Two or more documents to compare.\n - comparisonType (str, optional): Type of comparison - differences, similarities, changes, full. Default: full.\n - focus (str, optional): Specific aspect to focus on (e.g., \"content\", \"structure\", \"data\", \"formatting\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.convertDocument": "\n GENERAL:\n - Purpose: Convert documents between different formats (PDF→Word, Excel→CSV, etc.).\n - Input requirements: documentList (required); targetFormat (required).\n - Output format: Document in target format.\n\n Parameters:\n - documentList (list, required): Document reference(s) to convert.\n - targetFormat (str, required): Target format extension (docx, pdf, xlsx, csv, txt, html, json, md, etc.).\n - preserveStructure (bool, optional): Whether to preserve document structure (headings, tables, etc.). Default: True.\n ",
|
||||
"ai.extractData": "\n GENERAL:\n - Purpose: Extract structured data from documents (key-value pairs, entities, facts, etc.).\n - Input requirements: documentList (required); optional dataStructure, fields.\n - Output format: JSON by default, or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract data from.\n - dataStructure (str, optional): Desired data structure - flat, nested, or list. Default: nested.\n - fields (list, optional): Specific fields/properties to extract (e.g., [\"name\", \"date\", \"amount\"]).\n - resultType (str, optional): Output format (json, csv, xlsx, etc.). Default: json.\n ",
|
||||
"ai.extractTables": "\n GENERAL:\n - Purpose: Extract tables from documents, preserving structure and data.\n - Input requirements: documentList (required); optional tableFormat.\n - Output format: JSON by default (structured table data), or CSV/XLSX if specified.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract tables from.\n - tableFormat (str, optional): Output format for tables - json, csv, or xlsx. Default: json.\n - includeHeaders (bool, optional): Include table headers. Default: True.\n ",
|
||||
"ai.generateChart": "\n GENERAL:\n - Purpose: Generate charts/graphs from data in documents or structured data.\n - Input requirements: documentList (required); optional chartType, title, labels.\n - Output format: Image (png or jpg).\n\n Parameters:\n - documentList (list, required): Documents containing data to visualize (CSV, Excel, JSON, etc.).\n - chartType (str, optional): Type of chart - bar, line, pie, scatter, area, etc. Default: bar.\n - title (str, optional): Chart title.\n - xAxisLabel (str, optional): X-axis label.\n - yAxisLabel (str, optional): Y-axis label.\n - resultType (str, optional): Image format (png or jpg). Default: png.\n ",
|
||||
"ai.generateDocument": "\n GENERAL:\n - Purpose: Generate documents from scratch or based on templates/inputs.\n - Input requirements: prompt or description (required); optional documentList (for templates/references).\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - prompt (str, required): Description of the document to generate.\n - documentList (list, optional): Template documents or reference documents to use as a guide.\n - documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.\n - resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.\n ",
|
||||
"ai.generateReport": "\n GENERAL:\n - Purpose: Generate comprehensive reports from input documents/data with analysis and insights.\n - Input requirements: documentList (optional, can generate from scratch); optional reportType, sections.\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - documentList (list, optional): Input documents/data to base the report on.\n - reportType (str, optional): Type of report - summary, analysis, executive, detailed. Default: analysis.\n - sections (list, optional): Specific sections to include (e.g., [\"introduction\", \"findings\", \"recommendations\"]).\n - title (str, optional): Report title.\n - resultType (str, optional): Output format (docx, pdf, md, etc.). Default: docx.\n ",
|
||||
"ai.process": "\n GENERAL:\n - Purpose: Universal AI document processing action - accepts MULTIPLE input documents in ANY format (docx, pdf, json, txt, xlsx, html, images, etc.) and processes them together with a prompt to produce MULTIPLE output documents in ANY specified format (via resultType). Use for document generation, format conversion, content transformation, analysis, summarization, translation, extraction, comparison, and any AI-powered document manipulation.\n - Input requirements: aiPrompt (required); optional documentList (can contain multiple documents in any format).\n - Output format: Multiple documents in the same format per call (via resultType: txt, json, pdf, docx, xlsx, pptx, png, jpg, etc.). The AI can generate multiple files based on the prompt (e.g., \"create separate documents for each section\"). Default: txt.\n - Key capabilities: Can process any number of input documents together, extract data from mixed formats, combine information, generate multiple output files, transform between formats, perform analysis/comparison/summarization on document sets.\n\n Parameters:\n - aiPrompt (str, required): Instruction for the AI describing what processing to perform.\n - documentList (list, optional): Document reference(s) in any format to use as input/context.\n - resultType (str, optional): Output file extension (txt, json, md, csv, xml, html, pdf, docx, xlsx, png, etc.). All output documents will use this format. Default: txt.\n ",
|
||||
"ai.summarizeDocument": "\n GENERAL:\n - Purpose: Summarize one or more documents, extracting key points and main ideas.\n - Input requirements: documentList (required); optional summaryLength, focus.\n - Output format: Text document with summary (default: txt, can be overridden with resultType).\n\n Parameters:\n - documentList (list, required): Document reference(s) to summarize.\n - summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.\n - focus (str, optional): Specific aspect to focus on in the summary (e.g., \"financial data\", \"key decisions\").\n - resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.\n ",
|
||||
"ai.translateDocument": "\n GENERAL:\n - Purpose: Translate documents to a target language while preserving formatting and structure.\n - Input requirements: documentList (required); targetLanguage (required).\n - Output format: Translated document in same format as input (default) or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to translate.\n - targetLanguage (str, required): Target language code or name (e.g., \"de\", \"German\", \"French\", \"es\").\n - sourceLanguage (str, optional): Source language if known (e.g., \"en\", \"English\"). If not provided, AI will detect.\n - preserveFormatting (bool, optional): Whether to preserve original formatting. Default: True.\n - resultType (str, optional): Output file extension. If not specified, uses same format as input.\n ",
|
||||
"ai.validateData": "\n GENERAL:\n - Purpose: Validate data quality, structure, completeness, and correctness in documents/data files.\n - Input requirements: documentList (required); optional validationRules, schema.\n - Output format: Validation report in JSON or text format (default: json).\n\n Parameters:\n - documentList (list, required): Documents/data files to validate.\n - validationRules (list, optional): Specific validation rules to check (e.g., [\"required_fields\", \"data_types\", \"ranges\"]).\n - schema (dict, optional): Expected data schema/structure to validate against.\n - resultType (str, optional): Output format (json, txt, md, etc.). Default: json.\n ",
|
||||
"ai.webResearch": "\n GENERAL:\n - Purpose: Web research with two-step process: search for URLs, then crawl content.\n - Input requirements: prompt (required); optional list(url), country, language, researchDepth.\n - Output format: JSON with research results including URLs and content.\n\n Parameters:\n - prompt (str, required): Natural language research instruction.\n - urlList (list, optional): Specific URLs to crawl, if needed.\n - country (str, optional): Two-digit country code (lowercase, e.g., ch, us, de).\n - language (str, optional): Language code (lowercase, e.g., de, en, fr).\n - researchDepth (str, optional): Research depth - fast, general, or deep. Default: general.\n ",
|
||||
"outlook.composeAndDraftEmailWithContext": "\n GENERAL:\n - Purpose: Compose email content using AI from context and optional documents, then create a draft.\n - Input requirements: connectionReference (required); to (required); context (required); optional documentList, cc, bcc, emailStyle, maxLength.\n - Output format: JSON confirmation with AI-generated draft metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - to (list, required): Recipient email addresses.\n - context (str, required): Detailled context for composing the email.\n - documentList (list, optional): Document references for context/attachments.\n - cc (list, optional): CC recipients.\n - bcc (list, optional): BCC recipients.\n - emailStyle (str, optional): formal | casual | business. Default: business.\n - maxLength (int, optional): Maximum length for generated content. Default: 1000.\n ",
|
||||
"outlook.readEmails": "\n GENERAL:\n - Purpose: Read emails and metadata from a mailbox folder.\n - Input requirements: connectionReference (required); optional folder, limit, filter, outputMimeType.\n - Output format: JSON with emails and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - folder (str, optional): Folder to read from. Default: Inbox.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - filter (str, optional): Sender, query operators, or subject text.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.searchEmails": "\n GENERAL:\n - Purpose: Search emails by query and return matching items with metadata.\n - Input requirements: connectionReference (required); query (required); optional folder, limit, outputMimeType.\n - Output format: JSON with search results and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - query (str, required): Search expression.\n - folder (str, optional): Folder scope or All. Default: All.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.sendDraftEmail": "\n GENERAL:\n - Purpose: Send draft email(s) using draft email JSON document(s) from action outlook.composeAndDraftEmailWithContext.\n - Input requirements: connectionReference (required); documentList with draft email JSON documents (required).\n - Output format: JSON confirmation with sent mail metadata for all emails.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - documentList (list, required): Document reference(s) to draft emails in JSON format (outputs from outlook.composeAndDraftEmailWithContext function).\n ",
|
||||
"sharepoint.findDocumentPath": "\n GENERAL:\n - Purpose: Find documents and folders by name/path across sites.\n - Input requirements: connectionReference (required); searchQuery (required); optional site, maxResults.\n - Output format: JSON with found items and paths.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - site (str, optional): Site hint.\n - searchQuery (str, required): Search terms or path.\n - maxResults (int, optional): Maximum items to return. Default: 100.\n ",
|
||||
"sharepoint.listDocuments": "\n GENERAL:\n - Purpose: List documents and folders in SharePoint paths across sites.\n - Input requirements: connectionReference (required); optional pathObject or pathQuery; includeSubfolders.\n - Output format: JSON with folder items and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Path query if no pathObject.\n - includeSubfolders (bool, optional): Include one level of subfolders. Default: False.\n ",
|
||||
"sharepoint.readDocuments": "\n GENERAL:\n - Purpose: Read documents from SharePoint and extract content/metadata.\n - Input requirements: connectionReference (required); optional documentList, pathObject, or pathQuery; includeMetadata.\n - Output format: Standardized ActionDocument format (documentName, documentData, mimeType).\n - Binary files (PDFs, etc.) are Base64-encoded in documentData.\n - Text files are stored as plain text in documentData.\n - Returns ActionResult with documents list for template processing.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result (from findDocumentPath).\n - documentList (list, optional): Document list reference(s) to read (backward compatibility).\n - pathQuery (str, optional): Path query if no pathObject (backward compatibility).\n - includeMetadata (bool, optional): Include metadata. Default: True.\n \n Returns:\n - ActionResult with documents: List[ActionDocument] where each ActionDocument contains:\n - documentName: File name\n - documentData: Base64-encoded content (binary files) or plain text (text files)\n - mimeType: MIME type (e.g., application/pdf, text/plain)\n ",
|
||||
"sharepoint.uploadDocument": "\n GENERAL:\n - Purpose: Upload documents to SharePoint. Only to choose this action with a connectionReference\n - Input requirements: connectionReference (required); documentList (required); optional pathObject or pathQuery.\n - Output format: JSON with upload status and file info.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Upload target path if no pathObject.\n - documentList (list, required): Document reference(s) to upload. File names are taken from the documents.\n "
|
||||
}
|
||||
|
||||
WORKFLOW_HISTORY (reverse-chronological, enriched):
|
||||
Available documents: 0
|
||||
|
||||
AVAILABLE_DOCUMENTS_INDEX:
|
||||
|
||||
NO DOCUMENTS AVAILABLE - This workflow has no documents to process.
|
||||
|
||||
|
||||
AVAILABLE_CONNECTIONS_INDEX:
|
||||
No connections available
|
||||
|
||||
LEARNING-BASED GUIDANCE:
|
||||
No previous failures detected. Proceed with standard approach.
|
||||
|
||||
FAILURE ANALYSIS:
|
||||
{}
|
||||
|
||||
ESCALATION LEVEL: low
|
||||
|
||||
REPLY: Return ONLY a JSON object with the following structure (no comments, no extra text). The chosen action MUST:
|
||||
- be the next logical incremental step toward fulfilling the objective
|
||||
- not attempt to complete the entire objective in one step
|
||||
- if producing files, target exactly one output format for this step
|
||||
- reference ONLY existing document IDs/labels from AVAILABLE_DOCUMENTS_INDEX
|
||||
- learn from previous validation feedback and avoid repeated mistakes
|
||||
{{
|
||||
"action": "method.action_name",
|
||||
"actionObjective": "...",
|
||||
"learnings": ["..."],
|
||||
"requiredInputDocuments": ["docList:..."],
|
||||
"requiredConnection": "connection:..." | null,
|
||||
"parametersContext": "concise text that Stage 2 will use to set business parameters"
|
||||
}}
|
||||
|
||||
EXAMPLE how to assign references from AVAILABLE_DOCUMENTS_INDEX and AVAILABLE_CONNECTIONS_INDEX:
|
||||
"requiredInputDocuments": ["docList:msg_47a7a578-e8f2-4ba8-ac66-0dbff40605e0:round8_task1_action1_results","docItem:5d8b7aee-b546-4487-b6a8-835c86f7b186:AI_Generated_Document_20251006-104256.docx"],
|
||||
"requiredConnection": "connection:msft:p.motsch@valueon.ch",
|
||||
|
||||
RULES:
|
||||
1. Use EXACT action names from AVAILABLE_METHODS
|
||||
2. Do NOT output a "parameters" object
|
||||
3. parametersContext must be short and sufficient for Stage 2
|
||||
4. Return ONLY JSON - no markdown, no explanations
|
||||
5. For requiredInputDocuments, use ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (docList:... or docItem:...)
|
||||
- DO NOT invent or modify Message IDs
|
||||
- DO NOT create new references
|
||||
- Copy references EXACTLY as shown in AVAILABLE_DOCUMENTS_INDEX
|
||||
6. For requiredConnection, use ONLY an exact label from AVAILABLE_CONNECTIONS_INDEX
|
||||
7. Plan incrementally: if the overall intent needs multiple output formats (e.g., CSV and HTML), choose one format in this step and leave the other(s) for subsequent steps
|
||||
8. CRITICAL: Learn from previous validation feedback - avoid repeating the same mistakes
|
||||
9. If previous attempts failed, consider alternative approaches or more specific parameters
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"action": "ai.generateDocument",
|
||||
"actionObjective": "Generate a test document based on the provided context.",
|
||||
"learnings": ["No documents are available, so generate a document from scratch."],
|
||||
"requiredInputDocuments": [],
|
||||
"requiredConnection": null,
|
||||
"parametersContext": "Generate a document titled 'Test Document' with placeholder content."
|
||||
}
|
||||
```
|
||||
62
logs/debug/prompts/20251127-114003-051-paramplan_prompt.txt
Normal file
62
logs/debug/prompts/20251127-114003-051-paramplan_prompt.txt
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
You are a parameter generator. Set the parameters for this specific action.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
-----------------
|
||||
Test
|
||||
-----------------
|
||||
|
||||
THIS ACTION'S SPECIFIC OBJECTIVE:
|
||||
-----------------
|
||||
Generate a test document based on the provided context.
|
||||
-----------------
|
||||
|
||||
SELECTED_ACTION:
|
||||
ai.generateDocument
|
||||
|
||||
LEARNING-BASED PARAMETER GUIDANCE:
|
||||
No previous parameter failures. Use standard parameter values.
|
||||
|
||||
ATTEMPT NUMBER: 1
|
||||
|
||||
PREVIOUS FAILURE ANALYSIS:
|
||||
{
|
||||
"hasFailures": false
|
||||
}
|
||||
|
||||
REPLY (ONLY JSON):
|
||||
{{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {{
|
||||
"paramName": "value"
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
CONTEXT FOR PARAMETER VALUES:
|
||||
-----------------
|
||||
Generate a document titled 'Test Document' with placeholder content.
|
||||
-----------------
|
||||
|
||||
LEARNINGS (from prior attempts, if any):
|
||||
- No documents are available, so generate a document from scratch.
|
||||
|
||||
REQUIRED PARAMETERS FOR THIS ACTION (use these exact parameter names):
|
||||
- prompt (str, required): Description of the document to generate.
|
||||
- documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.
|
||||
- resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.
|
||||
|
||||
INSTRUCTIONS:
|
||||
- Use ONLY the parameter names listed in section REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Fill in appropriate values based on the OVERALL TASK CONTEXT and THIS ACTION'S SPECIFIC OBJECTIVE
|
||||
- Consider the overall task context when setting parameter values to ensure they align with the complete user request
|
||||
- Do NOT invent new parameters
|
||||
- Do NOT include: documentList, connectionReference, history, documents, connections
|
||||
- CRITICAL: Follow the learning-based parameter guidance above
|
||||
- Learn from previous validation failures and adjust parameters accordingly
|
||||
|
||||
RULES:
|
||||
- Return ONLY JSON (no markdown, no prose)
|
||||
- Use ONLY the exact parameter names listed in REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Do NOT add any parameters not listed above
|
||||
- Do NOT add nested objects or custom fields
|
||||
- Apply learning insights to avoid repeated parameter mistakes
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {
|
||||
"prompt": "Generate a document titled 'Test Document' with placeholder content.",
|
||||
"documentType": "memo",
|
||||
"resultType": "docx"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
User request: "Generate a document based on the following requirements: Generate a document titled 'Test Document' with placeholder content. Document type: memo. Create a professional, well-structured document with appropriate formatting and organization."
|
||||
|
||||
Generate a VALID JSON response for the user request. The template below shows ONLY the structure pattern - it is NOT existing content.
|
||||
|
||||
JSON structure template:
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Generated Document",
|
||||
"filename": "document.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_example",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Heading Text"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_example",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "Paragraph text content"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_example",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": ["Item 1", "Item 2"]
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_table_example",
|
||||
"content_type": "table",
|
||||
"elements": [
|
||||
{
|
||||
"headers": ["Column 1", "Column 2"],
|
||||
"rows": [
|
||||
["Row 1 Col 1", "Row 1 Col 2"],
|
||||
["Row 2 Col 1", "Row 2 Col 2"]
|
||||
],
|
||||
"caption": "Table caption"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_code_example",
|
||||
"content_type": "code_block",
|
||||
"elements": [
|
||||
{
|
||||
"code": "function example() { return true; }",
|
||||
"language": "javascript"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Instructions:
|
||||
- Start with {"metadata": ...} — return COMPLETE, STRICT JSON.
|
||||
- Return ONLY valid JSON (strict). No comments. No trailing commas. Use double quotes.
|
||||
- Do NOT reuse example section IDs; create your own.
|
||||
- Generate complete content based on the user request. Do NOT just give an instruction or comments. Deliver the complete response.
|
||||
- IMPORTANT: Set a meaningful "filename" in each document with appropriate file extension (e.g., "prime_numbers.txt", "report.docx", "data.json"). The filename should reflect the content and task objective.
|
||||
- When the request is fully satisfied, add "complete_response": true at root level.
|
||||
- Output JSON only; no markdown fences or extra text.
|
||||
|
||||
Generate your complete response starting from {"metadata": ...}:
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Test Document",
|
||||
"filename": "test_document_memo.docx",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_1",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Memo"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_heading_2",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 2, "text": "To: All Employees"}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_heading_3",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 2, "text": "From: Management"}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_heading_4",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 2, "text": "Date: October 10, 2023"}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_heading_5",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 2, "text": "Subject: Placeholder Content"}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_1",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "This memo serves as a placeholder for future content. Please review the structure and format to ensure it meets your needs."}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_1",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Introduction to the topic",
|
||||
"Detailed analysis",
|
||||
"Conclusion and recommendations"
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_2",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "For further information, please contact the management team. We appreciate your attention to this matter and look forward to your feedback."}
|
||||
],
|
||||
"order": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"complete_response": true
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Test Document",
|
||||
"filename": "test_document_memo.docx",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_1",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Memo"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_heading_2",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "To: All Employees"
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_heading_3",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "From: Management"
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_heading_4",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "Date: October 10, 2023"
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_heading_5",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 2,
|
||||
"text": "Subject: Placeholder Content"
|
||||
}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_1",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "This memo serves as a placeholder for future content. Please review the structure and format to ensure it meets your needs."
|
||||
}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_1",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Introduction to the topic",
|
||||
"Detailed analysis",
|
||||
"Conclusion and recommendations"
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_2",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "For further information, please contact the management team. We appreciate your attention to this matter and look forward to your feedback."
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
You are a professional document styling expert. Generate a complete JSON styling configuration for DOCX documents.
|
||||
|
||||
Use this schema as a template and customize the values for professional document styling:
|
||||
|
||||
{
|
||||
"title": {
|
||||
"font_size": 24,
|
||||
"color": "#1F4E79",
|
||||
"bold": true,
|
||||
"align": "center"
|
||||
},
|
||||
"heading1": {
|
||||
"font_size": 18,
|
||||
"color": "#2F2F2F",
|
||||
"bold": true,
|
||||
"align": "left"
|
||||
},
|
||||
"heading2": {
|
||||
"font_size": 14,
|
||||
"color": "#4F4F4F",
|
||||
"bold": true,
|
||||
"align": "left"
|
||||
},
|
||||
"paragraph": {
|
||||
"font_size": 11,
|
||||
"color": "#2F2F2F",
|
||||
"bold": false,
|
||||
"align": "left"
|
||||
},
|
||||
"table_header": {
|
||||
"background": "#4F4F4F",
|
||||
"text_color": "#FFFFFF",
|
||||
"bold": true,
|
||||
"align": "center"
|
||||
},
|
||||
"table_cell": {
|
||||
"background": "#FFFFFF",
|
||||
"text_color": "#2F2F2F",
|
||||
"bold": false,
|
||||
"align": "left"
|
||||
},
|
||||
"table_border": {
|
||||
"style": "horizontal_only",
|
||||
"color": "#000000",
|
||||
"thickness": "thin"
|
||||
},
|
||||
"bullet_list": {
|
||||
"font_size": 11,
|
||||
"color": "#2F2F2F",
|
||||
"indent": 20
|
||||
},
|
||||
"code_block": {
|
||||
"font": "Courier New",
|
||||
"font_size": 10,
|
||||
"color": "#2F2F2F",
|
||||
"background": "#F5F5F5"
|
||||
}
|
||||
}
|
||||
|
||||
Requirements:
|
||||
- Return ONLY the complete JSON object (no markdown, no explanations)
|
||||
- Customize colors, fonts, and spacing for professional appearance
|
||||
- Ensure all objects are properly closed with closing braces
|
||||
- Make the styling modern and professional
|
||||
|
||||
Return the complete JSON:
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
```json
|
||||
{
|
||||
"title": {
|
||||
"font_size": 26,
|
||||
"color": "#0A3D62",
|
||||
"bold": true,
|
||||
"align": "center"
|
||||
},
|
||||
"heading1": {
|
||||
"font_size": 20,
|
||||
"color": "#1B263B",
|
||||
"bold": true,
|
||||
"align": "left"
|
||||
},
|
||||
"heading2": {
|
||||
"font_size": 16,
|
||||
"color": "#3A506B",
|
||||
"bold": true,
|
||||
"align": "left"
|
||||
},
|
||||
"paragraph": {
|
||||
"font_size": 12,
|
||||
"color": "#1B263B",
|
||||
"bold": false,
|
||||
"align": "justify"
|
||||
},
|
||||
"table_header": {
|
||||
"background": "#1B263B",
|
||||
"text_color": "#FFFFFF",
|
||||
"bold": true,
|
||||
"align": "center"
|
||||
},
|
||||
"table_cell": {
|
||||
"background": "#F0F4F8",
|
||||
"text_color": "#1B263B",
|
||||
"bold": false,
|
||||
"align": "left"
|
||||
},
|
||||
"table_border": {
|
||||
"style": "all_borders",
|
||||
"color": "#1B263B",
|
||||
"thickness": "medium"
|
||||
},
|
||||
"bullet_list": {
|
||||
"font_size": 12,
|
||||
"color": "#1B263B",
|
||||
"indent": 25
|
||||
},
|
||||
"code_block": {
|
||||
"font": "Courier New",
|
||||
"font_size": 11,
|
||||
"color": "#1B263B",
|
||||
"background": "#E8E8E8"
|
||||
}
|
||||
}
|
||||
```
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,57 @@
|
|||
TASK VALIDATION
|
||||
|
||||
TASK OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
EXPECTED DATA TYPE: unknown
|
||||
EXPECTED FORMATS: ['pdf', 'docx', 'xlsx', 'txt', 'json', 'csv', 'html', 'md']
|
||||
SUCCESS CRITERIA (2 items): ["The task fully addresses the user's main objective", "The deliverable meets the user's expectations and requirements"]
|
||||
ACTION THAT CREATED DOCUMENTS: ai.generateDocument
|
||||
|
||||
VALIDATION RULES:
|
||||
IMPORTANT: You only have document METADATA (filename, format, size, mimeType) - NOT document content.
|
||||
Validate based on metadata only:
|
||||
1. Check if filenames are APPROXIMATELY meaningful (generic names like "generated.docx" are acceptable if format matches)
|
||||
2. Check if delivered formats are compatible with expected format
|
||||
3. Check if document sizes are reasonable for the task objective
|
||||
4. Assess if filename and size combination suggests correct data type
|
||||
5. Rate overall quality (0.0-1.0) based on metadata indicators, with format matching being the most important
|
||||
6. Identify specific gaps based on what the user requested (infer from filename, size, format - NOT content)
|
||||
|
||||
OUTPUT FORMAT - JSON ONLY (no prose):
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.0,
|
||||
"dataTypeMatch": false,
|
||||
"formatMatch": false,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false][false],
|
||||
"gapAnalysis": "Describe what is missing or incorrect based on filename, size, format metadata",
|
||||
"improvementSuggestions": ["General action to improve overall result"],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "document.ext",
|
||||
"issues": ["Issue inferred from metadata (e.g., filename doesn't match task, size too small for objective)"],
|
||||
"suggestions": ["Specific fix based on metadata analysis"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Field explanations:
|
||||
- "improvementSuggestions": Overall actions to improve the entire result (general, high-level)
|
||||
- "validationDetails[].suggestions": Specific fixes for each document's individual issues (document-specific, detailed)
|
||||
- Do NOT use prefixes like "NEXT STEP:" - describe actions directly
|
||||
|
||||
DELIVERED DOCUMENTS (2 items):
|
||||
[
|
||||
{
|
||||
"name": "test_document_memo.docx",
|
||||
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"format": "docx",
|
||||
"size": "48.1 KB"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"format": "json",
|
||||
"size": "1.5 KB"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
```json
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.6,
|
||||
"dataTypeMatch": false,
|
||||
"formatMatch": true,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false, false],
|
||||
"gapAnalysis": "The filenames suggest different types of content ('memo' and 'structured content'), which may not align with a single main business objective. The size of the JSON file is quite small, which might indicate insufficient data for a structured content task.",
|
||||
"improvementSuggestions": ["Ensure the filenames and formats align with a singular business objective and expected data type."],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "test_document_memo.docx",
|
||||
"issues": ["Filename suggests a memo, which may not align with the user's main business objective if it requires structured data."],
|
||||
"suggestions": ["Clarify the user's main objective to ensure the document type and content align with it."]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": ["The size of 1.5 KB is small for structured content, suggesting it may not be comprehensive."],
|
||||
"suggestions": ["Ensure the JSON file contains sufficient data to meet the user's expectations for structured content."]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
79
logs/debug/prompts/20251127-114031-061-refinement_prompt.txt
Normal file
79
logs/debug/prompts/20251127-114031-061-refinement_prompt.txt
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
TASK DECISION
|
||||
|
||||
OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
|
||||
DECISION RULES:
|
||||
1. "continue" = objective NOT fulfilled
|
||||
2. "stop" = objective fulfilled
|
||||
3. Return ONLY JSON - no other text
|
||||
|
||||
OUTPUT FORMAT (only JSON object to deliver):
|
||||
{{
|
||||
"decision": "continue",
|
||||
"reason": "Brief reason for decision"
|
||||
}}
|
||||
|
||||
OBSERVATION: {
|
||||
"success": true,
|
||||
"resultLabel": "round1_task1_action1_results",
|
||||
"documentsCount": 2,
|
||||
"previews": [
|
||||
{
|
||||
"name": "test_document_memo.docx",
|
||||
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"contentSize": "49252 characters"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"contentSize": "1526 characters"
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"contentValidation": {
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.6,
|
||||
"documentCount": 2,
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "test_document_memo.docx",
|
||||
"issues": [
|
||||
"Filename suggests a memo, which may not align with the user's main business objective if it requires structured data."
|
||||
],
|
||||
"suggestions": [
|
||||
"Clarify the user's main objective to ensure the document type and content align with it."
|
||||
]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": [
|
||||
"The size of 1.5 KB is small for structured content, suggesting it may not be comprehensive."
|
||||
],
|
||||
"suggestions": [
|
||||
"Ensure the JSON file contains sufficient data to meet the user's expectations for structured content."
|
||||
]
|
||||
}
|
||||
],
|
||||
"improvementSuggestions": [
|
||||
"Ensure the filenames and formats align with a singular business objective and expected data type."
|
||||
],
|
||||
"schemaCompliant": true,
|
||||
"originalType": "json",
|
||||
"missingFields": []
|
||||
},
|
||||
"contentAnalysis": {}
|
||||
}
|
||||
|
||||
CONTENT VALIDATION:
|
||||
Overall Success: False
|
||||
Quality Score: 0.60
|
||||
Improvement Suggestions: Ensure the filenames and formats align with a singular business objective and expected data type.
|
||||
|
||||
PROGRESS STATE:
|
||||
Completed Objectives: 0
|
||||
Partial Achievements: 1
|
||||
Failed Attempts: 0
|
||||
Current Phase: partial
|
||||
Next Action Suggestions: Build on partial achievements, Ensure the filenames and formats align with a singular business objective and expected data type.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
```json
|
||||
{
|
||||
"decision": "continue",
|
||||
"reason": "The content validation indicates issues with alignment to the user's main business objective and insufficient data in the JSON file. The objective is not fully met."
|
||||
}
|
||||
```
|
||||
92
logs/debug/prompts/20251127-114033-063-actionplan_prompt.txt
Normal file
92
logs/debug/prompts/20251127-114033-063-actionplan_prompt.txt
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
Select exactly one next action to advance the task incrementally.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
Test
|
||||
|
||||
OBJECTIVE:
|
||||
Complete the user's main business objective as specified in their request.
|
||||
|
||||
AVAILABLE_DOCUMENTS_SUMMARY:
|
||||
2 documents available from previous tasks
|
||||
|
||||
AVAILABLE_METHODS:
|
||||
{
|
||||
"ai.analyzeDocuments": "\n GENERAL:\n - Purpose: Analyze documents and find insights, patterns, trends, and key information.\n - Input requirements: documentList (required); optional analysisType, focus.\n - Output format: Analysis report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Document(s) to analyze.\n - analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.\n - focus (str, optional): Specific aspect to focus on (e.g., \"trends\", \"risks\", \"opportunities\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.compareDocuments": "\n GENERAL:\n - Purpose: Compare multiple documents and identify differences, similarities, and changes.\n - Input requirements: documentList (required, should contain 2+ documents); optional comparisonType, focus.\n - Output format: Comparison report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Two or more documents to compare.\n - comparisonType (str, optional): Type of comparison - differences, similarities, changes, full. Default: full.\n - focus (str, optional): Specific aspect to focus on (e.g., \"content\", \"structure\", \"data\", \"formatting\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.convertDocument": "\n GENERAL:\n - Purpose: Convert documents between different formats (PDF→Word, Excel→CSV, etc.).\n - Input requirements: documentList (required); targetFormat (required).\n - Output format: Document in target format.\n\n Parameters:\n - documentList (list, required): Document reference(s) to convert.\n - targetFormat (str, required): Target format extension (docx, pdf, xlsx, csv, txt, html, json, md, etc.).\n - preserveStructure (bool, optional): Whether to preserve document structure (headings, tables, etc.). Default: True.\n ",
|
||||
"ai.extractData": "\n GENERAL:\n - Purpose: Extract structured data from documents (key-value pairs, entities, facts, etc.).\n - Input requirements: documentList (required); optional dataStructure, fields.\n - Output format: JSON by default, or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract data from.\n - dataStructure (str, optional): Desired data structure - flat, nested, or list. Default: nested.\n - fields (list, optional): Specific fields/properties to extract (e.g., [\"name\", \"date\", \"amount\"]).\n - resultType (str, optional): Output format (json, csv, xlsx, etc.). Default: json.\n ",
|
||||
"ai.extractTables": "\n GENERAL:\n - Purpose: Extract tables from documents, preserving structure and data.\n - Input requirements: documentList (required); optional tableFormat.\n - Output format: JSON by default (structured table data), or CSV/XLSX if specified.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract tables from.\n - tableFormat (str, optional): Output format for tables - json, csv, or xlsx. Default: json.\n - includeHeaders (bool, optional): Include table headers. Default: True.\n ",
|
||||
"ai.generateChart": "\n GENERAL:\n - Purpose: Generate charts/graphs from data in documents or structured data.\n - Input requirements: documentList (required); optional chartType, title, labels.\n - Output format: Image (png or jpg).\n\n Parameters:\n - documentList (list, required): Documents containing data to visualize (CSV, Excel, JSON, etc.).\n - chartType (str, optional): Type of chart - bar, line, pie, scatter, area, etc. Default: bar.\n - title (str, optional): Chart title.\n - xAxisLabel (str, optional): X-axis label.\n - yAxisLabel (str, optional): Y-axis label.\n - resultType (str, optional): Image format (png or jpg). Default: png.\n ",
|
||||
"ai.generateDocument": "\n GENERAL:\n - Purpose: Generate documents from scratch or based on templates/inputs.\n - Input requirements: prompt or description (required); optional documentList (for templates/references).\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - prompt (str, required): Description of the document to generate.\n - documentList (list, optional): Template documents or reference documents to use as a guide.\n - documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.\n - resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.\n ",
|
||||
"ai.generateReport": "\n GENERAL:\n - Purpose: Generate comprehensive reports from input documents/data with analysis and insights.\n - Input requirements: documentList (optional, can generate from scratch); optional reportType, sections.\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - documentList (list, optional): Input documents/data to base the report on.\n - reportType (str, optional): Type of report - summary, analysis, executive, detailed. Default: analysis.\n - sections (list, optional): Specific sections to include (e.g., [\"introduction\", \"findings\", \"recommendations\"]).\n - title (str, optional): Report title.\n - resultType (str, optional): Output format (docx, pdf, md, etc.). Default: docx.\n ",
|
||||
"ai.process": "\n GENERAL:\n - Purpose: Universal AI document processing action - accepts MULTIPLE input documents in ANY format (docx, pdf, json, txt, xlsx, html, images, etc.) and processes them together with a prompt to produce MULTIPLE output documents in ANY specified format (via resultType). Use for document generation, format conversion, content transformation, analysis, summarization, translation, extraction, comparison, and any AI-powered document manipulation.\n - Input requirements: aiPrompt (required); optional documentList (can contain multiple documents in any format).\n - Output format: Multiple documents in the same format per call (via resultType: txt, json, pdf, docx, xlsx, pptx, png, jpg, etc.). The AI can generate multiple files based on the prompt (e.g., \"create separate documents for each section\"). Default: txt.\n - Key capabilities: Can process any number of input documents together, extract data from mixed formats, combine information, generate multiple output files, transform between formats, perform analysis/comparison/summarization on document sets.\n\n Parameters:\n - aiPrompt (str, required): Instruction for the AI describing what processing to perform.\n - documentList (list, optional): Document reference(s) in any format to use as input/context.\n - resultType (str, optional): Output file extension (txt, json, md, csv, xml, html, pdf, docx, xlsx, png, etc.). All output documents will use this format. Default: txt.\n ",
|
||||
"ai.summarizeDocument": "\n GENERAL:\n - Purpose: Summarize one or more documents, extracting key points and main ideas.\n - Input requirements: documentList (required); optional summaryLength, focus.\n - Output format: Text document with summary (default: txt, can be overridden with resultType).\n\n Parameters:\n - documentList (list, required): Document reference(s) to summarize.\n - summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.\n - focus (str, optional): Specific aspect to focus on in the summary (e.g., \"financial data\", \"key decisions\").\n - resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.\n ",
|
||||
"ai.translateDocument": "\n GENERAL:\n - Purpose: Translate documents to a target language while preserving formatting and structure.\n - Input requirements: documentList (required); targetLanguage (required).\n - Output format: Translated document in same format as input (default) or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to translate.\n - targetLanguage (str, required): Target language code or name (e.g., \"de\", \"German\", \"French\", \"es\").\n - sourceLanguage (str, optional): Source language if known (e.g., \"en\", \"English\"). If not provided, AI will detect.\n - preserveFormatting (bool, optional): Whether to preserve original formatting. Default: True.\n - resultType (str, optional): Output file extension. If not specified, uses same format as input.\n ",
|
||||
"ai.validateData": "\n GENERAL:\n - Purpose: Validate data quality, structure, completeness, and correctness in documents/data files.\n - Input requirements: documentList (required); optional validationRules, schema.\n - Output format: Validation report in JSON or text format (default: json).\n\n Parameters:\n - documentList (list, required): Documents/data files to validate.\n - validationRules (list, optional): Specific validation rules to check (e.g., [\"required_fields\", \"data_types\", \"ranges\"]).\n - schema (dict, optional): Expected data schema/structure to validate against.\n - resultType (str, optional): Output format (json, txt, md, etc.). Default: json.\n ",
|
||||
"ai.webResearch": "\n GENERAL:\n - Purpose: Web research with two-step process: search for URLs, then crawl content.\n - Input requirements: prompt (required); optional list(url), country, language, researchDepth.\n - Output format: JSON with research results including URLs and content.\n\n Parameters:\n - prompt (str, required): Natural language research instruction.\n - urlList (list, optional): Specific URLs to crawl, if needed.\n - country (str, optional): Two-digit country code (lowercase, e.g., ch, us, de).\n - language (str, optional): Language code (lowercase, e.g., de, en, fr).\n - researchDepth (str, optional): Research depth - fast, general, or deep. Default: general.\n ",
|
||||
"outlook.composeAndDraftEmailWithContext": "\n GENERAL:\n - Purpose: Compose email content using AI from context and optional documents, then create a draft.\n - Input requirements: connectionReference (required); to (required); context (required); optional documentList, cc, bcc, emailStyle, maxLength.\n - Output format: JSON confirmation with AI-generated draft metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - to (list, required): Recipient email addresses.\n - context (str, required): Detailled context for composing the email.\n - documentList (list, optional): Document references for context/attachments.\n - cc (list, optional): CC recipients.\n - bcc (list, optional): BCC recipients.\n - emailStyle (str, optional): formal | casual | business. Default: business.\n - maxLength (int, optional): Maximum length for generated content. Default: 1000.\n ",
|
||||
"outlook.readEmails": "\n GENERAL:\n - Purpose: Read emails and metadata from a mailbox folder.\n - Input requirements: connectionReference (required); optional folder, limit, filter, outputMimeType.\n - Output format: JSON with emails and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - folder (str, optional): Folder to read from. Default: Inbox.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - filter (str, optional): Sender, query operators, or subject text.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.searchEmails": "\n GENERAL:\n - Purpose: Search emails by query and return matching items with metadata.\n - Input requirements: connectionReference (required); query (required); optional folder, limit, outputMimeType.\n - Output format: JSON with search results and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - query (str, required): Search expression.\n - folder (str, optional): Folder scope or All. Default: All.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.sendDraftEmail": "\n GENERAL:\n - Purpose: Send draft email(s) using draft email JSON document(s) from action outlook.composeAndDraftEmailWithContext.\n - Input requirements: connectionReference (required); documentList with draft email JSON documents (required).\n - Output format: JSON confirmation with sent mail metadata for all emails.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - documentList (list, required): Document reference(s) to draft emails in JSON format (outputs from outlook.composeAndDraftEmailWithContext function).\n ",
|
||||
"sharepoint.findDocumentPath": "\n GENERAL:\n - Purpose: Find documents and folders by name/path across sites.\n - Input requirements: connectionReference (required); searchQuery (required); optional site, maxResults.\n - Output format: JSON with found items and paths.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - site (str, optional): Site hint.\n - searchQuery (str, required): Search terms or path.\n - maxResults (int, optional): Maximum items to return. Default: 100.\n ",
|
||||
"sharepoint.listDocuments": "\n GENERAL:\n - Purpose: List documents and folders in SharePoint paths across sites.\n - Input requirements: connectionReference (required); optional pathObject or pathQuery; includeSubfolders.\n - Output format: JSON with folder items and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Path query if no pathObject.\n - includeSubfolders (bool, optional): Include one level of subfolders. Default: False.\n ",
|
||||
"sharepoint.readDocuments": "\n GENERAL:\n - Purpose: Read documents from SharePoint and extract content/metadata.\n - Input requirements: connectionReference (required); optional documentList, pathObject, or pathQuery; includeMetadata.\n - Output format: Standardized ActionDocument format (documentName, documentData, mimeType).\n - Binary files (PDFs, etc.) are Base64-encoded in documentData.\n - Text files are stored as plain text in documentData.\n - Returns ActionResult with documents list for template processing.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result (from findDocumentPath).\n - documentList (list, optional): Document list reference(s) to read (backward compatibility).\n - pathQuery (str, optional): Path query if no pathObject (backward compatibility).\n - includeMetadata (bool, optional): Include metadata. Default: True.\n \n Returns:\n - ActionResult with documents: List[ActionDocument] where each ActionDocument contains:\n - documentName: File name\n - documentData: Base64-encoded content (binary files) or plain text (text files)\n - mimeType: MIME type (e.g., application/pdf, text/plain)\n ",
|
||||
"sharepoint.uploadDocument": "\n GENERAL:\n - Purpose: Upload documents to SharePoint. Only to choose this action with a connectionReference\n - Input requirements: connectionReference (required); documentList (required); optional pathObject or pathQuery.\n - Output format: JSON with upload status and file info.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Upload target path if no pathObject.\n - documentList (list, required): Document reference(s) to upload. File names are taken from the documents.\n "
|
||||
}
|
||||
|
||||
WORKFLOW_HISTORY (reverse-chronological, enriched):
|
||||
- Round 1: 2 docs (test_document_memo.docx, structured_content.json) label='round1_task1_action1_results' | success=Unknown | msg='**Action 1 (ai.generateDocument)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
Available documents: 2
|
||||
|
||||
AVAILABLE_DOCUMENTS_INDEX:
|
||||
|
||||
Current round documents:
|
||||
- docList:round1_task1_action1_results contains:
|
||||
- docItem:08c7d2e7-e3ac-44c6-b305-2696f7de627a:test_document_memo.docx
|
||||
- docItem:da1fa51f-68d2-41f1-bc25-aaff26beaab7:structured_content.json
|
||||
|
||||
|
||||
|
||||
AVAILABLE_CONNECTIONS_INDEX:
|
||||
No connections available
|
||||
|
||||
LEARNING-BASED GUIDANCE:
|
||||
No previous failures detected. Proceed with standard approach.
|
||||
|
||||
FAILURE ANALYSIS:
|
||||
{}
|
||||
|
||||
ESCALATION LEVEL: low
|
||||
|
||||
REPLY: Return ONLY a JSON object with the following structure (no comments, no extra text). The chosen action MUST:
|
||||
- be the next logical incremental step toward fulfilling the objective
|
||||
- not attempt to complete the entire objective in one step
|
||||
- if producing files, target exactly one output format for this step
|
||||
- reference ONLY existing document IDs/labels from AVAILABLE_DOCUMENTS_INDEX
|
||||
- learn from previous validation feedback and avoid repeated mistakes
|
||||
{{
|
||||
"action": "method.action_name",
|
||||
"actionObjective": "...",
|
||||
"learnings": ["..."],
|
||||
"requiredInputDocuments": ["docList:..."],
|
||||
"requiredConnection": "connection:..." | null,
|
||||
"parametersContext": "concise text that Stage 2 will use to set business parameters"
|
||||
}}
|
||||
|
||||
EXAMPLE how to assign references from AVAILABLE_DOCUMENTS_INDEX and AVAILABLE_CONNECTIONS_INDEX:
|
||||
"requiredInputDocuments": ["docList:msg_47a7a578-e8f2-4ba8-ac66-0dbff40605e0:round8_task1_action1_results","docItem:5d8b7aee-b546-4487-b6a8-835c86f7b186:AI_Generated_Document_20251006-104256.docx"],
|
||||
"requiredConnection": "connection:msft:p.motsch@valueon.ch",
|
||||
|
||||
RULES:
|
||||
1. Use EXACT action names from AVAILABLE_METHODS
|
||||
2. Do NOT output a "parameters" object
|
||||
3. parametersContext must be short and sufficient for Stage 2
|
||||
4. Return ONLY JSON - no markdown, no explanations
|
||||
5. For requiredInputDocuments, use ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (docList:... or docItem:...)
|
||||
- DO NOT invent or modify Message IDs
|
||||
- DO NOT create new references
|
||||
- Copy references EXACTLY as shown in AVAILABLE_DOCUMENTS_INDEX
|
||||
6. For requiredConnection, use ONLY an exact label from AVAILABLE_CONNECTIONS_INDEX
|
||||
7. Plan incrementally: if the overall intent needs multiple output formats (e.g., CSV and HTML), choose one format in this step and leave the other(s) for subsequent steps
|
||||
8. CRITICAL: Learn from previous validation feedback - avoid repeating the same mistakes
|
||||
9. If previous attempts failed, consider alternative approaches or more specific parameters
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"action": "ai.analyzeDocuments",
|
||||
"actionObjective": "Analyze the available documents to find insights, patterns, trends, and key information.",
|
||||
"learnings": ["Focus on extracting key insights and patterns from the documents to aid in achieving the business objective."],
|
||||
"requiredInputDocuments": ["docList:round1_task1_action1_results"],
|
||||
"requiredConnection": null,
|
||||
"parametersContext": "Perform a general analysis on the provided documents to extract insights and key information."
|
||||
}
|
||||
```
|
||||
62
logs/debug/prompts/20251127-114038-065-paramplan_prompt.txt
Normal file
62
logs/debug/prompts/20251127-114038-065-paramplan_prompt.txt
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
You are a parameter generator. Set the parameters for this specific action.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
-----------------
|
||||
Test
|
||||
-----------------
|
||||
|
||||
THIS ACTION'S SPECIFIC OBJECTIVE:
|
||||
-----------------
|
||||
Analyze the available documents to find insights, patterns, trends, and key information.
|
||||
-----------------
|
||||
|
||||
SELECTED_ACTION:
|
||||
ai.analyzeDocuments
|
||||
|
||||
LEARNING-BASED PARAMETER GUIDANCE:
|
||||
No previous parameter failures. Use standard parameter values.
|
||||
|
||||
ATTEMPT NUMBER: 1
|
||||
|
||||
PREVIOUS FAILURE ANALYSIS:
|
||||
{
|
||||
"hasFailures": false
|
||||
}
|
||||
|
||||
REPLY (ONLY JSON):
|
||||
{{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {{
|
||||
"paramName": "value"
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
CONTEXT FOR PARAMETER VALUES:
|
||||
-----------------
|
||||
Perform a general analysis on the provided documents to extract insights and key information.
|
||||
-----------------
|
||||
|
||||
LEARNINGS (from prior attempts, if any):
|
||||
- Focus on extracting key insights and patterns from the documents to aid in achieving the business objective.
|
||||
|
||||
REQUIRED PARAMETERS FOR THIS ACTION (use these exact parameter names):
|
||||
- analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.
|
||||
- focus (str, optional): Specific aspect to focus on (e.g., "trends", "risks", "opportunities").
|
||||
- resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.
|
||||
|
||||
INSTRUCTIONS:
|
||||
- Use ONLY the parameter names listed in section REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Fill in appropriate values based on the OVERALL TASK CONTEXT and THIS ACTION'S SPECIFIC OBJECTIVE
|
||||
- Consider the overall task context when setting parameter values to ensure they align with the complete user request
|
||||
- Do NOT invent new parameters
|
||||
- Do NOT include: documentList, connectionReference, history, documents, connections
|
||||
- CRITICAL: Follow the learning-based parameter guidance above
|
||||
- Learn from previous validation failures and adjust parameters accordingly
|
||||
|
||||
RULES:
|
||||
- Return ONLY JSON (no markdown, no prose)
|
||||
- Use ONLY the exact parameter names listed in REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Do NOT add any parameters not listed above
|
||||
- Do NOT add nested objects or custom fields
|
||||
- Apply learning insights to avoid repeated parameter mistakes
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {
|
||||
"analysisType": "general",
|
||||
"focus": "insights",
|
||||
"resultType": "txt"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
### Analysis of the Provided Document
|
||||
|
||||
#### Overview
|
||||
The document provided is a memo that serves as a placeholder for future content. It is structured with standard memo components such as the recipient, sender, date, subject, and sections for introduction, detailed analysis, and conclusion. The document is intended to be reviewed for its structure and format.
|
||||
|
||||
#### Key Insights
|
||||
|
||||
1. **Structure and Format:**
|
||||
- The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.
|
||||
- It includes essential elements such as the date, sender, and recipient, which are crucial for formal communication.
|
||||
|
||||
2. **Purpose and Intent:**
|
||||
- The memo is explicitly labeled as a placeholder, indicating that it is not the final content but a template for future use.
|
||||
- The document's primary purpose is to ensure that the format and structure meet the needs of the intended audience.
|
||||
|
||||
3. **Communication and Feedback:**
|
||||
- The memo encourages feedback from employees, suggesting an open line of communication between management and staff.
|
||||
- It emphasizes the importance of reviewing the structure, which implies a focus on clarity and effectiveness in communication.
|
||||
|
||||
#### Trends and Patterns
|
||||
|
||||
- **Emphasis on Structure:**
|
||||
The document highlights the importance of having a well-defined structure in official communications. This trend suggests that the organization values clarity and consistency in its internal communications.
|
||||
|
||||
- **Placeholder Usage:**
|
||||
The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation.
|
||||
|
||||
#### Important Findings
|
||||
|
||||
- **Management's Role:**
|
||||
The memo is issued by management, underscoring their role in overseeing communication standards and ensuring that documents align with organizational needs.
|
||||
|
||||
- **Employee Involvement:**
|
||||
By soliciting feedback, the document reflects a collaborative environment where employee input is valued in shaping communication tools.
|
||||
|
||||
#### Actionable Insights
|
||||
|
||||
1. **Review and Standardize Document Templates:**
|
||||
- Ensure that all memos and official documents follow a standardized format to maintain consistency across the organization.
|
||||
|
||||
2. **Encourage Feedback Loops:**
|
||||
- Establish regular channels for employees to provide feedback on communication tools and practices, fostering a culture of continuous improvement.
|
||||
|
||||
3. **Training on Effective Communication:**
|
||||
- Provide training sessions for employees on how to utilize document templates effectively, focusing on clarity and conciseness in communication.
|
||||
|
||||
4. **Monitor and Update Templates:**
|
||||
- Regularly review and update document templates to reflect any changes in organizational needs or communication strategies.
|
||||
|
||||
By focusing on these insights and implementing the recommended actions, the organization can enhance its internal communication processes, ensuring that they are both effective and aligned with its strategic goals.
|
||||
|
||||
### Document Analysis: Test Document Memo
|
||||
|
||||
#### Overview
|
||||
The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.
|
||||
|
||||
#### Key Sections
|
||||
1. **Memo Header**
|
||||
- **To:** All Employees
|
||||
- **From:** Management
|
||||
- **Date:** October 10, 2023
|
||||
- **Subject:** Placeholder Content
|
||||
|
||||
2. **Content Structure**
|
||||
- **Introduction to the Topic**
|
||||
- **Detailed Analysis**
|
||||
- **Conclusion and Recommendations**
|
||||
|
||||
3. **Additional Information**
|
||||
- Contact management for further information.
|
||||
- Encouragement for feedback from employees.
|
||||
|
||||
#### Insights and Patterns
|
||||
1. **Structured Communication:**
|
||||
- The memo follows a clear and structured format, indicating an emphasis on organized communication within the organization. This structure can be beneficial for ensuring clarity and consistency in internal communications.
|
||||
|
||||
2. **Placeholder Content:**
|
||||
- The memo explicitly states that it serves as a placeholder, suggesting that the organization is in the process of developing more detailed content. This indicates a proactive approach to communication, preparing employees for future updates.
|
||||
|
||||
3. **Engagement and Feedback:**
|
||||
- The memo encourages employees to provide feedback and contact management for further information. This reflects an open communication culture where employee input is valued.
|
||||
|
||||
4. **Focus Areas:**
|
||||
- The bullet list highlights key focus areas: introduction, detailed analysis, and conclusions/recommendations. This suggests that future communications may follow a similar structure, emphasizing thorough analysis and actionable conclusions.
|
||||
|
||||
#### Trends and Relationships
|
||||
- **Emphasis on Feedback:** The document highlights the importance of employee feedback, suggesting a trend towards more inclusive and participatory communication practices within the organization.
|
||||
- **Preparation for Future Content:** The placeholder nature of the memo indicates that the organization is preparing for more detailed and informative communications, possibly in response to upcoming changes or initiatives.
|
||||
|
||||
#### Actionable Insights
|
||||
1. **Enhance Communication Channels:**
|
||||
- Consider implementing regular updates or newsletters to keep employees informed and engaged, leveraging the structured format demonstrated in the memo.
|
||||
|
||||
2. **Encourage Employee Participation:**
|
||||
- Develop mechanisms for collecting and acting on employee feedback, such as surveys or suggestion boxes, to foster a culture of continuous improvement and engagement.
|
||||
|
||||
3. **Prepare for Detailed Content:**
|
||||
- Begin drafting detailed content for future communications, focusing on the key areas identified: introduction, analysis, and recommendations. This will ensure readiness when more specific information needs to be disseminated.
|
||||
|
||||
4. **Training on Communication Practices:**
|
||||
- Provide training for management and employees on effective communication practices, emphasizing the importance of structure and clarity as demonstrated in the memo.
|
||||
|
||||
By focusing on these insights and trends, the organization can enhance its internal communication strategies, leading to improved employee engagement and organizational effectiveness.
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
EXTRACTED CONTENT FROM DOCUMENTS:
|
||||
### Analysis of the Provided Document
|
||||
|
||||
#### Overview
|
||||
The document provided is a memo that serves as a placeholder for future content. It is structured with standard memo components such as the recipient, sender, date, subject, and sections for introduction, detailed analysis, and conclusion. The document is intended to be reviewed for its structure and format.
|
||||
|
||||
#### Key Insights
|
||||
|
||||
1. **Structure and Format:**
|
||||
- The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.
|
||||
- It includes essential elements such as the date, sender, and recipient, which are crucial for formal communication.
|
||||
|
||||
2. **Purpose and Intent:**
|
||||
- The memo is explicitly labeled as a placeholder, indicating that it is not the final content but a template for future use.
|
||||
- The document's primary purpose is to ensure that the format and structure meet the needs of the intended audience.
|
||||
|
||||
3. **Communication and Feedback:**
|
||||
- The memo encourages feedback from employees, suggesting an open line of communication between management and staff.
|
||||
- It emphasizes the importance of reviewing the structure, which implies a focus on clarity and effectiveness in communication.
|
||||
|
||||
#### Trends and Patterns
|
||||
|
||||
- **Emphasis on Structure:**
|
||||
The document highlights the importance of having a well-defined structure in official communications. This trend suggests that the organization values clarity and consistency in its internal communications.
|
||||
|
||||
- **Placeholder Usage:**
|
||||
The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation.
|
||||
|
||||
#### Important Findings
|
||||
|
||||
- **Management's Role:**
|
||||
The memo is issued by management, underscoring their role in overseeing communication standards and ensuring that documents align with organizational needs.
|
||||
|
||||
- **Employee Involvement:**
|
||||
By soliciting feedback, the document reflects a collaborative environment where employee input is valued in shaping communication tools.
|
||||
|
||||
#### Actionable Insights
|
||||
|
||||
1. **Review and Standardize Document Templates:**
|
||||
- Ensure that all memos and official documents follow a standardized format to maintain consistency across the organization.
|
||||
|
||||
2. **Encourage Feedback Loops:**
|
||||
- Establish regular channels for employees to provide feedback on communication tools and practices, fostering a culture of continuous improvement.
|
||||
|
||||
3. **Training on Effective Communication:**
|
||||
- Provide training sessions for employees on how to utilize document templates effectively, focusing on clarity and conciseness in communication.
|
||||
|
||||
4. **Monitor and Update Templates:**
|
||||
- Regularly review and update document templates to reflect any changes in organizational needs or communication strategies.
|
||||
|
||||
By focusing on these insights and implementing the recommended actions, the organization can enhance its internal communication processes, ensuring that they are both effective and aligned with its strategic goals.
|
||||
|
||||
### Document Analysis: Test Document Memo
|
||||
|
||||
#### Overview
|
||||
The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.
|
||||
|
||||
#### Key Sections
|
||||
1. **Memo Header**
|
||||
- **To:** All Employees
|
||||
- **From:** Management
|
||||
- **Date:** October 10, 2023
|
||||
- **Subject:** Placeholder Content
|
||||
|
||||
2. **Content Structure**
|
||||
- **Introduction to the Topic**
|
||||
- **Detailed Analysis**
|
||||
- **Conclusion and Recommendations**
|
||||
|
||||
3. **Additional Information**
|
||||
- Contact management for further information.
|
||||
- Encouragement for feedback from employees.
|
||||
|
||||
#### Insights and Patterns
|
||||
1. **Structured Communication:**
|
||||
- The memo follows a clear and structured format, indicating an emphasis on organized communication within the organization. This structure can be beneficial for ensuring clarity and consistency in internal communications.
|
||||
|
||||
2. **Placeholder Content:**
|
||||
- The memo explicitly states that it serves as a placeholder, suggesting that the organization is in the process of developing more detailed content. This indicates a proactive approach to communication, preparing employees for future updates.
|
||||
|
||||
3. **Engagement and Feedback:**
|
||||
- The memo encourages employees to provide feedback and contact management for further information. This reflects an open communication culture where employee input is valued.
|
||||
|
||||
4. **Focus Areas:**
|
||||
- The bullet list highlights key focus areas: introduction, detailed analysis, and conclusions/recommendations. This suggests that future communications may follow a similar structure, emphasizing thorough analysis and actionable conclusions.
|
||||
|
||||
#### Trends and Relationships
|
||||
- **Emphasis on Feedback:** The document highlights the importance of employee feedback, suggesting a trend towards more inclusive and participatory communication practices within the organization.
|
||||
- **Preparation for Future Content:** The placeholder nature of the memo indicates that the organization is preparing for more detailed and informative communications, possibly in response to upcoming changes or initiatives.
|
||||
|
||||
#### Actionable Insights
|
||||
1. **Enhance Communication Channels:**
|
||||
- Consider implementing regular updates or newsletters to keep employees informed and engaged, leveraging the structured format demonstrated in the memo.
|
||||
|
||||
2. **Encourage Employee Participation:**
|
||||
- Develop mechanisms for collecting and acting on employee feedback, such as surveys or suggestion boxes, to foster a culture of continuous improvement and engagement.
|
||||
|
||||
3. **Prepare for Detailed Content:**
|
||||
- Begin drafting detailed content for future communications, focusing on the key areas identified: introduction, analysis, and recommendations. This will ensure readiness when more specific information needs to be disseminated.
|
||||
|
||||
4. **Training on Communication Practices:**
|
||||
- Provide training for management and employees on effective communication practices, emphasizing the importance of structure and clarity as demonstrated in the memo.
|
||||
|
||||
By focusing on these insights and trends, the organization can enhance its internal communication strategies, leading to improved employee engagement and organizational effectiveness.
|
||||
|
||||
User request: "Analyze the provided document(s) and find insights, patterns, and key information. Perform a general analysis. Focus specifically on: insights. Identify trends, important findings, relationships, and provide actionable insights. Present the analysis in a clear, structured format."
|
||||
|
||||
Generate a VALID JSON response for the user request. The template below shows ONLY the structure pattern - it is NOT existing content.
|
||||
|
||||
JSON structure template:
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Generated Document",
|
||||
"filename": "document.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_example",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Heading Text"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_example",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "Paragraph text content"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_example",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": ["Item 1", "Item 2"]
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_table_example",
|
||||
"content_type": "table",
|
||||
"elements": [
|
||||
{
|
||||
"headers": ["Column 1", "Column 2"],
|
||||
"rows": [
|
||||
["Row 1 Col 1", "Row 1 Col 2"],
|
||||
["Row 2 Col 1", "Row 2 Col 2"]
|
||||
],
|
||||
"caption": "Table caption"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_code_example",
|
||||
"content_type": "code_block",
|
||||
"elements": [
|
||||
{
|
||||
"code": "function example() { return true; }",
|
||||
"language": "javascript"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Instructions:
|
||||
- Start with {"metadata": ...} — return COMPLETE, STRICT JSON.
|
||||
- Return ONLY valid JSON (strict). No comments. No trailing commas. Use double quotes.
|
||||
- Do NOT reuse example section IDs; create your own.
|
||||
- Generate complete content based on the user request. Do NOT just give an instruction or comments. Deliver the complete response.
|
||||
- IMPORTANT: Set a meaningful "filename" in each document with appropriate file extension (e.g., "prime_numbers.txt", "report.docx", "data.json"). The filename should reflect the content and task objective.
|
||||
- When the request is fully satisfied, add "complete_response": true at root level.
|
||||
- Output JSON only; no markdown fences or extra text.
|
||||
|
||||
Generate your complete response starting from {"metadata": ...}:
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report",
|
||||
"filename": "memo_analysis_report.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_overview",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Overview"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_overview_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization."}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Key Insights"}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.",
|
||||
"It is explicitly labeled as a placeholder, indicating it is not the final content but a template for future use.",
|
||||
"The memo encourages feedback from employees, suggesting an open line of communication between management and staff."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Trends and Patterns"}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "The document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation."}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Important Findings"}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo is issued by management, underscoring their role in overseeing communication standards.",
|
||||
"By soliciting feedback, the document reflects a collaborative environment where employee input is valued."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Actionable Insights"}
|
||||
],
|
||||
"order": 8
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Review and standardize document templates to maintain consistency across the organization.",
|
||||
"Establish regular channels for employees to provide feedback on communication tools and practices.",
|
||||
"Provide training sessions for employees on how to utilize document templates effectively.",
|
||||
"Regularly review and update document templates to reflect any changes in organizational needs."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"complete_response": true
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report",
|
||||
"filename": "memo_analysis_report.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_overview",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Overview"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_overview_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Key Insights"
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"id": "section_key_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.",
|
||||
"It is explicitly labeled as a placeholder, indicating it is not the final content but a template for future use.",
|
||||
"The memo encourages feedback from employees, suggesting an open line of communication between management and staff."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Trends and Patterns"
|
||||
}
|
||||
],
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"id": "section_trends_patterns_paragraph",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation."
|
||||
}
|
||||
],
|
||||
"order": 5
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Important Findings"
|
||||
}
|
||||
],
|
||||
"order": 6
|
||||
},
|
||||
{
|
||||
"id": "section_important_findings_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"The memo is issued by management, underscoring their role in overseeing communication standards.",
|
||||
"By soliciting feedback, the document reflects a collaborative environment where employee input is valued."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 7
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Actionable Insights"
|
||||
}
|
||||
],
|
||||
"order": 8
|
||||
},
|
||||
{
|
||||
"id": "section_actionable_insights_bullet_list",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Review and standardize document templates to maintain consistency across the organization.",
|
||||
"Establish regular channels for employees to provide feedback on communication tools and practices.",
|
||||
"Provide training sessions for employees on how to utilize document templates effectively.",
|
||||
"Regularly review and update document templates to reflect any changes in organizational needs."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{'success': True, 'content': {'metadata': {'split_strategy': 'single_document', 'source_documents': [], 'extraction_method': 'ai_generation', 'title': 'Memo Analysis Report'}, 'documents': [{'id': 'doc_1', 'title': 'Memo Analysis Report', 'filename': 'memo_analysis_report.json', 'sections': [{'id': 'section_overview', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Overview'}], 'order': 0}, {'id': 'section_overview_paragraph', 'content_type': 'paragraph', 'elements': [{'text': 'The document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.'}], 'order': 1}, {'id': 'section_key_insights', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Key Insights'}], 'order': 2}, {'id': 'section_key_insights_bullet_list', 'content_type': 'bullet_list', 'elements': [{'items': ['The memo follows a conventional structure with clear sections for introduction, detailed analysis, and conclusion.', 'It is explicitly labeled as a placeholder, indicating it is not the final content but a template for future use.', 'The memo encourages feedback from employees, suggesting an open line of communication between management and staff.']}], 'order': 3}, {'id': 'section_trends_patterns', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Trends and Patterns'}], 'order': 4}, {'id': 'section_trends_patterns_paragraph', 'content_type': 'paragraph', 'elements': [{'text': 'The document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation.'}], 'order': 5}, {'id': 'section_important_findings', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Important Findings'}], 'order': 6}, {'id': 'section_important_findings_bullet_list', 'content_type': 'bullet_list', 'elements': [{'items': ['The memo is issued by management, underscoring their role in overseeing communication standards.', 'By soliciting feedback, the document reflects a collaborative environment where employee input is valued.']}], 'order': 7}, {'id': 'section_actionable_insights', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Actionable Insights'}], 'order': 8}, {'id': 'section_actionable_insights_bullet_list', 'content_type': 'bullet_list', 'elements': [{'items': ['Review and standardize document templates to maintain consistency across the organization.', 'Establish regular channels for employees to provide feedback on communication tools and practices.', 'Provide training sessions for employees on how to utilize document templates effectively.', 'Regularly review and update document templates to reflect any changes in organizational needs.']}], 'order': 9}]}]}, 'documents': [{'documentName': 'memo_analysis_report.json', 'documentData': 'Memo Analysis Report\n====================\n\nOverview\n========\n\nThe document is a memo intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization.\n\nKey Insights\n============\n\nTrends and Patterns\n===================\n\nThe document highlights the importance of having a well-defined structure in official communications, suggesting that the organization values clarity and consistency. The use of placeholders indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation.\n\nImportant Findings\n==================\n\nActionable Insights\n===================\n\n\nGenerated: 2025-11-27 11:41:09 UTC', 'mimeType': 'text/plain', 'title': 'Memo Analysis Report'}], 'is_multi_file': False, 'format': 'txt', 'title': 'Memo Analysis Report', 'split_strategy': 'single', 'total_documents': 1, 'processed_documents': 1}
|
||||
|
||||
=== DOCUMENT LIST FOR TRACING ===
|
||||
Document 1: {'id': 'doc_1', 'title': 'Memo Analysis Report', 'filename': 'memo_analysis_report.json', 'sections'...
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
TASK VALIDATION
|
||||
|
||||
TASK OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
EXPECTED DATA TYPE: unknown
|
||||
EXPECTED FORMATS: ['pdf', 'docx', 'xlsx', 'txt', 'json', 'csv', 'html', 'md']
|
||||
SUCCESS CRITERIA (2 items): ["The task fully addresses the user's main objective", "The deliverable meets the user's expectations and requirements"]
|
||||
ACTION THAT CREATED DOCUMENTS: ai.analyzeDocuments
|
||||
|
||||
VALIDATION RULES:
|
||||
IMPORTANT: You only have document METADATA (filename, format, size, mimeType) - NOT document content.
|
||||
Validate based on metadata only:
|
||||
1. Check if filenames are APPROXIMATELY meaningful (generic names like "generated.docx" are acceptable if format matches)
|
||||
2. Check if delivered formats are compatible with expected format
|
||||
3. Check if document sizes are reasonable for the task objective
|
||||
4. Assess if filename and size combination suggests correct data type
|
||||
5. Rate overall quality (0.0-1.0) based on metadata indicators, with format matching being the most important
|
||||
6. Identify specific gaps based on what the user requested (infer from filename, size, format - NOT content)
|
||||
|
||||
OUTPUT FORMAT - JSON ONLY (no prose):
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.0,
|
||||
"dataTypeMatch": false,
|
||||
"formatMatch": false,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false][false],
|
||||
"gapAnalysis": "Describe what is missing or incorrect based on filename, size, format metadata",
|
||||
"improvementSuggestions": ["General action to improve overall result"],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "document.ext",
|
||||
"issues": ["Issue inferred from metadata (e.g., filename doesn't match task, size too small for objective)"],
|
||||
"suggestions": ["Specific fix based on metadata analysis"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Field explanations:
|
||||
- "improvementSuggestions": Overall actions to improve the entire result (general, high-level)
|
||||
- "validationDetails[].suggestions": Specific fixes for each document's individual issues (document-specific, detailed)
|
||||
- Do NOT use prefixes like "NEXT STEP:" - describe actions directly
|
||||
|
||||
DELIVERED DOCUMENTS (2 items):
|
||||
[
|
||||
{
|
||||
"name": "memo_analysis_report.json",
|
||||
"mimeType": "text/plain",
|
||||
"format": "json",
|
||||
"size": "780.0 B"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"format": "json",
|
||||
"size": "2.9 KB"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
```json
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.5,
|
||||
"dataTypeMatch": false,
|
||||
"formatMatch": true,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false, false],
|
||||
"gapAnalysis": "The delivered documents are in the expected 'json' format, which matches one of the expected formats. However, the size of 'memo_analysis_report.json' is very small, suggesting it may not contain sufficient data to meet the user's main business objective. Additionally, the mimeType for 'memo_analysis_report.json' is 'text/plain', which is inconsistent with its 'json' format.",
|
||||
"improvementSuggestions": ["Ensure that document sizes are reasonable for the task objective and that mimeTypes are consistent with the document formats."],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "memo_analysis_report.json",
|
||||
"issues": ["Size too small for objective", "MimeType 'text/plain' does not match 'json' format"],
|
||||
"suggestions": ["Increase the size to ensure sufficient data is included", "Correct the mimeType to 'application/json'"]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": [],
|
||||
"suggestions": []
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
77
logs/debug/prompts/20251127-114115-074-refinement_prompt.txt
Normal file
77
logs/debug/prompts/20251127-114115-074-refinement_prompt.txt
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
TASK DECISION
|
||||
|
||||
OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
|
||||
DECISION RULES:
|
||||
1. "continue" = objective NOT fulfilled
|
||||
2. "stop" = objective fulfilled
|
||||
3. Return ONLY JSON - no other text
|
||||
|
||||
OUTPUT FORMAT (only JSON object to deliver):
|
||||
{{
|
||||
"decision": "continue",
|
||||
"reason": "Brief reason for decision"
|
||||
}}
|
||||
|
||||
OBSERVATION: {
|
||||
"success": true,
|
||||
"resultLabel": "round1_task1_action2_results",
|
||||
"documentsCount": 2,
|
||||
"previews": [
|
||||
{
|
||||
"name": "memo_analysis_report.json",
|
||||
"mimeType": "text/plain",
|
||||
"contentSize": "780 characters"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"contentSize": "2965 characters"
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"contentValidation": {
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.5,
|
||||
"documentCount": 2,
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "memo_analysis_report.json",
|
||||
"issues": [
|
||||
"Size too small for objective",
|
||||
"MimeType 'text/plain' does not match 'json' format"
|
||||
],
|
||||
"suggestions": [
|
||||
"Increase the size to ensure sufficient data is included",
|
||||
"Correct the mimeType to 'application/json'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": [],
|
||||
"suggestions": []
|
||||
}
|
||||
],
|
||||
"improvementSuggestions": [
|
||||
"Ensure that document sizes are reasonable for the task objective and that mimeTypes are consistent with the document formats."
|
||||
],
|
||||
"schemaCompliant": true,
|
||||
"originalType": "json",
|
||||
"missingFields": []
|
||||
},
|
||||
"contentAnalysis": {}
|
||||
}
|
||||
|
||||
CONTENT VALIDATION:
|
||||
Overall Success: False
|
||||
Quality Score: 0.50
|
||||
Improvement Suggestions: Ensure that document sizes are reasonable for the task objective and that mimeTypes are consistent with the document formats.
|
||||
|
||||
PROGRESS STATE:
|
||||
Completed Objectives: 0
|
||||
Partial Achievements: 2
|
||||
Failed Attempts: 0
|
||||
Current Phase: partial
|
||||
Next Action Suggestions: Build on partial achievements, Ensure the filenames and formats align with a singular business objective and expected data type., Ensure that document sizes are reasonable for the task objective and that mimeTypes are consistent with the document formats.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
```json
|
||||
{
|
||||
"decision": "continue",
|
||||
"reason": "The objective is not fulfilled due to content validation issues, including incorrect mimeType and insufficient document size for one of the documents."
|
||||
}
|
||||
```
|
||||
96
logs/debug/prompts/20251127-114118-076-actionplan_prompt.txt
Normal file
96
logs/debug/prompts/20251127-114118-076-actionplan_prompt.txt
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
Select exactly one next action to advance the task incrementally.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
Test
|
||||
|
||||
OBJECTIVE:
|
||||
Complete the user's main business objective as specified in their request.
|
||||
|
||||
AVAILABLE_DOCUMENTS_SUMMARY:
|
||||
4 documents available from previous tasks
|
||||
|
||||
AVAILABLE_METHODS:
|
||||
{
|
||||
"ai.analyzeDocuments": "\n GENERAL:\n - Purpose: Analyze documents and find insights, patterns, trends, and key information.\n - Input requirements: documentList (required); optional analysisType, focus.\n - Output format: Analysis report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Document(s) to analyze.\n - analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.\n - focus (str, optional): Specific aspect to focus on (e.g., \"trends\", \"risks\", \"opportunities\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.compareDocuments": "\n GENERAL:\n - Purpose: Compare multiple documents and identify differences, similarities, and changes.\n - Input requirements: documentList (required, should contain 2+ documents); optional comparisonType, focus.\n - Output format: Comparison report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Two or more documents to compare.\n - comparisonType (str, optional): Type of comparison - differences, similarities, changes, full. Default: full.\n - focus (str, optional): Specific aspect to focus on (e.g., \"content\", \"structure\", \"data\", \"formatting\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.convertDocument": "\n GENERAL:\n - Purpose: Convert documents between different formats (PDF→Word, Excel→CSV, etc.).\n - Input requirements: documentList (required); targetFormat (required).\n - Output format: Document in target format.\n\n Parameters:\n - documentList (list, required): Document reference(s) to convert.\n - targetFormat (str, required): Target format extension (docx, pdf, xlsx, csv, txt, html, json, md, etc.).\n - preserveStructure (bool, optional): Whether to preserve document structure (headings, tables, etc.). Default: True.\n ",
|
||||
"ai.extractData": "\n GENERAL:\n - Purpose: Extract structured data from documents (key-value pairs, entities, facts, etc.).\n - Input requirements: documentList (required); optional dataStructure, fields.\n - Output format: JSON by default, or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract data from.\n - dataStructure (str, optional): Desired data structure - flat, nested, or list. Default: nested.\n - fields (list, optional): Specific fields/properties to extract (e.g., [\"name\", \"date\", \"amount\"]).\n - resultType (str, optional): Output format (json, csv, xlsx, etc.). Default: json.\n ",
|
||||
"ai.extractTables": "\n GENERAL:\n - Purpose: Extract tables from documents, preserving structure and data.\n - Input requirements: documentList (required); optional tableFormat.\n - Output format: JSON by default (structured table data), or CSV/XLSX if specified.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract tables from.\n - tableFormat (str, optional): Output format for tables - json, csv, or xlsx. Default: json.\n - includeHeaders (bool, optional): Include table headers. Default: True.\n ",
|
||||
"ai.generateChart": "\n GENERAL:\n - Purpose: Generate charts/graphs from data in documents or structured data.\n - Input requirements: documentList (required); optional chartType, title, labels.\n - Output format: Image (png or jpg).\n\n Parameters:\n - documentList (list, required): Documents containing data to visualize (CSV, Excel, JSON, etc.).\n - chartType (str, optional): Type of chart - bar, line, pie, scatter, area, etc. Default: bar.\n - title (str, optional): Chart title.\n - xAxisLabel (str, optional): X-axis label.\n - yAxisLabel (str, optional): Y-axis label.\n - resultType (str, optional): Image format (png or jpg). Default: png.\n ",
|
||||
"ai.generateDocument": "\n GENERAL:\n - Purpose: Generate documents from scratch or based on templates/inputs.\n - Input requirements: prompt or description (required); optional documentList (for templates/references).\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - prompt (str, required): Description of the document to generate.\n - documentList (list, optional): Template documents or reference documents to use as a guide.\n - documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.\n - resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.\n ",
|
||||
"ai.generateReport": "\n GENERAL:\n - Purpose: Generate comprehensive reports from input documents/data with analysis and insights.\n - Input requirements: documentList (optional, can generate from scratch); optional reportType, sections.\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - documentList (list, optional): Input documents/data to base the report on.\n - reportType (str, optional): Type of report - summary, analysis, executive, detailed. Default: analysis.\n - sections (list, optional): Specific sections to include (e.g., [\"introduction\", \"findings\", \"recommendations\"]).\n - title (str, optional): Report title.\n - resultType (str, optional): Output format (docx, pdf, md, etc.). Default: docx.\n ",
|
||||
"ai.process": "\n GENERAL:\n - Purpose: Universal AI document processing action - accepts MULTIPLE input documents in ANY format (docx, pdf, json, txt, xlsx, html, images, etc.) and processes them together with a prompt to produce MULTIPLE output documents in ANY specified format (via resultType). Use for document generation, format conversion, content transformation, analysis, summarization, translation, extraction, comparison, and any AI-powered document manipulation.\n - Input requirements: aiPrompt (required); optional documentList (can contain multiple documents in any format).\n - Output format: Multiple documents in the same format per call (via resultType: txt, json, pdf, docx, xlsx, pptx, png, jpg, etc.). The AI can generate multiple files based on the prompt (e.g., \"create separate documents for each section\"). Default: txt.\n - Key capabilities: Can process any number of input documents together, extract data from mixed formats, combine information, generate multiple output files, transform between formats, perform analysis/comparison/summarization on document sets.\n\n Parameters:\n - aiPrompt (str, required): Instruction for the AI describing what processing to perform.\n - documentList (list, optional): Document reference(s) in any format to use as input/context.\n - resultType (str, optional): Output file extension (txt, json, md, csv, xml, html, pdf, docx, xlsx, png, etc.). All output documents will use this format. Default: txt.\n ",
|
||||
"ai.summarizeDocument": "\n GENERAL:\n - Purpose: Summarize one or more documents, extracting key points and main ideas.\n - Input requirements: documentList (required); optional summaryLength, focus.\n - Output format: Text document with summary (default: txt, can be overridden with resultType).\n\n Parameters:\n - documentList (list, required): Document reference(s) to summarize.\n - summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.\n - focus (str, optional): Specific aspect to focus on in the summary (e.g., \"financial data\", \"key decisions\").\n - resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.\n ",
|
||||
"ai.translateDocument": "\n GENERAL:\n - Purpose: Translate documents to a target language while preserving formatting and structure.\n - Input requirements: documentList (required); targetLanguage (required).\n - Output format: Translated document in same format as input (default) or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to translate.\n - targetLanguage (str, required): Target language code or name (e.g., \"de\", \"German\", \"French\", \"es\").\n - sourceLanguage (str, optional): Source language if known (e.g., \"en\", \"English\"). If not provided, AI will detect.\n - preserveFormatting (bool, optional): Whether to preserve original formatting. Default: True.\n - resultType (str, optional): Output file extension. If not specified, uses same format as input.\n ",
|
||||
"ai.validateData": "\n GENERAL:\n - Purpose: Validate data quality, structure, completeness, and correctness in documents/data files.\n - Input requirements: documentList (required); optional validationRules, schema.\n - Output format: Validation report in JSON or text format (default: json).\n\n Parameters:\n - documentList (list, required): Documents/data files to validate.\n - validationRules (list, optional): Specific validation rules to check (e.g., [\"required_fields\", \"data_types\", \"ranges\"]).\n - schema (dict, optional): Expected data schema/structure to validate against.\n - resultType (str, optional): Output format (json, txt, md, etc.). Default: json.\n ",
|
||||
"ai.webResearch": "\n GENERAL:\n - Purpose: Web research with two-step process: search for URLs, then crawl content.\n - Input requirements: prompt (required); optional list(url), country, language, researchDepth.\n - Output format: JSON with research results including URLs and content.\n\n Parameters:\n - prompt (str, required): Natural language research instruction.\n - urlList (list, optional): Specific URLs to crawl, if needed.\n - country (str, optional): Two-digit country code (lowercase, e.g., ch, us, de).\n - language (str, optional): Language code (lowercase, e.g., de, en, fr).\n - researchDepth (str, optional): Research depth - fast, general, or deep. Default: general.\n ",
|
||||
"outlook.composeAndDraftEmailWithContext": "\n GENERAL:\n - Purpose: Compose email content using AI from context and optional documents, then create a draft.\n - Input requirements: connectionReference (required); to (required); context (required); optional documentList, cc, bcc, emailStyle, maxLength.\n - Output format: JSON confirmation with AI-generated draft metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - to (list, required): Recipient email addresses.\n - context (str, required): Detailled context for composing the email.\n - documentList (list, optional): Document references for context/attachments.\n - cc (list, optional): CC recipients.\n - bcc (list, optional): BCC recipients.\n - emailStyle (str, optional): formal | casual | business. Default: business.\n - maxLength (int, optional): Maximum length for generated content. Default: 1000.\n ",
|
||||
"outlook.readEmails": "\n GENERAL:\n - Purpose: Read emails and metadata from a mailbox folder.\n - Input requirements: connectionReference (required); optional folder, limit, filter, outputMimeType.\n - Output format: JSON with emails and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - folder (str, optional): Folder to read from. Default: Inbox.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - filter (str, optional): Sender, query operators, or subject text.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.searchEmails": "\n GENERAL:\n - Purpose: Search emails by query and return matching items with metadata.\n - Input requirements: connectionReference (required); query (required); optional folder, limit, outputMimeType.\n - Output format: JSON with search results and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - query (str, required): Search expression.\n - folder (str, optional): Folder scope or All. Default: All.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.sendDraftEmail": "\n GENERAL:\n - Purpose: Send draft email(s) using draft email JSON document(s) from action outlook.composeAndDraftEmailWithContext.\n - Input requirements: connectionReference (required); documentList with draft email JSON documents (required).\n - Output format: JSON confirmation with sent mail metadata for all emails.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - documentList (list, required): Document reference(s) to draft emails in JSON format (outputs from outlook.composeAndDraftEmailWithContext function).\n ",
|
||||
"sharepoint.findDocumentPath": "\n GENERAL:\n - Purpose: Find documents and folders by name/path across sites.\n - Input requirements: connectionReference (required); searchQuery (required); optional site, maxResults.\n - Output format: JSON with found items and paths.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - site (str, optional): Site hint.\n - searchQuery (str, required): Search terms or path.\n - maxResults (int, optional): Maximum items to return. Default: 100.\n ",
|
||||
"sharepoint.listDocuments": "\n GENERAL:\n - Purpose: List documents and folders in SharePoint paths across sites.\n - Input requirements: connectionReference (required); optional pathObject or pathQuery; includeSubfolders.\n - Output format: JSON with folder items and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Path query if no pathObject.\n - includeSubfolders (bool, optional): Include one level of subfolders. Default: False.\n ",
|
||||
"sharepoint.readDocuments": "\n GENERAL:\n - Purpose: Read documents from SharePoint and extract content/metadata.\n - Input requirements: connectionReference (required); optional documentList, pathObject, or pathQuery; includeMetadata.\n - Output format: Standardized ActionDocument format (documentName, documentData, mimeType).\n - Binary files (PDFs, etc.) are Base64-encoded in documentData.\n - Text files are stored as plain text in documentData.\n - Returns ActionResult with documents list for template processing.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result (from findDocumentPath).\n - documentList (list, optional): Document list reference(s) to read (backward compatibility).\n - pathQuery (str, optional): Path query if no pathObject (backward compatibility).\n - includeMetadata (bool, optional): Include metadata. Default: True.\n \n Returns:\n - ActionResult with documents: List[ActionDocument] where each ActionDocument contains:\n - documentName: File name\n - documentData: Base64-encoded content (binary files) or plain text (text files)\n - mimeType: MIME type (e.g., application/pdf, text/plain)\n ",
|
||||
"sharepoint.uploadDocument": "\n GENERAL:\n - Purpose: Upload documents to SharePoint. Only to choose this action with a connectionReference\n - Input requirements: connectionReference (required); documentList (required); optional pathObject or pathQuery.\n - Output format: JSON with upload status and file info.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Upload target path if no pathObject.\n - documentList (list, required): Document reference(s) to upload. File names are taken from the documents.\n "
|
||||
}
|
||||
|
||||
WORKFLOW_HISTORY (reverse-chronological, enriched):
|
||||
- Round 1: 2 docs (memo_analysis_report.txt, structured_content_1.json) label='round1_task1_action2_results' | success=Unknown | msg='**Action 2 (ai.analyzeDocuments)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
- Round 1: 2 docs (test_document_memo.docx, structured_content.json) label='round1_task1_action1_results' | success=Unknown | msg='**Action 1 (ai.generateDocument)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
Available documents: 4
|
||||
|
||||
AVAILABLE_DOCUMENTS_INDEX:
|
||||
|
||||
Current round documents:
|
||||
- docList:round1_task1_action2_results contains:
|
||||
- docItem:937cbc15-3df6-45b7-8d24-80964746a4be:memo_analysis_report.txt
|
||||
- docItem:b129c6dc-f9ac-45de-9789-7ca73002d314:structured_content_1.json
|
||||
- docList:round1_task1_action1_results contains:
|
||||
- docItem:08c7d2e7-e3ac-44c6-b305-2696f7de627a:test_document_memo.docx
|
||||
- docItem:da1fa51f-68d2-41f1-bc25-aaff26beaab7:structured_content.json
|
||||
|
||||
|
||||
|
||||
AVAILABLE_CONNECTIONS_INDEX:
|
||||
No connections available
|
||||
|
||||
LEARNING-BASED GUIDANCE:
|
||||
No previous failures detected. Proceed with standard approach.
|
||||
|
||||
FAILURE ANALYSIS:
|
||||
{}
|
||||
|
||||
ESCALATION LEVEL: low
|
||||
|
||||
REPLY: Return ONLY a JSON object with the following structure (no comments, no extra text). The chosen action MUST:
|
||||
- be the next logical incremental step toward fulfilling the objective
|
||||
- not attempt to complete the entire objective in one step
|
||||
- if producing files, target exactly one output format for this step
|
||||
- reference ONLY existing document IDs/labels from AVAILABLE_DOCUMENTS_INDEX
|
||||
- learn from previous validation feedback and avoid repeated mistakes
|
||||
{{
|
||||
"action": "method.action_name",
|
||||
"actionObjective": "...",
|
||||
"learnings": ["..."],
|
||||
"requiredInputDocuments": ["docList:..."],
|
||||
"requiredConnection": "connection:..." | null,
|
||||
"parametersContext": "concise text that Stage 2 will use to set business parameters"
|
||||
}}
|
||||
|
||||
EXAMPLE how to assign references from AVAILABLE_DOCUMENTS_INDEX and AVAILABLE_CONNECTIONS_INDEX:
|
||||
"requiredInputDocuments": ["docList:msg_47a7a578-e8f2-4ba8-ac66-0dbff40605e0:round8_task1_action1_results","docItem:5d8b7aee-b546-4487-b6a8-835c86f7b186:AI_Generated_Document_20251006-104256.docx"],
|
||||
"requiredConnection": "connection:msft:p.motsch@valueon.ch",
|
||||
|
||||
RULES:
|
||||
1. Use EXACT action names from AVAILABLE_METHODS
|
||||
2. Do NOT output a "parameters" object
|
||||
3. parametersContext must be short and sufficient for Stage 2
|
||||
4. Return ONLY JSON - no markdown, no explanations
|
||||
5. For requiredInputDocuments, use ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (docList:... or docItem:...)
|
||||
- DO NOT invent or modify Message IDs
|
||||
- DO NOT create new references
|
||||
- Copy references EXACTLY as shown in AVAILABLE_DOCUMENTS_INDEX
|
||||
6. For requiredConnection, use ONLY an exact label from AVAILABLE_CONNECTIONS_INDEX
|
||||
7. Plan incrementally: if the overall intent needs multiple output formats (e.g., CSV and HTML), choose one format in this step and leave the other(s) for subsequent steps
|
||||
8. CRITICAL: Learn from previous validation feedback - avoid repeating the same mistakes
|
||||
9. If previous attempts failed, consider alternative approaches or more specific parameters
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"action": "ai.summarizeDocument",
|
||||
"actionObjective": "Summarize the key points and main ideas from the documents to provide a concise overview.",
|
||||
"learnings": ["Focus on extracting key points and main ideas to create a concise summary."],
|
||||
"requiredInputDocuments": ["docList:round1_task1_action2_results"],
|
||||
"requiredConnection": null,
|
||||
"parametersContext": "Summarize the documents with a focus on key insights and main ideas."
|
||||
}
|
||||
```
|
||||
62
logs/debug/prompts/20251127-114127-078-paramplan_prompt.txt
Normal file
62
logs/debug/prompts/20251127-114127-078-paramplan_prompt.txt
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
You are a parameter generator. Set the parameters for this specific action.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
-----------------
|
||||
Test
|
||||
-----------------
|
||||
|
||||
THIS ACTION'S SPECIFIC OBJECTIVE:
|
||||
-----------------
|
||||
Summarize the key points and main ideas from the documents to provide a concise overview.
|
||||
-----------------
|
||||
|
||||
SELECTED_ACTION:
|
||||
ai.summarizeDocument
|
||||
|
||||
LEARNING-BASED PARAMETER GUIDANCE:
|
||||
No previous parameter failures. Use standard parameter values.
|
||||
|
||||
ATTEMPT NUMBER: 1
|
||||
|
||||
PREVIOUS FAILURE ANALYSIS:
|
||||
{
|
||||
"hasFailures": false
|
||||
}
|
||||
|
||||
REPLY (ONLY JSON):
|
||||
{{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {{
|
||||
"paramName": "value"
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
CONTEXT FOR PARAMETER VALUES:
|
||||
-----------------
|
||||
Summarize the documents with a focus on key insights and main ideas.
|
||||
-----------------
|
||||
|
||||
LEARNINGS (from prior attempts, if any):
|
||||
- Focus on extracting key points and main ideas to create a concise summary.
|
||||
|
||||
REQUIRED PARAMETERS FOR THIS ACTION (use these exact parameter names):
|
||||
- summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.
|
||||
- focus (str, optional): Specific aspect to focus on in the summary (e.g., "financial data", "key decisions").
|
||||
- resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.
|
||||
|
||||
INSTRUCTIONS:
|
||||
- Use ONLY the parameter names listed in section REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Fill in appropriate values based on the OVERALL TASK CONTEXT and THIS ACTION'S SPECIFIC OBJECTIVE
|
||||
- Consider the overall task context when setting parameter values to ensure they align with the complete user request
|
||||
- Do NOT invent new parameters
|
||||
- Do NOT include: documentList, connectionReference, history, documents, connections
|
||||
- CRITICAL: Follow the learning-based parameter guidance above
|
||||
- Learn from previous validation failures and adjust parameters accordingly
|
||||
|
||||
RULES:
|
||||
- Return ONLY JSON (no markdown, no prose)
|
||||
- Use ONLY the exact parameter names listed in REQUIRED PARAMETERS FOR THIS ACTION
|
||||
- Do NOT add any parameters not listed above
|
||||
- Do NOT add nested objects or custom fields
|
||||
- Apply learning insights to avoid repeated parameter mistakes
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```json
|
||||
{
|
||||
"schema": "parameters_v1",
|
||||
"parameters": {
|
||||
"summaryLength": "medium",
|
||||
"focus": "key insights",
|
||||
"resultType": "txt"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
The memo analysis report highlights the significance of a well-defined structure in official communications within an organization. Dated October 10, 2023, the memo serves as a template for future content, emphasizing the organization's commitment to clarity and consistency. The use of placeholders in the document indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation. This approach suggests that the organization values structured communication and is prepared to efficiently incorporate future content as needed.
|
||||
|
||||
The document is a memo analysis report intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization. The key insights from the memo include:
|
||||
|
||||
1. **Conventional Structure**: The memo follows a traditional format with distinct sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency in communication.
|
||||
|
||||
2. **Placeholder Nature**: It is explicitly labeled as a placeholder, indicating that it is not the final content but a template for future use, allowing for flexibility in document preparation.
|
||||
|
||||
3. **Encouragement of Feedback**: The memo encourages feedback from employees, suggesting an open line of communication between management and staff, reflecting a collaborative environment where employee input is valued.
|
||||
|
||||
These insights highlight the organization's emphasis on structured communication, adaptability in content creation, and fostering a collaborative atmosphere through open feedback channels.
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
EXTRACTED CONTENT FROM DOCUMENTS:
|
||||
The memo analysis report highlights the significance of a well-defined structure in official communications within an organization. Dated October 10, 2023, the memo serves as a template for future content, emphasizing the organization's commitment to clarity and consistency. The use of placeholders in the document indicates a proactive approach to document preparation, allowing for flexibility and adaptability in content creation. This approach suggests that the organization values structured communication and is prepared to efficiently incorporate future content as needed.
|
||||
|
||||
The document is a memo analysis report intended for all employees from the management team, dated October 10, 2023. It serves as a placeholder for future content, providing a structure and format for communication within the organization. The key insights from the memo include:
|
||||
|
||||
1. **Conventional Structure**: The memo follows a traditional format with distinct sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency in communication.
|
||||
|
||||
2. **Placeholder Nature**: It is explicitly labeled as a placeholder, indicating that it is not the final content but a template for future use, allowing for flexibility in document preparation.
|
||||
|
||||
3. **Encouragement of Feedback**: The memo encourages feedback from employees, suggesting an open line of communication between management and staff, reflecting a collaborative environment where employee input is valued.
|
||||
|
||||
These insights highlight the organization's emphasis on structured communication, adaptability in content creation, and fostering a collaborative atmosphere through open feedback channels.
|
||||
|
||||
User request: "Summarize the provided document(s). Create a medium-length summary (comprehensive but concise). Focus specifically on: key insights. Extract and present the key points, main ideas, and important information in a clear, well-structured format."
|
||||
|
||||
Generate a VALID JSON response for the user request. The template below shows ONLY the structure pattern - it is NOT existing content.
|
||||
|
||||
JSON structure template:
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Generated Document",
|
||||
"filename": "document.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_example",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Heading Text"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_example",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "Paragraph text content"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_example",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": ["Item 1", "Item 2"]
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_table_example",
|
||||
"content_type": "table",
|
||||
"elements": [
|
||||
{
|
||||
"headers": ["Column 1", "Column 2"],
|
||||
"rows": [
|
||||
["Row 1 Col 1", "Row 1 Col 2"],
|
||||
["Row 2 Col 1", "Row 2 Col 2"]
|
||||
],
|
||||
"caption": "Table caption"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_code_example",
|
||||
"content_type": "code_block",
|
||||
"elements": [
|
||||
{
|
||||
"code": "function example() { return true; }",
|
||||
"language": "javascript"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Instructions:
|
||||
- Start with {"metadata": ...} — return COMPLETE, STRICT JSON.
|
||||
- Return ONLY valid JSON (strict). No comments. No trailing commas. Use double quotes.
|
||||
- Do NOT reuse example section IDs; create your own.
|
||||
- Generate complete content based on the user request. Do NOT just give an instruction or comments. Deliver the complete response.
|
||||
- IMPORTANT: Set a meaningful "filename" in each document with appropriate file extension (e.g., "prime_numbers.txt", "report.docx", "data.json"). The filename should reflect the content and task objective.
|
||||
- When the request is fully satisfied, add "complete_response": true at root level.
|
||||
- Output JSON only; no markdown fences or extra text.
|
||||
|
||||
Generate your complete response starting from {"metadata": ...}:
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report Summary",
|
||||
"filename": "memo_analysis_summary.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{"level": 1, "text": "Key Insights"}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_summary",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{"text": "The memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency."}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_insights",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Conventional Structure: The memo follows a traditional format with sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency.",
|
||||
"Placeholder Nature: The document is labeled as a placeholder, indicating flexibility and adaptability in content creation.",
|
||||
"Encouragement of Feedback: The memo invites feedback from employees, promoting open communication and a collaborative environment."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"complete_response": true
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"metadata": {
|
||||
"split_strategy": "single_document",
|
||||
"source_documents": [],
|
||||
"extraction_method": "ai_generation"
|
||||
},
|
||||
"documents": [
|
||||
{
|
||||
"id": "doc_1",
|
||||
"title": "Memo Analysis Report Summary",
|
||||
"filename": "memo_analysis_summary.json",
|
||||
"sections": [
|
||||
{
|
||||
"id": "section_heading_key_insights",
|
||||
"content_type": "heading",
|
||||
"elements": [
|
||||
{
|
||||
"level": 1,
|
||||
"text": "Key Insights"
|
||||
}
|
||||
],
|
||||
"order": 0
|
||||
},
|
||||
{
|
||||
"id": "section_paragraph_summary",
|
||||
"content_type": "paragraph",
|
||||
"elements": [
|
||||
{
|
||||
"text": "The memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency."
|
||||
}
|
||||
],
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"id": "section_bullet_list_insights",
|
||||
"content_type": "bullet_list",
|
||||
"elements": [
|
||||
{
|
||||
"items": [
|
||||
"Conventional Structure: The memo follows a traditional format with sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency.",
|
||||
"Placeholder Nature: The document is labeled as a placeholder, indicating flexibility and adaptability in content creation.",
|
||||
"Encouragement of Feedback: The memo invites feedback from employees, promoting open communication and a collaborative environment."
|
||||
]
|
||||
}
|
||||
],
|
||||
"order": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{'success': True, 'content': {'metadata': {'split_strategy': 'single_document', 'source_documents': [], 'extraction_method': 'ai_generation', 'title': 'Memo Analysis Report Summary'}, 'documents': [{'id': 'doc_1', 'title': 'Memo Analysis Report Summary', 'filename': 'memo_analysis_summary.json', 'sections': [{'id': 'section_heading_key_insights', 'content_type': 'heading', 'elements': [{'level': 1, 'text': 'Key Insights'}], 'order': 0}, {'id': 'section_paragraph_summary', 'content_type': 'paragraph', 'elements': [{'text': "The memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency."}], 'order': 1}, {'id': 'section_bullet_list_insights', 'content_type': 'bullet_list', 'elements': [{'items': ['Conventional Structure: The memo follows a traditional format with sections for introduction, detailed analysis, and conclusion, ensuring clarity and consistency.', 'Placeholder Nature: The document is labeled as a placeholder, indicating flexibility and adaptability in content creation.', 'Encouragement of Feedback: The memo invites feedback from employees, promoting open communication and a collaborative environment.']}], 'order': 2}]}]}, 'documents': [{'documentName': 'memo_analysis_summary.json', 'documentData': "Memo Analysis Report Summary\n============================\n\nKey Insights\n============\n\nThe memo analysis report, dated October 10, 2023, emphasizes the importance of a structured approach to official communications within the organization. It serves as a template for future content, highlighting the organization's dedication to clarity and consistency.\n\n\nGenerated: 2025-11-27 11:41:46 UTC", 'mimeType': 'text/plain', 'title': 'Memo Analysis Report Summary'}], 'is_multi_file': False, 'format': 'txt', 'title': 'Memo Analysis Report Summary', 'split_strategy': 'single', 'total_documents': 1, 'processed_documents': 1}
|
||||
|
||||
=== DOCUMENT LIST FOR TRACING ===
|
||||
Document 1: {'id': 'doc_1', 'title': 'Memo Analysis Report Summary', 'filename': 'memo_analysis_summary.json', '...
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
TASK VALIDATION
|
||||
|
||||
TASK OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
EXPECTED DATA TYPE: unknown
|
||||
EXPECTED FORMATS: ['pdf', 'docx', 'xlsx', 'txt', 'json', 'csv', 'html', 'md']
|
||||
SUCCESS CRITERIA (2 items): ["The task fully addresses the user's main objective", "The deliverable meets the user's expectations and requirements"]
|
||||
ACTION THAT CREATED DOCUMENTS: ai.summarizeDocument
|
||||
|
||||
VALIDATION RULES:
|
||||
IMPORTANT: You only have document METADATA (filename, format, size, mimeType) - NOT document content.
|
||||
Validate based on metadata only:
|
||||
1. Check if filenames are APPROXIMATELY meaningful (generic names like "generated.docx" are acceptable if format matches)
|
||||
2. Check if delivered formats are compatible with expected format
|
||||
3. Check if document sizes are reasonable for the task objective
|
||||
4. Assess if filename and size combination suggests correct data type
|
||||
5. Rate overall quality (0.0-1.0) based on metadata indicators, with format matching being the most important
|
||||
6. Identify specific gaps based on what the user requested (infer from filename, size, format - NOT content)
|
||||
|
||||
OUTPUT FORMAT - JSON ONLY (no prose):
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.0,
|
||||
"dataTypeMatch": false,
|
||||
"formatMatch": false,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false][false],
|
||||
"gapAnalysis": "Describe what is missing or incorrect based on filename, size, format metadata",
|
||||
"improvementSuggestions": ["General action to improve overall result"],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "document.ext",
|
||||
"issues": ["Issue inferred from metadata (e.g., filename doesn't match task, size too small for objective)"],
|
||||
"suggestions": ["Specific fix based on metadata analysis"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Field explanations:
|
||||
- "improvementSuggestions": Overall actions to improve the entire result (general, high-level)
|
||||
- "validationDetails[].suggestions": Specific fixes for each document's individual issues (document-specific, detailed)
|
||||
- Do NOT use prefixes like "NEXT STEP:" - describe actions directly
|
||||
|
||||
DELIVERED DOCUMENTS (2 items):
|
||||
[
|
||||
{
|
||||
"name": "memo_analysis_summary.json",
|
||||
"mimeType": "text/plain",
|
||||
"format": "json",
|
||||
"size": "390.0 B"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"format": "json",
|
||||
"size": "1.3 KB"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
```json
|
||||
{
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.5,
|
||||
"dataTypeMatch": true,
|
||||
"formatMatch": true,
|
||||
"documentCount": 2,
|
||||
"successCriteriaMet": [false, false],
|
||||
"gapAnalysis": "The filenames suggest summaries or structured content, which might align with summarization tasks. However, the size of 'memo_analysis_summary.json' is very small, which may indicate insufficient content for a comprehensive summary. The formats are correct, but the small size raises concerns about the completeness of the task objective.",
|
||||
"improvementSuggestions": ["Ensure that the summarized content is comprehensive enough to meet the user's main objective, possibly by increasing the document size or content detail."],
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "memo_analysis_summary.json",
|
||||
"issues": ["Size too small for a potentially comprehensive summary."],
|
||||
"suggestions": ["Increase the content detail or length to ensure a thorough summary."]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": [],
|
||||
"suggestions": []
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
75
logs/debug/prompts/20251127-114155-087-refinement_prompt.txt
Normal file
75
logs/debug/prompts/20251127-114155-087-refinement_prompt.txt
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
TASK DECISION
|
||||
|
||||
OBJECTIVE: 'Complete the user's main business objective as specified in their request.'
|
||||
|
||||
DECISION RULES:
|
||||
1. "continue" = objective NOT fulfilled
|
||||
2. "stop" = objective fulfilled
|
||||
3. Return ONLY JSON - no other text
|
||||
|
||||
OUTPUT FORMAT (only JSON object to deliver):
|
||||
{{
|
||||
"decision": "continue",
|
||||
"reason": "Brief reason for decision"
|
||||
}}
|
||||
|
||||
OBSERVATION: {
|
||||
"success": true,
|
||||
"resultLabel": "round1_task1_action3_results",
|
||||
"documentsCount": 2,
|
||||
"previews": [
|
||||
{
|
||||
"name": "memo_analysis_summary.json",
|
||||
"mimeType": "text/plain",
|
||||
"contentSize": "390 characters"
|
||||
},
|
||||
{
|
||||
"name": "structured_content.json",
|
||||
"mimeType": "application/json",
|
||||
"contentSize": "1323 characters"
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"contentValidation": {
|
||||
"overallSuccess": false,
|
||||
"qualityScore": 0.5,
|
||||
"documentCount": 2,
|
||||
"validationDetails": [
|
||||
{
|
||||
"documentName": "memo_analysis_summary.json",
|
||||
"issues": [
|
||||
"Size too small for a potentially comprehensive summary."
|
||||
],
|
||||
"suggestions": [
|
||||
"Increase the content detail or length to ensure a thorough summary."
|
||||
]
|
||||
},
|
||||
{
|
||||
"documentName": "structured_content.json",
|
||||
"issues": [],
|
||||
"suggestions": []
|
||||
}
|
||||
],
|
||||
"improvementSuggestions": [
|
||||
"Ensure that the summarized content is comprehensive enough to meet the user's main objective, possibly by increasing the document size or content detail."
|
||||
],
|
||||
"schemaCompliant": true,
|
||||
"originalType": "json",
|
||||
"missingFields": []
|
||||
},
|
||||
"contentAnalysis": {}
|
||||
}
|
||||
|
||||
CONTENT VALIDATION:
|
||||
Overall Success: False
|
||||
Quality Score: 0.50
|
||||
Improvement Suggestions: Ensure that the summarized content is comprehensive enough to meet the user's main objective, possibly by increasing the document size or content detail.
|
||||
|
||||
PROGRESS STATE:
|
||||
Completed Objectives: 0
|
||||
Partial Achievements: 3
|
||||
Failed Attempts: 0
|
||||
Current Phase: partial
|
||||
Next Action Suggestions: Build on partial achievements, Ensure the filenames and formats align with a singular business objective and expected data type., Ensure that document sizes are reasonable for the task objective and that mimeTypes are consistent with the document formats., Ensure that the summarized content is comprehensive enough to meet the user's main objective, possibly by increasing the document size or content detail.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
```json
|
||||
{
|
||||
"decision": "continue",
|
||||
"reason": "The content validation indicates that the summarized content is not comprehensive enough to meet the user's main objective, and improvements are needed."
|
||||
}
|
||||
```
|
||||
100
logs/debug/prompts/20251127-114158-089-actionplan_prompt.txt
Normal file
100
logs/debug/prompts/20251127-114158-089-actionplan_prompt.txt
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
Select exactly one next action to advance the task incrementally.
|
||||
|
||||
OVERALL TASK CONTEXT:
|
||||
Test
|
||||
|
||||
OBJECTIVE:
|
||||
Complete the user's main business objective as specified in their request.
|
||||
|
||||
AVAILABLE_DOCUMENTS_SUMMARY:
|
||||
6 documents available from previous tasks
|
||||
|
||||
AVAILABLE_METHODS:
|
||||
{
|
||||
"ai.analyzeDocuments": "\n GENERAL:\n - Purpose: Analyze documents and find insights, patterns, trends, and key information.\n - Input requirements: documentList (required); optional analysisType, focus.\n - Output format: Analysis report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Document(s) to analyze.\n - analysisType (str, optional): Type of analysis - general, financial, technical, sentiment, etc. Default: general.\n - focus (str, optional): Specific aspect to focus on (e.g., \"trends\", \"risks\", \"opportunities\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.compareDocuments": "\n GENERAL:\n - Purpose: Compare multiple documents and identify differences, similarities, and changes.\n - Input requirements: documentList (required, should contain 2+ documents); optional comparisonType, focus.\n - Output format: Comparison report in specified format (default: txt).\n\n Parameters:\n - documentList (list, required): Two or more documents to compare.\n - comparisonType (str, optional): Type of comparison - differences, similarities, changes, full. Default: full.\n - focus (str, optional): Specific aspect to focus on (e.g., \"content\", \"structure\", \"data\", \"formatting\").\n - resultType (str, optional): Output format (txt, md, docx, json, etc.). Default: txt.\n ",
|
||||
"ai.convertDocument": "\n GENERAL:\n - Purpose: Convert documents between different formats (PDF→Word, Excel→CSV, etc.).\n - Input requirements: documentList (required); targetFormat (required).\n - Output format: Document in target format.\n\n Parameters:\n - documentList (list, required): Document reference(s) to convert.\n - targetFormat (str, required): Target format extension (docx, pdf, xlsx, csv, txt, html, json, md, etc.).\n - preserveStructure (bool, optional): Whether to preserve document structure (headings, tables, etc.). Default: True.\n ",
|
||||
"ai.extractData": "\n GENERAL:\n - Purpose: Extract structured data from documents (key-value pairs, entities, facts, etc.).\n - Input requirements: documentList (required); optional dataStructure, fields.\n - Output format: JSON by default, or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract data from.\n - dataStructure (str, optional): Desired data structure - flat, nested, or list. Default: nested.\n - fields (list, optional): Specific fields/properties to extract (e.g., [\"name\", \"date\", \"amount\"]).\n - resultType (str, optional): Output format (json, csv, xlsx, etc.). Default: json.\n ",
|
||||
"ai.extractTables": "\n GENERAL:\n - Purpose: Extract tables from documents, preserving structure and data.\n - Input requirements: documentList (required); optional tableFormat.\n - Output format: JSON by default (structured table data), or CSV/XLSX if specified.\n\n Parameters:\n - documentList (list, required): Document reference(s) to extract tables from.\n - tableFormat (str, optional): Output format for tables - json, csv, or xlsx. Default: json.\n - includeHeaders (bool, optional): Include table headers. Default: True.\n ",
|
||||
"ai.generateChart": "\n GENERAL:\n - Purpose: Generate charts/graphs from data in documents or structured data.\n - Input requirements: documentList (required); optional chartType, title, labels.\n - Output format: Image (png or jpg).\n\n Parameters:\n - documentList (list, required): Documents containing data to visualize (CSV, Excel, JSON, etc.).\n - chartType (str, optional): Type of chart - bar, line, pie, scatter, area, etc. Default: bar.\n - title (str, optional): Chart title.\n - xAxisLabel (str, optional): X-axis label.\n - yAxisLabel (str, optional): Y-axis label.\n - resultType (str, optional): Image format (png or jpg). Default: png.\n ",
|
||||
"ai.generateDocument": "\n GENERAL:\n - Purpose: Generate documents from scratch or based on templates/inputs.\n - Input requirements: prompt or description (required); optional documentList (for templates/references).\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - prompt (str, required): Description of the document to generate.\n - documentList (list, optional): Template documents or reference documents to use as a guide.\n - documentType (str, optional): Type of document - letter, memo, proposal, contract, etc.\n - resultType (str, optional): Output format (docx, pdf, txt, md, etc.). Default: docx.\n ",
|
||||
"ai.generateReport": "\n GENERAL:\n - Purpose: Generate comprehensive reports from input documents/data with analysis and insights.\n - Input requirements: documentList (optional, can generate from scratch); optional reportType, sections.\n - Output format: Document in specified format (default: docx).\n\n Parameters:\n - documentList (list, optional): Input documents/data to base the report on.\n - reportType (str, optional): Type of report - summary, analysis, executive, detailed. Default: analysis.\n - sections (list, optional): Specific sections to include (e.g., [\"introduction\", \"findings\", \"recommendations\"]).\n - title (str, optional): Report title.\n - resultType (str, optional): Output format (docx, pdf, md, etc.). Default: docx.\n ",
|
||||
"ai.process": "\n GENERAL:\n - Purpose: Universal AI document processing action - accepts MULTIPLE input documents in ANY format (docx, pdf, json, txt, xlsx, html, images, etc.) and processes them together with a prompt to produce MULTIPLE output documents in ANY specified format (via resultType). Use for document generation, format conversion, content transformation, analysis, summarization, translation, extraction, comparison, and any AI-powered document manipulation.\n - Input requirements: aiPrompt (required); optional documentList (can contain multiple documents in any format).\n - Output format: Multiple documents in the same format per call (via resultType: txt, json, pdf, docx, xlsx, pptx, png, jpg, etc.). The AI can generate multiple files based on the prompt (e.g., \"create separate documents for each section\"). Default: txt.\n - Key capabilities: Can process any number of input documents together, extract data from mixed formats, combine information, generate multiple output files, transform between formats, perform analysis/comparison/summarization on document sets.\n\n Parameters:\n - aiPrompt (str, required): Instruction for the AI describing what processing to perform.\n - documentList (list, optional): Document reference(s) in any format to use as input/context.\n - resultType (str, optional): Output file extension (txt, json, md, csv, xml, html, pdf, docx, xlsx, png, etc.). All output documents will use this format. Default: txt.\n ",
|
||||
"ai.summarizeDocument": "\n GENERAL:\n - Purpose: Summarize one or more documents, extracting key points and main ideas.\n - Input requirements: documentList (required); optional summaryLength, focus.\n - Output format: Text document with summary (default: txt, can be overridden with resultType).\n\n Parameters:\n - documentList (list, required): Document reference(s) to summarize.\n - summaryLength (str, optional): Desired summary length - brief, medium, or detailed. Default: medium.\n - focus (str, optional): Specific aspect to focus on in the summary (e.g., \"financial data\", \"key decisions\").\n - resultType (str, optional): Output file extension (txt, md, docx, etc.). Default: txt.\n ",
|
||||
"ai.translateDocument": "\n GENERAL:\n - Purpose: Translate documents to a target language while preserving formatting and structure.\n - Input requirements: documentList (required); targetLanguage (required).\n - Output format: Translated document in same format as input (default) or specified resultType.\n\n Parameters:\n - documentList (list, required): Document reference(s) to translate.\n - targetLanguage (str, required): Target language code or name (e.g., \"de\", \"German\", \"French\", \"es\").\n - sourceLanguage (str, optional): Source language if known (e.g., \"en\", \"English\"). If not provided, AI will detect.\n - preserveFormatting (bool, optional): Whether to preserve original formatting. Default: True.\n - resultType (str, optional): Output file extension. If not specified, uses same format as input.\n ",
|
||||
"ai.validateData": "\n GENERAL:\n - Purpose: Validate data quality, structure, completeness, and correctness in documents/data files.\n - Input requirements: documentList (required); optional validationRules, schema.\n - Output format: Validation report in JSON or text format (default: json).\n\n Parameters:\n - documentList (list, required): Documents/data files to validate.\n - validationRules (list, optional): Specific validation rules to check (e.g., [\"required_fields\", \"data_types\", \"ranges\"]).\n - schema (dict, optional): Expected data schema/structure to validate against.\n - resultType (str, optional): Output format (json, txt, md, etc.). Default: json.\n ",
|
||||
"ai.webResearch": "\n GENERAL:\n - Purpose: Web research with two-step process: search for URLs, then crawl content.\n - Input requirements: prompt (required); optional list(url), country, language, researchDepth.\n - Output format: JSON with research results including URLs and content.\n\n Parameters:\n - prompt (str, required): Natural language research instruction.\n - urlList (list, optional): Specific URLs to crawl, if needed.\n - country (str, optional): Two-digit country code (lowercase, e.g., ch, us, de).\n - language (str, optional): Language code (lowercase, e.g., de, en, fr).\n - researchDepth (str, optional): Research depth - fast, general, or deep. Default: general.\n ",
|
||||
"outlook.composeAndDraftEmailWithContext": "\n GENERAL:\n - Purpose: Compose email content using AI from context and optional documents, then create a draft.\n - Input requirements: connectionReference (required); to (required); context (required); optional documentList, cc, bcc, emailStyle, maxLength.\n - Output format: JSON confirmation with AI-generated draft metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - to (list, required): Recipient email addresses.\n - context (str, required): Detailled context for composing the email.\n - documentList (list, optional): Document references for context/attachments.\n - cc (list, optional): CC recipients.\n - bcc (list, optional): BCC recipients.\n - emailStyle (str, optional): formal | casual | business. Default: business.\n - maxLength (int, optional): Maximum length for generated content. Default: 1000.\n ",
|
||||
"outlook.readEmails": "\n GENERAL:\n - Purpose: Read emails and metadata from a mailbox folder.\n - Input requirements: connectionReference (required); optional folder, limit, filter, outputMimeType.\n - Output format: JSON with emails and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - folder (str, optional): Folder to read from. Default: Inbox.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - filter (str, optional): Sender, query operators, or subject text.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.searchEmails": "\n GENERAL:\n - Purpose: Search emails by query and return matching items with metadata.\n - Input requirements: connectionReference (required); query (required); optional folder, limit, outputMimeType.\n - Output format: JSON with search results and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - query (str, required): Search expression.\n - folder (str, optional): Folder scope or All. Default: All.\n - limit (int, optional): Maximum items to return. Must be > 0. Default: 1000.\n - outputMimeType (str, optional): MIME type for output file. Options: \"application/json\" (default), \"text/plain\", \"text/csv\". Default: \"application/json\".\n ",
|
||||
"outlook.sendDraftEmail": "\n GENERAL:\n - Purpose: Send draft email(s) using draft email JSON document(s) from action outlook.composeAndDraftEmailWithContext.\n - Input requirements: connectionReference (required); documentList with draft email JSON documents (required).\n - Output format: JSON confirmation with sent mail metadata for all emails.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - documentList (list, required): Document reference(s) to draft emails in JSON format (outputs from outlook.composeAndDraftEmailWithContext function).\n ",
|
||||
"sharepoint.findDocumentPath": "\n GENERAL:\n - Purpose: Find documents and folders by name/path across sites.\n - Input requirements: connectionReference (required); searchQuery (required); optional site, maxResults.\n - Output format: JSON with found items and paths.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - site (str, optional): Site hint.\n - searchQuery (str, required): Search terms or path.\n - maxResults (int, optional): Maximum items to return. Default: 100.\n ",
|
||||
"sharepoint.listDocuments": "\n GENERAL:\n - Purpose: List documents and folders in SharePoint paths across sites.\n - Input requirements: connectionReference (required); optional pathObject or pathQuery; includeSubfolders.\n - Output format: JSON with folder items and metadata.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Path query if no pathObject.\n - includeSubfolders (bool, optional): Include one level of subfolders. Default: False.\n ",
|
||||
"sharepoint.readDocuments": "\n GENERAL:\n - Purpose: Read documents from SharePoint and extract content/metadata.\n - Input requirements: connectionReference (required); optional documentList, pathObject, or pathQuery; includeMetadata.\n - Output format: Standardized ActionDocument format (documentName, documentData, mimeType).\n - Binary files (PDFs, etc.) are Base64-encoded in documentData.\n - Text files are stored as plain text in documentData.\n - Returns ActionResult with documents list for template processing.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result (from findDocumentPath).\n - documentList (list, optional): Document list reference(s) to read (backward compatibility).\n - pathQuery (str, optional): Path query if no pathObject (backward compatibility).\n - includeMetadata (bool, optional): Include metadata. Default: True.\n \n Returns:\n - ActionResult with documents: List[ActionDocument] where each ActionDocument contains:\n - documentName: File name\n - documentData: Base64-encoded content (binary files) or plain text (text files)\n - mimeType: MIME type (e.g., application/pdf, text/plain)\n ",
|
||||
"sharepoint.uploadDocument": "\n GENERAL:\n - Purpose: Upload documents to SharePoint. Only to choose this action with a connectionReference\n - Input requirements: connectionReference (required); documentList (required); optional pathObject or pathQuery.\n - Output format: JSON with upload status and file info.\n\n Parameters:\n - connectionReference (str, required): Microsoft connection label.\n - pathObject (str, optional): Reference to a previous path result.\n - pathQuery (str, optional): Upload target path if no pathObject.\n - documentList (list, required): Document reference(s) to upload. File names are taken from the documents.\n "
|
||||
}
|
||||
|
||||
WORKFLOW_HISTORY (reverse-chronological, enriched):
|
||||
- Round 1: 2 docs (memo_analysis_summary.txt, structured_content_2.json) label='round1_task1_action3_results' | success=Unknown | msg='**Action 3 (ai.summarizeDocument)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
- Round 1: 2 docs (memo_analysis_report.txt, structured_content_1.json) label='round1_task1_action2_results' | success=Unknown | msg='**Action 2 (ai.analyzeDocuments)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
- Round 1: 2 docs (test_document_memo.docx, structured_content.json) label='round1_task1_action1_results' | success=Unknown | msg='**Action 1 (ai.generateDocument)** ✅ This task will accomplish the entire business objective you have requested.'
|
||||
Available documents: 6
|
||||
|
||||
AVAILABLE_DOCUMENTS_INDEX:
|
||||
|
||||
Current round documents:
|
||||
- docList:round1_task1_action3_results contains:
|
||||
- docItem:04546e10-67f0-4e89-aecf-67e6261ab919:memo_analysis_summary.txt
|
||||
- docItem:05e4eb1c-451f-4a88-b96b-3767ba13a8b5:structured_content_2.json
|
||||
- docList:round1_task1_action2_results contains:
|
||||
- docItem:937cbc15-3df6-45b7-8d24-80964746a4be:memo_analysis_report.txt
|
||||
- docItem:b129c6dc-f9ac-45de-9789-7ca73002d314:structured_content_1.json
|
||||
- docList:round1_task1_action1_results contains:
|
||||
- docItem:08c7d2e7-e3ac-44c6-b305-2696f7de627a:test_document_memo.docx
|
||||
- docItem:da1fa51f-68d2-41f1-bc25-aaff26beaab7:structured_content.json
|
||||
|
||||
|
||||
|
||||
AVAILABLE_CONNECTIONS_INDEX:
|
||||
No connections available
|
||||
|
||||
LEARNING-BASED GUIDANCE:
|
||||
No previous failures detected. Proceed with standard approach.
|
||||
|
||||
FAILURE ANALYSIS:
|
||||
{}
|
||||
|
||||
ESCALATION LEVEL: low
|
||||
|
||||
REPLY: Return ONLY a JSON object with the following structure (no comments, no extra text). The chosen action MUST:
|
||||
- be the next logical incremental step toward fulfilling the objective
|
||||
- not attempt to complete the entire objective in one step
|
||||
- if producing files, target exactly one output format for this step
|
||||
- reference ONLY existing document IDs/labels from AVAILABLE_DOCUMENTS_INDEX
|
||||
- learn from previous validation feedback and avoid repeated mistakes
|
||||
{{
|
||||
"action": "method.action_name",
|
||||
"actionObjective": "...",
|
||||
"learnings": ["..."],
|
||||
"requiredInputDocuments": ["docList:..."],
|
||||
"requiredConnection": "connection:..." | null,
|
||||
"parametersContext": "concise text that Stage 2 will use to set business parameters"
|
||||
}}
|
||||
|
||||
EXAMPLE how to assign references from AVAILABLE_DOCUMENTS_INDEX and AVAILABLE_CONNECTIONS_INDEX:
|
||||
"requiredInputDocuments": ["docList:msg_47a7a578-e8f2-4ba8-ac66-0dbff40605e0:round8_task1_action1_results","docItem:5d8b7aee-b546-4487-b6a8-835c86f7b186:AI_Generated_Document_20251006-104256.docx"],
|
||||
"requiredConnection": "connection:msft:p.motsch@valueon.ch",
|
||||
|
||||
RULES:
|
||||
1. Use EXACT action names from AVAILABLE_METHODS
|
||||
2. Do NOT output a "parameters" object
|
||||
3. parametersContext must be short and sufficient for Stage 2
|
||||
4. Return ONLY JSON - no markdown, no explanations
|
||||
5. For requiredInputDocuments, use ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (docList:... or docItem:...)
|
||||
- DO NOT invent or modify Message IDs
|
||||
- DO NOT create new references
|
||||
- Copy references EXACTLY as shown in AVAILABLE_DOCUMENTS_INDEX
|
||||
6. For requiredConnection, use ONLY an exact label from AVAILABLE_CONNECTIONS_INDEX
|
||||
7. Plan incrementally: if the overall intent needs multiple output formats (e.g., CSV and HTML), choose one format in this step and leave the other(s) for subsequent steps
|
||||
8. CRITICAL: Learn from previous validation feedback - avoid repeating the same mistakes
|
||||
9. If previous attempts failed, consider alternative approaches or more specific parameters
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue