Skip to content

πŸ—ΊοΈ Codebase Overview

Welcome to the Siyarix codebase! This document serves as a quick tour of the project structure and core modules. Siyarix started as a personal passion project to explore AI-native orchestration, and it's continuously growing thanks to active development.

Tip

If you are new to the codebase, I recommend starting with the Agent Orchestrator (core/) and Interactive Chat (chat/) modules, as they form the core experience!

πŸ“‚ Directory Structure

Siyarix lives under the src/siyarix/ directory. Here is the layout:

src/siyarix/
β”œβ”€β”€ __init__.py              # Public API
β”œβ”€β”€ __main__.py              # Entry point for `python -m siyarix`
β”œβ”€β”€ main.py                  # Legacy entry point
β”‚
β”œβ”€β”€ cli/
β”‚   └── __init__.py          # Main Typer CLI app
β”‚
β”œβ”€β”€ chat/                    # πŸ’¬ Interactive REPL system
β”‚   β”œβ”€β”€ engine.py            # LLMEngineMixin
β”‚   β”œβ”€β”€ repl.py              # SiyarixChat: prompt_toolkit REPL
β”‚   β”œβ”€β”€ handlers.py          # Slash command handlers
β”‚   β”œβ”€β”€ openai_compat.py     # Adapter for AI providers
β”‚   └── ...
β”‚
β”œβ”€β”€ core/                    # 🧠 Agent Orchestration Kernel
β”‚   β”œβ”€β”€ __init__.py          # AgentCore
β”‚   β”œβ”€β”€ pipeline.py          # CommandPipeline
β”‚   └── swarm.py             # SwarmRouter
β”‚
β”œβ”€β”€ providers/               # ☁️ Multi-Provider LLM Abstraction Layer
β”‚   β”œβ”€β”€ manager.py           # Registration and management
β”‚   β”œβ”€β”€ state.py             # Cooldowns and caching
β”‚   └── profiles/            # Provider profiles (OpenAI, Gemini, Ollama, etc.)
β”‚
β”œβ”€β”€ parsers/                 # πŸ” Tool Output Parser Subsystem
β”‚   β”œβ”€β”€ __init__.py          # ParserRegistry
β”‚   β”œβ”€β”€ nmap_parser.py       # Nmap XML/text parser
β”‚   └── ...
β”‚
β”œβ”€β”€ output/                  # 🎨 Output Engine
β”‚   └── __init__.py          # Renders formats (JSON, YAML, HTML, etc.)
β”‚
β”œβ”€β”€ report/                  # πŸ“Š Reporting
β”‚   └── __init__.py          # Generates reports in MARKDOWN, HTML, JSON
β”‚
β”œβ”€β”€ plugins/                 # πŸ”Œ Dynamic Plugin Architecture
β”œβ”€β”€ templates/               # πŸ“ UI Templates and ASCII Art
β”œβ”€β”€ data/                    # πŸ—„οΈ Static assets
β”œβ”€β”€ offline_registry/        # πŸ“΄ Offline heuristic planning subsystem
β”‚
└── Root-Level Modules:
    β”œβ”€β”€ audit_log.py         # Audit trails
    β”œβ”€β”€ credential_store.py  # Encrypted credential vault
    β”œβ”€β”€ deep_scan.py         # Reconnaissance engine
    β”œβ”€β”€ learning_system.py   # Basic learning from executions
    β”œβ”€β”€ opsec.py             # Basic OPSEC controls
    β”œβ”€β”€ permission_gate.py   # Command permission control
    β”œβ”€β”€ workflow.py          # Workflow engine
    └── ...

πŸ—οΈ Key Subsystems

🧠 Agent Orchestrator (core/)

AgentCore is the brain of Siyarix. It dispatches tasks across four operational modes: - REGISTRY (heuristic-based) - AUTONOMOUS (LLM-driven) - HYBRID (combined) - INTERACTIVE (chat-driven)

πŸ’¬ Chat & REPL (chat/)

Our interactive shell is built on prompt_toolkit, featuring a split-pane layout and context-aware autocomplete. The LLMEngineMixin runs the agent loop.

☁️ Provider Layer (providers/)

Siyarix abstracts various AI providers through a unified adapter (openai_compat.py). The ProviderManager handles failover and backoff, so things keep running if an API goes down.

πŸ” Parser System (parsers/)

The ParserRegistry discovers tool parsers at import time. Each parser implements the Parser protocol, mapping raw tool output to structured data.

πŸ›‘οΈ Security Layer (Root Modules)

Siyarix includes some neat security features: - PermissionGate: A review stage before running commands. - DLP Engine: Tries to mask sensitive data patterns. - CredentialStore: Secures API keys locally. - AuditLogger: Keeps a log of actions.

🎨 Output & Reporting (output/, report/)

The OutputEngine supports multiple formats and themes, and the ReportEngine compiles assessments into Markdown or HTML.

Implemented Features vs. Stubs

Siyarix is a growing project. While features like MultiWaveExecution and BudgetChecking are active, some features listed in chat/stubs.py are placeholders designed for future expansion as I continue building out the tool.

πŸ“ Development Conventions

To keep the codebase manageable, I try to follow these standards: - Type Hints: Encouraged on public APIs. - Async First: asyncio is used extensively. - Structured Data: Using Python dataclasses for representing findings. - Error Handling: Use SiyarixException instead of bare except: blocks. - Logging: Standard Python logging (logging.getLogger(__name__)). - Testing: We rely on pytest. Let's try to keep coverage up! - Linting: Using Ruff for formatting and linting.