Compare commits

..

10 Commits

Author SHA1 Message Date
Paweł Domański 9afd601aaf Jul 10, 2026, 9:00 AM 2026-07-10 07:00:15 +00:00
Paweł Domański 568bd6f257 Jul 10, 2026, 8:58 AM 2026-07-10 06:58:22 +00:00
Paweł Domański 718c39279d Jul 10, 2026, 8:57 AM 2026-07-10 06:57:14 +00:00
Paweł Domański 8723bd8a87 Jul 10, 2026, 8:55 AM 2026-07-10 06:55:07 +00:00
Paweł Domański eebf6e8b00 Jul 10, 2026, 8:53 AM 2026-07-10 06:53:38 +00:00
Paweł Domański 2b06a6e861 Jul 10, 2026, 8:51 AM 2026-07-10 06:51:20 +00:00
Paweł Domański a55420b8f4 Jul 3, 2026, 11:23 AM 2026-07-03 09:23:46 +00:00
Paweł Domański 03cad97b75 Jul 2, 2026, 9:43 AM 2026-07-02 07:43:37 +00:00
Paweł Domański bd4564ff58 Jul 2, 2026, 9:40 AM 2026-07-02 07:40:50 +00:00
Paweł Domański 1542c34779 Jul 2, 2026, 9:39 AM 2026-07-02 07:39:13 +00:00
3 changed files with 379 additions and 13 deletions
+351
View File
@@ -0,0 +1,351 @@
# Architektura agenta
Poniżej Mermaid dla architektury **hub-and-spoke** z obrazka — wersja bez `<br/>`, żeby uniknąć błędu `splitLineToFitWidth does not support newlines in the line`.
```mermaid
flowchart LR
Coordinator["Coordinator - routes and handles errors"]
Research["Research agent"]
Writer["Writer agent"]
Coder["Coder agent"]
Reviewer["Reviewer agent"]
Summariser["Summariser agent"]
Data["Data agent"]
Planner["Planner agent"]
Coordinator <--> Research
Coordinator <--> Writer
Coordinator <--> Coder
Coordinator <--> Reviewer
Coordinator <--> Summariser
Coordinator <--> Data
Coordinator <--> Planner
classDef coordinator fill:#eeeaff,stroke:#8b7bd8,stroke-width:1.5px,color:#3f3a73;
classDef agent fill:#ddf7f0,stroke:#7bb8a6,stroke-width:1.5px,color:#18584c;
class Coordinator coordinator;
class Research,Writer,Coder,Reviewer,Summariser,Data,Planner agent;
```
Wersja z opisem zasad z lewej strony jako osobne węzły:
```mermaid
flowchart LR
Rules["Hub-and-spoke architecture - one coordinator at the center; subagents talk only to coordinator"]
Ownership["Coordinator owns routing, context sharing, and error handling"]
Coordinator["Coordinator - routes and handles errors"]
Research["Research agent"]
Writer["Writer agent"]
Coder["Coder agent"]
Reviewer["Reviewer agent"]
Summariser["Summariser agent"]
Data["Data agent"]
Planner["Planner agent"]
Rules --> Coordinator
Ownership --> Coordinator
Coordinator <--> Research
Coordinator <--> Writer
Coordinator <--> Coder
Coordinator <--> Reviewer
Coordinator <--> Summariser
Coordinator <--> Data
Coordinator <--> Planner
classDef coordinator fill:#eeeaff,stroke:#8b7bd8,stroke-width:1.5px,color:#3f3a73;
classDef agent fill:#ddf7f0,stroke:#7bb8a6,stroke-width:1.5px,color:#18584c;
classDef note fill:#ffffff,stroke:#cccccc,stroke-width:1px,color:#222222;
class Coordinator coordinator;
class Research,Writer,Coder,Reviewer,Summariser,Data,Planner agent;
class Rules,Ownership note;
```
I wersja najbardziej kompaktowa do dokumentacji:
```mermaid
flowchart TD
Coordinator["Coordinator"]
Coordinator --> Research["Research agent"]
Coordinator --> Writer["Writer agent"]
Coordinator --> Coder["Coder agent"]
Coordinator --> Reviewer["Reviewer agent"]
Coordinator --> Summariser["Summariser agent"]
Coordinator --> Data["Data agent"]
Coordinator --> Planner["Planner agent"]
Research --> Coordinator
Writer --> Coordinator
Coder --> Coordinator
Reviewer --> Coordinator
Summariser --> Coordinator
Data --> Coordinator
Planner --> Coordinator
```
Kluczowa zasada z obrazka: **nie rysujemy połączeń bezpośrednio między subagentami** — wszystko idzie przez `Coordinator`.
```mermaid
flowchart TD
Decompose["1. Decompose - Break task into subtasks"]
Assess["2. Assess complexity - Which agents are needed?"]
Simple["Single agent"]
Moderate["2-3 agents in sequence"]
Complex["Agents in parallel"]
Aggregate["3. Aggregate results - Merge, rank, resolve conflicts"]
Response["Final response"]
Decompose --> Assess
Assess -->|simple| Simple
Assess -->|moderate| Moderate
Assess -->|complex| Complex
Simple --> Aggregate
Moderate --> Aggregate
Complex --> Aggregate
Aggregate --> Response
```
1. You are a coordinator. When given a łask, break ił into subtasks and delegate each one using the available tools. Do not do the work yourself.
```mermaid
flowchart TD
A["User Request"]
B["1. Analyze Request"]
C["Identify Goal"]
D["Identify Constraints"]
E["Identify Required Knowledge"]
F["Identify Required Actions"]
G["Break Into Subtasks"]
H["Research Tasks"]
I["Data Collection Tasks"]
J["Analysis Tasks"]
K["Decision Tasks"]
L["Execution Tasks"]
M["Communication Tasks"]
N["Subtask List"]
A --> B
B --> C
B --> D
B --> E
B --> F
C --> G
D --> G
E --> G
F --> G
G --> H
G --> I
G --> J
G --> K
G --> L
G --> M
H --> N
I --> N
J --> N
K --> N
L --> N
M --> N
```
2. Access complexity
You are a coordinator. Use your judgment:
- Simple factual questions: use a single agent
- Multi-step tasks: delegate sequentially, passing results forward
- Independent subtasks: delegate in parallel
a. Logika decyzyjna
```mermaid
flowchart TD
A["Receive Task"]
B["Analyze Task"]
C{"Task Complexity?"}
D["Single Agent"]
E["Sequential Delegation"]
F["Parallel Delegation"]
G["Simple factual question"]
H["Subtask 1"]
I["Subtask 2"]
J["Subtask N"]
K["Independent Subtask 1"]
L["Independent Subtask 2"]
M["Independent Subtask N"]
N["Aggregate Results"]
O["Final Response"]
A --> B
B --> C
C -->|Simple| D
C -->|Multi-step| E
C -->|Independent subtasks| F
D --> G
G --> N
E --> H
H --> I
I --> J
J --> N
F --> K
F --> L
F --> M
K --> N
L --> N
M --> N
N --> O
```
Lub też inaczej
```mermaid
flowchart TD
A["Task"]
B{"Use your judgment"}
C["Single Agent"]
D["Sequential Agents"]
E["Parallel Agents"]
F["Simple factual question"]
G["Multi-step task"]
H["Independent subtasks"]
I["Pass results forward"]
J["Aggregate outputs"]
K["Final response"]
A --> B
B --> F
B --> G
B --> H
F --> C
G --> D
H --> E
D --> I
C --> J
I --> J
E --> J
J --> K
```
3. Aggregate results
You have received outputs from multiple agents.
Combine them into a single coherent response.
Resolve any conflicts by preferring the most specific data.
Research output: ${results.research}
Writing output: ${results.writing}
Review feedback: ${results.review}
Dla etapu **"3. Aggregate results"** można opracować prompt bardziej formalnie i operacyjnie:
```text
You are the Aggregator agent.
Your responsibility is to combine outputs from multiple agents into a single coherent response.
Instructions:
1. Review all agent outputs.
2. Identify overlapping information.
3. Remove duplicates and redundancy.
4. Resolve conflicts:
- Prefer the most specific information.
- Prefer data supported by evidence.
- Prefer newer information when timestamps are available.
5. Integrate review feedback into the final result.
6. Preserve important details from every agent.
7. Produce one unified response.
8. Do not mention individual agents unless explicitly requested.
9. Do not perform additional research.
10. Do not introduce new facts not present in the inputs.
Inputs:
Research output:
${results.research}
Writing output:
${results.writing}
Review feedback:
${results.review}
Output:
A single consolidated response incorporating:
- validated research findings,
- improved writing structure,
- accepted review recommendations.
```
Diagram Mermaid dla tego kroku:
```mermaid
flowchart TD
A["Research Output"]
B["Writing Output"]
C["Review Feedback"]
D["Analyze Inputs"]
E["Remove Duplicates"]
F["Resolve Conflicts"]
G["Apply Review Feedback"]
H["Merge Information"]
I["Unified Response"]
A --> D
B --> D
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
```
Jeżeli budujesz system typu **Coordinator → Research → Writing → Review → Aggregate**, to Aggregator jest ostatnim agentem przed zwróceniem odpowiedzi do użytkownika.
+15 -2
View File
@@ -55,8 +55,8 @@ ignore_all_files_in_gitignore: true
# advanced configuration option allowing to configure language server-specific options. # advanced configuration option allowing to configure language server-specific options.
# Maps the language key to the options. # Maps the language key to the options.
# Have a look at the docstring of the constructors of the LS implementations within solidlsp (e.g., for C# or PHP) to see which options are available. # The settings are considered only if the project is trusted (see global configuration to define trusted projects).
# No documentation on options means no options are available. # See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings
ls_specific_settings: {} ls_specific_settings: {}
# list of additional workspace folder paths for cross-package reference support (e.g. in monorepos). # list of additional workspace folder paths for cross-package reference support (e.g. in monorepos).
@@ -131,3 +131,16 @@ read_only_memory_patterns: []
# Extends the list from the global configuration, merging the two lists. # Extends the list from the global configuration, merging the two lists.
# Example: ["_archive/.*", "_episodes/.*"] # Example: ["_archive/.*", "_episodes/.*"]
ignored_memory_patterns: [] ignored_memory_patterns: []
# optional shell command to run before the language backend (LSP or JetBrains) is initialised.
# the command runs in the project root directory and is only executed if the project is trusted
# (see trusted_project_path_patterns in the global configuration).
# serena waits for the command to exit: a non-zero exit code is logged as an error but does not
# abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety
# backstop for non-terminating commands; on expiry the process is killed and activation continues.
# example: activation_command: "npx nx run-many -t build"
activation_command:
# maximum time in seconds to wait for activation_command to complete before killing it (default 180s).
# must be a positive number.
activation_command_timeout: 180.0
+13 -11
View File
@@ -102,29 +102,31 @@ foreach ($folder in $FoldersToProcess) {
$S3Destination = "$S3DestinationParent/$CurrentYear" $S3Destination = "$S3DestinationParent/$CurrentYear"
Write-Host "`n[$(Get-Date -Format 'HH:mm:ss')] Przetwarzanie: $folder ..." -ForegroundColor Yellow Write-Host "`n[$(Get-Date -Format 'HH:mm:ss')] Przetwarzanie: $folder ..." -ForegroundColor Yellow
Write-Host " Sprawdzanie istnienia docelowego folderu na S3: $S3DestinationParent/$CurrentYear/" -ForegroundColor Gray Write-Host " Sprawdzanie struktury docelowej na S3: $S3DestinationParent/" -ForegroundColor Gray
# Walidacja obecności folderu (roku) po stronie S3 za pomocą rclone lsf (wypisuje tylko foldery) # Sprawdzamy czy folder roczny istnieje, wyłącznie w celach informacyjnych.
# W S3 foldery tworzą się same automatycznie w momencie wgrania pierwszego pliku.
$s3Dirs = & $RcloneExePath lsf --dirs-only "$S3DestinationParent/" 2>$null $s3Dirs = & $RcloneExePath lsf --dirs-only "$S3DestinationParent/" 2>$null
if ($s3Dirs -notcontains "$CurrentYear/") { if ($s3Dirs -contains "$CurrentYear/") {
$errMsg = "Brak wymaganego folderu '$CurrentYear/' w lokalizacji '$S3DestinationParent/' na S3. Pomijam transfer." Write-Host " Folder '$CurrentYear/' istnieje na S3. Aktualizowanie danych..." -ForegroundColor Green
Write-Host " Błąd: $errMsg" -ForegroundColor Red } else {
Write-AppEventLog -Type Warning -Id 1002 -Message $errMsg Write-Host " Folder '$CurrentYear/' nie istnieje na S3. Zostanie utworzony automatycznie podczas pierwszego transferu." -ForegroundColor Cyan
$GlobalExitCode = 1
continue
} }
Write-Host " Folder '$CurrentYear/' znaleziony. Rozpoczynam transfer danych..." -ForegroundColor Green
$LogFile = Join-Path $LogDir "rclone_backup_$($folder)_$(Get-Date -Format 'yyyyMMdd_HHmmss').log" $LogFile = Join-Path $LogDir "rclone_backup_$($folder)_$(Get-Date -Format 'yyyyMMdd_HHmmss').log"
# 2, 3, 4. Pokazywanie progresu, wypisywanie plików i logowanie
# --progress (-P) - pokazuje interaktywny pasek postępu i prędkość
# --verbose (-v) - wypisuje nazwy przenoszonych plików
$RcloneArgs = @( $RcloneArgs = @(
"move", $SourceDir, $S3Destination, "move", $SourceDir, $S3Destination,
"--checksum", "--checksum",
"--retries", "5", "--retries", "5",
"--retries-sleep", "15s", "--retries-sleep", "15s",
"--delete-empty-src-dirs", "--delete-empty-src-dirs",
"--log-file=$LogFile", "--progress",
"--log-level=INFO" "--verbose",
"--log-file=$LogFile"
) )
# Uruchomienie rclone # Uruchomienie rclone