# truthseeker-add-agent > Dodaj nowego agenta do systemu TruthSeeker - szablon i integracja z orchestratorem - Author: Trzyb - Repository: XMadMaro/Synek-co-godo-prawda-ale-odyn-go-nie-s-ucho- - Version: 20260131214138 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/XMadMaro/Synek-co-godo-prawda-ale-odyn-go-nie-s-ucho- - Web: https://mule.run/skillshub/@@XMadMaro/Synek-co-godo-prawda-ale-odyn-go-nie-s-ucho-~truthseeker-add-agent:20260131214138 --- --- name: truthseeker-add-agent description: Dodaj nowego agenta do systemu TruthSeeker - szablon i integracja z orchestratorem license: MIT compatibility: Python 3.11+ metadata: author: user version: "1.0" language: pl project: truthseeker --- Dodaj nowego agenta do systemu TruthSeeker. **Input**: Nazwa agenta i jego odpowiedzialność **Steps** 1. **Określ rolę agenta** Zdefiniuj: - Nazwa (kebab-case): np. `fact-checker` - Klasa Python (PascalCase): np. `FactChecker` - Odpowiedzialność: Co robi agent? - Dane wejściowe: Co otrzymuje? - Dane wyjściowe: Co zwraca? 2. **Utwórz plik agenta** ```bash cd c:\Users\Trzyb\Desktop\truthseeker\src\agents ``` Utwórz `.py` z szablonem: ```python """ Agent Odpowiedzialność: """ import logging from dataclasses import dataclass from typing import Optional from src.core.config import settings from src.infrastructure.llm_client import LLMClient logger = logging.getLogger(__name__) @dataclass class Input: """Dane wejściowe dla agenta.""" # Zdefiniuj pola wejściowe pass @dataclass class Output: """Wynik pracy agenta.""" success: bool # Zdefiniuj pola wyjściowe error: Optional[str] = None class : """ Agent w systemie TruthSeeker. """ def __init__(self): self.llm = LLMClient() logger.info(f"Zainicjalizowano agenta ") async def process(self, input_data: Input) -> Output: """ Główna metoda przetwarzania. Args: input_data: Dane wejściowe Returns: Output z wynikiem """ try: logger.info(f"Rozpoczynam przetwarzanie: {input_data}") # TODO: Implementacja logiki agenta return Output(success=True) except Exception as e: logger.error(f"Błąd agenta: {e}") return Output(success=False, error=str(e)) ``` 3. **Dodaj System Prompt** Dodaj prompt do `truthseeker_prompts.md`: ```markdown ## X. Prompt Systemowy dla Agenta ### Definicja Roli ### Zasady Działania ### Oczekiwany Wynik ``` 4. **Zarejestruj w Orchestratorze** Edytuj `src/agents/orchestrator.py`: ```python from src.agents. import class Orchestrator: def __init__(self): # ... istniejący kod ... self. = () ``` 5. **Dodaj testy** Utwórz `tests/test_.py`: ```python import pytest from src.agents. import , Input @pytest.mark.asyncio async def test__basic(): agent = () result = await agent.process(Input(...)) assert result.success ``` 6. **Zaktualizuj dokumentację** Edytuj `agents.md` - dodaj nowego agenta do listy. Edytuj `architecture.md` - dodaj do diagramu. **Guardrails** - Każdy agent ma jedną odpowiedzialność (SRP) - Agent musi mieć Input i Output dataclass - Agent musi logować swoje działania - Agent musi obsługiwać błędy gracefully - Agent musi mieć System Prompt w dokumentacji