Adam v23 Mission Control

./core/__init__.py

No docstring

./core/llm_plugin.py

No docstring

./core/main.py

No docstring

./core/api.py

No docstring

./core/settings.py

No docstring

./core/embeddings/base_embedding_model.py

No docstring

./core/embeddings/models/dummy_embedding_model.py

No docstring

./core/embeddings/models/openai_embedding_model.py

No docstring

./core/system/task_scheduler.py

No docstring

./core/system/data_manager.py

No docstring

./core/system/echo.py

No docstring

./core/system/message_broker.py

No docstring

./core/system/__init__.py

No docstring

./core/system/knowledge_base.py

No docstring

./core/system/resource_manager.py

No docstring

./core/system/memory_consolidator.py

No docstring

./core/system/agent_improvement_pipeline.py

No docstring

./core/system/hybrid_orchestrator.py

No docstring

./core/system/red_teaming_framework.py

No docstring

./core/system/memory_manager.py

No docstring

./core/system/error_handler.py

No docstring

./core/system/repo_graph.py

No docstring

./core/system/kg_cache.py

No docstring

./core/system/agent_orchestrator.py

No docstring

./core/system/plugin_manager.py

No docstring

./core/system/interaction_loop.py

No docstring

./core/system/monitoring.py

No docstring

./core/system/v22_async/async_task.py

No docstring

./core/system/v22_async/async_agent_base.py

No docstring

./core/system/v22_async/workflow.py

No docstring

./core/system/v22_async/async_workflow_manager.py

No docstring

./core/system/v23_graph_engine/cyclical_graph_poc.py

No docstring

./core/system/v23_graph_engine/adaptive_system_poc.py

No docstring

./core/system/reasoning/integrity_monitor.py

Agent Notes: - Role: Principal AI Architect - Module: Reasoning Integrity Monitor - Purpose: Provides defensive grounding for agent reasoning chains. It validates financial constraints, logical consistency, and data existence before actions are executed or reports are finalized. - Philosophy: Financial systems cannot fail silently. Hallucinations in financial advice are unacceptable. This module acts as a 'Logic Gate'. - Future State: Will integrate with Z3 Theorem Prover for formal verification of complex financial contracts.

./core/system/brokers/rabbitmq_client.py

No docstring

./core/system/learning/trace_collector.py

Agent Notes: - Role: Principal AI Architect - Module: Trace Collector & Artisanal Data Synthesizer - Purpose: Captures agent execution traces (Reasoning -> Action -> Outcome) and serializes them into high-quality training datasets (JSONL). - Philosophy: Every interaction is a training example. We move from 'ephemeral' compute to 'persistent' knowledge. - Format: Supports ShareGPT and Standard Instruction formats for DPO/SFT.

./core/agents/fundamental_analyst_agent.py

No docstring

./core/agents/discussion_chair_agent.py

No docstring

./core/agents/geopolitical_risk_agent.py

No docstring

./core/agents/agent_base.py

No docstring

./core/agents/report_generator_agent.py

No docstring

./core/agents/cyclical_reasoning_agent.py

No docstring

./core/agents/__init__.py

No docstring

./core/agents/alternative_data_agent.py

No docstring

./core/agents/legal_agent.py

No docstring

./core/agents/code_alchemist.py

No docstring

./core/agents/financial_modeling_agent.py

No docstring

./core/agents/supply_chain_risk_agent.py

No docstring

./core/agents/lingua_maestro.py

No docstring

./core/agents/rag_agent.py

No docstring

./core/agents/portfolio_optimization_agent.py

No docstring

./core/agents/meta_cognitive_agent.py

No docstring

./core/agents/macroeconomic_analysis_agent.py

No docstring

./core/agents/algo_trading_agent.py

No docstring

./core/agents/behavioral_economics_agent.py

No docstring

./core/agents/red_team_agent.py

No docstring

./core/agents/natural_language_generation_agent.py

No docstring

./core/agents/meta_19_agent.py

No docstring

./core/agents/sense_weaver.py

No docstring

./core/agents/archive_manager_agent.py

No docstring

./core/agents/catalyst_agent.py

No docstring

./core/agents/prompt_tuner.py

No docstring

./core/agents/lexica_agent.py

No docstring

./core/agents/risk_assessment_agent.py

No docstring

./core/agents/agent_forge.py

No docstring

./core/agents/reflector_agent.py

No docstring

./core/agents/snc_analyst_agent.py

No docstring

./core/agents/event_driven_risk_agent.py

No docstring

./core/agents/result_aggregation_agent.py

No docstring

./core/agents/data_retrieval_agent.py

No docstring

./core/agents/echo_agent.py

No docstring

./core/agents/market_sentiment_agent.py

No docstring

./core/agents/query_understanding_agent.py

No docstring

./core/agents/data_verification_agent.py

No docstring

./core/agents/news_bot.py

No docstring

./core/agents/technical_analyst_agent.py

No docstring

./core/agents/regulatory_compliance_agent.py

No docstring

./core/agents/anomaly_detection_agent.py

No docstring

./core/agents/crypto_agent.py

No docstring

./core/agents/newsletter_layout_specialist_agent.py

No docstring

./core/agents/hnasp_agent.py

No docstring

./core/agents/prompt_generation_agent.py

No docstring

./core/agents/industry_specialist_agent.py

No docstring

./core/agents/machine_learning_model_training_agent.py

No docstring

./core/agents/prediction_market_agent.py

No docstring

./core/agents/skills/counterfactual_reasoning_skill.py

No docstring

./core/agents/skills/xai_skill.py

No docstring

./core/agents/skills/XAISkill/__init__.py

No docstring

./core/agents/skills/CounterfactualReasoningSkill/__init__.py

No docstring

./core/agents/skills/HybridForecastingSkill/__init__.py

No docstring

./core/agents/skills/WorkflowCompositionSkill/__init__.py

No docstring

./core/agents/industry_specialists/materials.py

No docstring

./core/agents/industry_specialists/utilities.py

No docstring

./core/agents/industry_specialists/real_estate.py

No docstring

./core/agents/industry_specialists/financials.py

No docstring

./core/agents/industry_specialists/telecommunication_services.py

No docstring

./core/agents/industry_specialists/industrials.py

No docstring

./core/agents/industry_specialists/technology.py

No docstring

./core/agents/industry_specialists/consumer_discretionary.py

No docstring

./core/agents/industry_specialists/healthcare.py

No docstring

./core/agents/industry_specialists/consumer_staples.py

No docstring

./core/agents/industry_specialists/energy.py

No docstring

./core/agents/templates/v23_template_agent.py

No docstring

./core/agents/mcp_servers_v23/__init__.py

No docstring

./core/agents/mcp_servers_v23/risk_model_server.py

No docstring

./core/agents/mcp_servers_v23/financial_data_server.py

No docstring

./core/agents/architect_agent/agent.py

No docstring

./core/agents/sub_agents/internal_systems_agent.py

No docstring

./core/agents/sub_agents/git_repo_sub_agent.py

No docstring

./core/agents/sub_agents/compliance_kyc_agent.py

No docstring

./core/agents/sub_agents/data_ingestion_agent.py

No docstring

./core/agents/sub_agents/market_alternative_data_agent.py

No docstring

./core/agents/sub_agents/financial_news_sub_agent.py

No docstring

./core/agents/sub_agents/financial_document_agent.py

No docstring

./core/agents/developer_swarm/planner_agent.py

This module defines the PlannerAgent, a specialized agent responsible for decomposing high-level tasks into detailed, actionable plans.

./core/agents/developer_swarm/integration_agent.py

This module defines the IntegrationAgent, a specialized agent responsible for merging code, tests, and documentation into the main branch.

./core/agents/developer_swarm/__init__.py

No docstring

./core/agents/developer_swarm/test_agent.py

This module defines the TestAgent, a specialized agent responsible for writing and running tests for a given piece of code.

./core/agents/developer_swarm/documentation_agent.py

This module defines the DocumentationAgent, a specialized agent responsible for writing and updating documentation related to code changes.

./core/agents/developer_swarm/reviewer_agent.py

This module defines the ReviewerAgent, a specialized agent responsible for performing static analysis on code to ensure quality and consistency.

./core/agents/developer_swarm/coder_agent.py

This module defines the CoderAgent, a specialized agent responsible for writing code to implement a single, well-defined task.

./core/agents/specialized/monte_carlo_risk_agent.py

No docstring

./core/agents/specialized/management_assessment_agent.py

No docstring

./core/agents/specialized/__init__.py

No docstring

./core/agents/specialized/covenant_analyst_agent.py

No docstring

./core/agents/specialized/portfolio_manager_agent.py

No docstring

./core/agents/specialized/peer_comparison_agent.py

No docstring

./core/agents/specialized/credit_conformance_agent.py

No docstring

./core/agents/specialized/quantum_scenario_agent.py

No docstring

./core/agents/specialized/snc_rating_agent.py

No docstring

./core/agents/orchestrators/meta_orchestrator.py

No docstring

./core/agents/orchestrators/workflow_manager.py

No docstring

./core/agents/orchestrators/task.py

No docstring

./core/agents/orchestrators/creditsentry_orchestrator.py

No docstring

./core/agents/orchestrators/hybrid_orchestrator.py

No docstring

./core/agents/orchestrators/workflow.py

No docstring

./core/agents/orchestrators/credit_risk_orchestrator.py

No docstring

./core/agents/orchestrators/odyssey_hub_agent.py

No docstring

./core/agents/orchestrators/parallel_orchestrator.py

No docstring

./core/agents/meta_agents/sentiment_analysis_meta_agent.py

No docstring

./core/agents/meta_agents/counterparty_risk_agent.py

No docstring

./core/agents/meta_agents/crisis_simulation_agent.py

No docstring

./core/agents/meta_agents/narrative_summarization_agent.py

No docstring

./core/agents/meta_agents/portfolio_monitoring_ews_agent.py

No docstring

./core/agents/meta_agents/persona_communication_agent.py

No docstring

./core/agents/meta_agents/credit_risk_assessment_agent.py

No docstring

./core/schemas/financial_truth.py

No docstring

./core/schemas/hnasp.py

No docstring

./core/schemas/credit_conformance.py

No docstring

./core/schemas/v23_5_schema.py

No docstring

./core/schemas/crisis_simulation.py

No docstring

./core/schemas/market_data_schema.py

No docstring

./core/schemas/config_schema.py

No docstring

./core/schemas/hnasp_v23/__init__.py

No docstring

./core/schemas/hnasp_v23/agent_state.py

No docstring

./core/libraries_and_archives/__init__.py

No docstring

./core/data_access/base_data_source.py

No docstring

./core/data_access/json_file_source.py

No docstring

./core/memory/__init__.py

Personal Memory Module Handles the Personal Knowledge Graph (PKG) using SQLite and Vector Stores.

./core/memory/engine.py

No docstring

./core/pricing_engine/__init__.py

Pricing Engine Module Handles competitive institutional-grade pricing for assets.

./core/pricing_engine/engine.py

No docstring

./core/newsletter_layout/newsletter_layout_specialist.py

No docstring

./core/newsletter_layout/generator.py

No docstring

./core/newsletter_layout/assets/__init__.py

No docstring

./core/tools/base_tool.py

No docstring

./core/tools/web_search_tool.py

No docstring

./core/family_office/__init__.py

Family Office Module. Unifies Wealth Management, Investment Banking, and Asset Management capabilities.

./core/family_office/wealth_manager.py

No docstring

./core/family_office/governance.py

No docstring

./core/family_office/portfolio.py

No docstring

./core/family_office/deal_flow.py

No docstring

./core/family_office/service.py

No docstring

./core/utils/agent_utils.py

No docstring

./core/utils/reporting_utils.py

No docstring

./core/utils/__init__.py

No docstring

./core/utils/secrets_utils.py

No docstring

./core/utils/retry_utils.py

No docstring

./core/utils/api_utils.py

No docstring

./core/utils/formatting_utils.py

No docstring

./core/utils/json_logic.py

No docstring

./core/utils/data_utils.py

No docstring

./core/utils/config_utils.py

No docstring

./core/utils/market_data_utils.py

No docstring

./core/utils/logging_utils.py

No docstring

./core/utils/token_utils.py

No docstring

./core/v22_quantum_pipeline/qmc_qiskit_poc.py

NEXUS-GENESIS v1.0 | Quantum Risk Analysis Module Module: core.v22_quantum_pipeline.qmc_qiskit_poc Author: Adam System (v23.5) Context: Strategic Environment Audit - 'The Future Aligned Element' Description: Implements a Proof-of-Concept for Quantum Amplitude Estimation (QAE) using Qiskit primitives. Designed to estimate Value-at-Risk (VaR) and Probability of Default (PD) with quadratic speedup over classical MC.

./core/v22_quantum_pipeline/__init__.py

No docstring

./core/v22_quantum_pipeline/async_loader.py

No docstring

./core/v22_quantum_pipeline/data_expander.py

No docstring

./core/v22_quantum_pipeline/qmc_engine.py

No docstring

./core/v22_quantum_pipeline/quantum_source.py

No docstring

./core/execution_router/__init__.py

Execution Router Module Handles order management, smart routing, and execution quality benchmarking.

./core/execution_router/router.py

No docstring

./core/xai/iqnn_cs.py

No docstring

./core/xai/state_translator.py

No docstring

./core/analysis/risk_assessment.py

No docstring

./core/analysis/technical_analysis.py

No docstring

./core/analysis/fundamental_analysis.py

No docstring

./core/analysis/trading_logic.py

No docstring

./core/analysis/counterfactual_engine.py

No docstring

./core/analysis/forecasting/hybrid_model.py

No docstring

./core/analysis/xai/shap_explainer.py

No docstring

./core/financial_data/__init__.py

No docstring

./core/financial_data/schema.py

No docstring

./core/financial_data/discovery.py

No docstring

./core/financial_data/realtime_pipe.py

No docstring

./core/financial_data/lakehouse.py

No docstring

./core/v23_graph_engine/unified_knowledge_graph.py

No docstring

./core/v23_graph_engine/deep_dive_graph.py

No docstring

./core/market_data/__init__.py

Market Data Module Handles real-time feeds, historical data, and normalization.

./core/market_data/historical_loader.py

No docstring

./core/market_data/service.py

No docstring

./core/strategy/__init__.py

Strategy Module Handles Alpha Signal Ingestion, RL Optimization, and Strategy Generation.

./core/strategy/manager.py

No docstring

./core/strategy/rl_optimizer.py

No docstring

./core/strategy/alpha_signals.py

No docstring

./core/simulations/Credit_Rating_Assessment_Simulation.py

No docstring

./core/simulations/__init__.py

No docstring

./core/simulations/Stress_Testing_Simulation.py

No docstring

./core/simulations/Portfolio_Optimization_Simulation.py

No docstring

./core/simulations/Investment_Committee_Simulation.py

No docstring

./core/simulations/Fraud_Detection_Simulation.py

No docstring

./core/simulations/Regulatory_Compliance_Simulation.py

No docstring

./core/engine/entity_utils.py

No docstring

./core/engine/meta_orchestrator.py

Agent Notes (Meta-Commentary): The MetaOrchestrator is the supreme controller of the Adam system in v23.0. It implements the "Brain" of the architecture, deciding which cognitive path a user query should take: 1. Fast Path (v21): Direct tool execution (e.g. "Get stock price"). 2. Async Path (v22): Message-driven workflow (e.g. "Monitor news"). 3. Adaptive Path (v23): Neuro-Symbolic Planner (e.g. "Analyze complex credit risk"). 4. Specialized Paths: ESG, Compliance, Red Team. 5. Deep Dive Path (v23.5): 5-Phase autonomous financial analysis.

./core/engine/__init__.py

This package contains the core components of the Adam v23.0 'Adaptive' architecture. Modules: - cyclical_reasoning_graph: Implements the stateful, durable, and collaborative agentic runtime using LangGraph. - snc_graph: Specialized cyclical reasoning graph for Shared National Credit (SNC) analysis. - neuro_symbolic_planner: Implements the Plan-on-Graph (PoG) framework for verifiable, grounded planning. - autonomous_self_improvement: Implements the MIT SEAL-based 'Outer Loop' for persistent agent learning and evolution. - unified_knowledge_graph: Manages the integration of the FIBO domain ontology and the W3C PROV-O provenance ontology. - hil_validation_node: Provides the mechanism for Human-in-the-Loop validation as a native, auditable state in the reasoning graph.

./core/engine/planner.py

No docstring

./core/engine/unified_knowledge_graph.py

Manages the integration of the FIBO domain ontology and the W3C PROV-O provenance ontology. This module provides the core interface for the Neuro-Symbolic Planner to query the two-layer knowledge graph. It abstracts the underlying graph database (e.g., Neo4j, TerminusDB) and provides methods for complex, cross-ontology queries. Key Components: - GraphDB Connector: Handles the connection to the underlying graph database. - FIBO Query Interface: Provides methods to query financial concepts and relationships based on the Financial Industry Business Ontology. - PROV-O Query Interface: Provides methods to query data lineage and provenance based on the W3C Provenance Ontology. - Unified Query Engine: Allows the planner to run queries that traverse both FIBO and PROV-O simultaneously, creating a fully verifiable reasoning chain.

./core/engine/agent_adapters.py

Agent Notes (Meta-Commentary): Provides a clean interface layer (Adapter Pattern) between the new v23 Graph Engine and the legacy v21/v22 Agents. This ensures dependency isolation and backward compatibility.

./core/engine/snc_graph.py

Agent Notes (Meta-Commentary): This module implements a specialized Cyclical Reasoning Graph for Shared National Credits (SNC). It orchestrates the analysis of complex syndicated loans, determining regulatory ratings (Pass, Special Mention, Substandard, etc.) through an iterative critique-correction loop. It leverages the v23 LangGraph architecture.

./core/engine/red_team_graph.py

No docstring

./core/engine/crisis_simulation_graph.py

Agent Notes (Meta-Commentary): This module implements the Crisis Simulation Graph (v23). It is a specialized reasoning engine for macro-economic stress testing. It uses a recursive approach: 1. Decompose the user scenario into macro variables (rates, GDP, inflation). 2. Simulate First-Order Impacts (direct hits to portfolio). 3. Simulate Second-Order Impacts (cascading failures, counterparty risk). 4. Critique the realism of the simulation. 5. Refine/Intensify if necessary.

./core/engine/snc_utils.py

Agent Notes (Meta-Commentary): Helper module for Shared National Credit (SNC) analysis logic. Encapsulates pure functions for financial calculations, vote counting, and regulatory classification rules.

./core/engine/states.py

No docstring

./core/engine/deep_dive_graph.py

No docstring

./core/engine/strategy_utils.py

No docstring

./core/engine/hil_validation_node.py

Provides the mechanism for Human-in-the-Loop validation as a native, auditable state in the reasoning graph. This module implements the logic for a special LangGraph node that can interrupt a graph's execution, persist its state, and wait for external human input before proceeding. This transforms HIL from an external alert into a first-class, auditable component of the workflow. Key Components: - HIL_Validation_Node: A function designed to be added as a node in a LangGraph. When triggered (e.g., after multiple failed self-correction loops), it persists the current graph state to a database (e.g., Redis, Postgres) and awaits an external API call. - HIL_API_Endpoint: A simple API (e.g., FastAPI, Flask) that allows a human reviewer to fetch the persisted state, review the work, and submit feedback or an approval. - Graph_Resume_Logic: Once feedback is submitted via the API, this component loads the state from the database and re-injects it into the graph to continue the execution with the human guidance.

./core/engine/market_sentiment_graph.py

Agent Notes (Meta-Commentary): This module implements the Market Sentiment & News Monitoring Graph. It simulates an agent that "reads" news, calculates sentiment scores, cross-references them with the Knowledge Graph (KG) to find contagion risks, and issues alerts. Architecture: - Cyclic Graph: Uses LangGraph for the feedback loop (Analysis -> KG Check -> Draft). - State: Managed via `MarketSentimentState`.

./core/engine/autonomous_self_improvement.py

Implements the MIT SEAL-based 'Outer Loop' for persistent agent learning and evolution. This module contains the logic for the system to autonomously detect its own failures, generate new training data, and trigger the finetuning and redeployment of its own agentic components. This is the core of the v23.0 'Adaptive' paradigm. Key Components: - RL Controller (Meta-Cognitive Agent v2): Monitors agent performance metrics and production logs to detect systemic drift or failure patterns. - Agent Forge Interface: A client to trigger the generation of thousands of synthetic test cases based on a detected failure. - Sandbox Environment: Executes a failing agent against synthetic data to generate high-quality "self-edits" for finetuning. - Reward Model Interface (Red Team Agent): A client to score the quality and downstream impact of the generated "self-edits". - Code Alchemist Service Client: A client to trigger the SFT finetuning and hot-swapping of an agent model based on the highest-reward self-edits.

./core/engine/regulatory_compliance_graph.py

Agent Notes (Meta-Commentary): This module implements the Regulatory Compliance Graph. It automates the process of checking a financial entity against complex regulatory frameworks (e.g., Basel III, Dodd-Frank, KYC/AML). It uses a cyclical approach to ensure no violation is missed and interpretations are double-checked.

./core/engine/esg_graph.py

Agent Notes (Meta-Commentary): This module implements the ESG (Environmental, Social, Governance) Analysis Graph. It evaluates a company's sustainability profile using a cyclical reasoning process. It assesses individual E, S, and G factors, calculates an aggregate score, and then critiques the findings against known controversies (greenwashing detection).

./core/engine/neuro_symbolic_planner.py

Implements the Plan-on-Graph (PoG) framework for verifiable, grounded planning. This module replaces the generative 'WorkflowCompositionSkill' from v22.0. Instead of generating a plan from parametric knowledge, this planner discovers a valid reasoning path by traversing the Unified Knowledge Graph (FIBO + PROV-O). This ensures that every workflow is grounded in a verifiable, symbolic scaffold before any generative agents are invoked.

./core/engine/valuation_utils.py

No docstring

./core/engine/cyclical_reasoning_graph.py

Agent Notes (Meta-Commentary): This module implements the core cyclical reasoning engine for Adam v23.0. It replaces the linear v22 simulation with a stateful LangGraph workflow. It refactors critical logic from v21 agents into a dependency-free structure suitable for the v23 graph architecture.

./core/engine/reflector_graph.py

No docstring

./core/mcp/__init__.py

MCP (Model Context Protocol) Module Contains tool definitions and agent bridges for LLM integration.

./core/mcp/registry.py

No docstring

./core/financial_suite/__init__.py

No docstring

./core/financial_suite/context_manager.py

No docstring

./core/financial_suite/modules/__init__.py

No docstring

./core/financial_suite/modules/vc/__init__.py

No docstring

./core/financial_suite/modules/vc/waterfall.py

No docstring

./core/financial_suite/modules/vc/return_metrics.py

No docstring

./core/financial_suite/modules/reporting/__init__.py

No docstring

./core/financial_suite/modules/reporting/generator.py

No docstring

./core/financial_suite/modules/risk/__init__.py

No docstring

./core/financial_suite/modules/risk/credit_model.py

No docstring

./core/financial_suite/modules/risk/regulatory.py

No docstring

./core/financial_suite/schemas/__init__.py

No docstring

./core/financial_suite/schemas/workstream_context.py

No docstring

./core/financial_suite/interface/__init__.py

No docstring

./core/financial_suite/interface/dependency_graph.py

No docstring

./core/financial_suite/engines/__init__.py

No docstring

./core/financial_suite/engines/dcf.py

No docstring

./core/financial_suite/engines/wacc.py

No docstring

./core/financial_suite/engines/solver.py

No docstring

./core/rag/document_handling.py

No docstring

./core/prompting/loader.py

No docstring

./core/prompting/__init__.py

No docstring

./core/prompting/registry.py

No docstring

./core/prompting/base_prompt_plugin.py

No docstring

./core/prompting/plugins/financial_truth_plugin.py

No docstring

./core/prompting/plugins/crisis_simulation_plugin.py

No docstring

./core/vectorstore/base_vector_store.py

No docstring

./core/vectorstore/stores/in_memory_vector_store.py

No docstring

./core/capability_monitoring/module.py

No docstring

./core/gold_standard/__init__.py

No docstring

./core/gold_standard/storage.py

Storage Layer for the Gold Standard Toolkit. Implements Data Lakehouse architecture using Apache Parquet and PyArrow.

./core/gold_standard/data_fetcher.py

Ingestion Engine for the Gold Standard Toolkit. Handles reliable data fetching from yfinance with rate limit management.

./core/gold_standard/ingestion.py

Ingestion Engine for the Gold Standard Toolkit. Handles reliable data fetching from yfinance with rate limit management.

./core/gold_standard/discovery.py

Discovery Layer for the Gold Standard Toolkit. Implements Real Search Pull and Dynamic Universe Discovery.

./core/gold_standard/qa.py

Quality Assurance Module for the Gold Standard Toolkit. Handles schema validation using Pandera and market calendar logic.

./core/gold_standard/advisory/mpt.py

Modern Portfolio Theory (MPT) Module. Implements Mean-Variance Optimization and Risk Metrics.

./core/gold_standard/advisory/__init__.py

No docstring

./core/gold_standard/advisory/black_litterman.py

Black-Litterman Optimization Module. Integrates market views with market equilibrium for robust portfolio construction.

./core/gold_standard/trading/strategy.py

Mean Reversion Strategy for Intra-Day Trading.

./core/gold_standard/trading/__init__.py

No docstring

./core/gold_standard/trading/cleaning.py

Data Cleaning Module for Intra-Day Trading. Handles zero volume, missing bars, and imputation.

./core/api/schemas.py

No docstring

./core/api/__init__.py

No docstring

./core/api/deps.py

No docstring

./core/api/main.py

No docstring

./core/api/server.py

No docstring

./core/api/routers/__init__.py

No docstring

./core/api/routers/agents.py

No docstring

./core/llm/base_llm_engine.py

No docstring

./core/llm/engines/dummy_llm_engine.py

No docstring

./core/llm/engines/openai_llm_engine.py

No docstring

./core/hnasp/personality.py

No docstring

./core/hnasp/state_manager.py

No docstring

./core/hnasp/lakehouse.py

No docstring

./core/hnasp/logic_engine.py

No docstring

./core/data_processing/synthetic_data_factory.py

No docstring

./core/data_processing/__init__.py

No docstring

./core/data_processing/universal_ingestor_v2.py

No docstring

./core/data_processing/universal_ingestor.py

No docstring

./core/vertical_risk_agent/generative_risk.py

No docstring

./core/vertical_risk_agent/state.py

No docstring

./core/vertical_risk_agent/agents/legal.py

No docstring

./core/vertical_risk_agent/agents/supervisor.py

No docstring

./core/vertical_risk_agent/agents/market.py

No docstring

./core/vertical_risk_agent/agents/analyst.py

No docstring

./core/vertical_risk_agent/tools/agent_tools.py

No docstring

./core/vertical_risk_agent/tools/mcp_server/server2.py

No docstring

./core/vertical_risk_agent/tools/mcp_server/server.py

No docstring

./core/vertical_risk_agent/app/main.py

No docstring

./core/vertical_risk_agent/ingestion/parser_router.py

No docstring

./core/vertical_risk_agent/ingestion/xbrl_handler.py

No docstring

./core/vertical_risk_agent/training/train_dpo.py

No docstring

./core/advisory/robo_advisor_v3.py

Module 3: Robo-Advisor Logic & Intake Engine ============================================ Architecture: Constraints-Based Advisory System Objective: Map client profiles to "Gold Standard" portfolio variants.

./core/advisory/robo_advisor.py

Module 3: Robo-Advisor Logic & Intake Engine ============================================ Architect Notes: ---------------- 1. **Psychology vs. Math**: This engine distinguishes between 'Risk Capacity' (Financial ability to take loss) and 'Risk Tolerance' (Emotional ability to take loss). Capacity is a hard constraint; Tolerance is a soft preference. The score is weighted: Capacity (60%) > Tolerance (40%). 2. **Scoring Algorithm**: We use a weighted sum model. Each answer maps to a normalized score (0-100). The final score determines the `RiskBand`. 3. **Safety First**: If Risk Capacity is "Low" (e.g., short timeline or need for liquidity), the system forces a Conservative allocation regardless of the user's high Risk Tolerance. This is a "Suitability Check" required by fiduciary standards.

./core/advisory/robo_advisor_v2.py

Module 3: Robo-Advisor Logic & Intake Engine ============================================ Architectural Blueprint: ------------------------ 1. **Dual-Dimension Risk Framework**: - **Risk Capacity** (The "Can"): Objective, financial ability to bear loss (Time Horizon, Liquidity, Net Worth). - **Risk Tolerance** (The "Want"): Subjective, psychological willingness to bear loss (Questionnaire, Behavior). 2. **Constraint Principle**: Risk Capacity always acts as a hard ceiling on Risk Tolerance. 3. **Mapping Matrix**: A 5x5 coordinate system maps scores to specific portfolio variants. Portfolio Variants: - **Defensive Dragon** ("The Bunker"): Capital Preservation. - **Aggressive Dragon** ("The Hunter"): Geometric Compounding. - **Standard Dragon**: Balanced 5-Pillar Approach.

./core/world_simulation/data_manager.py

No docstring

./core/world_simulation/autonomous_world_sim.py

No docstring

./core/world_simulation/__init__.py

No docstring

./core/world_simulation/config.py

No docstring

./core/world_simulation/llm_driven_sim.py

No docstring

./core/data_sources/social_media_api.py

No docstring

./core/data_sources/__init__.py

No docstring

./core/data_sources/financial_news_api.py

No docstring

./core/data_sources/web_traffic_api.py

No docstring

./core/data_sources/data_fetcher.py

No docstring

./core/data_sources/market_data_api.py

No docstring

./core/data_sources/data_sources.py

No docstring

./core/data_sources/prediction_market_api.py

No docstring

./core/data_sources/government_stats_api.py

No docstring

./core/data_sources/yfinance_market_data.py

No docstring

./core/risk_engine/__init__.py

Risk Engine Module Handles real-time risk metrics: VAR, Greeks, Convexity, and Cross-Exposures.

./core/risk_engine/engine.py

No docstring

./core/trading/hft/hft_engine_v3.py

Module 1: High-Frequency Trading (HFT) Execution Engine Architecture ==================================================================== Architectural Paradigm: Asynchronous Event-Driven Design via Python asyncio. Components: - Market Data Handler (The Producer): Simulates WebSocket ingestion. - Strategy Engine (The Consumer): Market Making logic. - Order Manager: State machine for order lifecycle. - Circuit Breaker (The Risk Gate): Synchronous guardrail on critical path. See "Master Architect" prompt output for details.

./core/trading/hft/hft_engine_nexus.py

NEXUS-ZERO: High-Frequency Execution Engine (v25 "Path B" Implementation) ========================================================================= Architectural Paradigm: Asynchronous Event-Driven Design via Python asyncio/uvloop. Optimization Level: MAXIMUM (Path B) This module implements the "High-Frequency Execution Engine" described in the v25 Architectural Blueprint. It prioritizes velocity, throughput, and mathematical rigor over business logic abstraction. Core Components: 1. NexusEngine: The main reactor loop utilizing uvloop (if available). 2. AvellanedaStoikovStrategy: Implementation of the 2008 inventory-risk model. 3. ZeroCopyProtocol: Binary protocol for market data ingestion using memoryview. Mathematical Model (Avellaneda-Stoikov): ---------------------------------------- Reservation Price (r): r(s, q, t) = s - q * gamma * sigma^2 * (T - t) Where: - s: Mid-price - q: Inventory position (signed integer) - gamma: Risk aversion parameter - sigma: Volatility (annualized) - T-t: Remaining time horizon Optimal Spread (delta): delta = (2 / gamma) * ln(1 + (gamma / kappa)) Where: - kappa: Order book liquidity density (intensity parameter) Performance Targets: - Latency: < 50 microseconds (logic only) - Throughput: > 100,000 ticks/sec (simulated)

./core/trading/hft/yfinance_data_feed.py

No docstring

./core/trading/hft/hft_engine.py

Module 1: High-Frequency Trading (HFT) Engine ============================================= Architect Notes: ---------------- 1. **Concurrency Model**: We use `asyncio` because HFT at this level (market making) is network-bound, not CPU-bound. Waiting for WebSocket updates or REST API confirmations wastes cycles. `asyncio` allows us to handle thousands of concurrent connections on a single thread without the context-switching overhead of OS threads. 2. **State Management**: The `OrderManager` uses a dictionary for O(1) lookups. In a production C++ system, we would use a ring buffer or similar lock-free structure, but for Python, a dict is sufficient for prototyping. 3. **Risk Controls**: The `CircuitBreaker` is hard-coded and checked *before* every order placement. It tracks drawdown and latency. This is "Risk-First" architecture. Usage: ------ Run this module directly to simulate the trading loop.

./core/trading/hft/hft_engine_v2.py

Module 1: High-Frequency Trading (HFT) Engine ============================================= Architectural Blueprint: ------------------------ 1. **Concurrency**: Utilizes `asyncio` with `uvloop` (if available) for an event-driven, non-blocking architecture. 2. **Algorithm**: Implements the Avellaneda-Stoikov market-making model using Reservation Price (r) and Optimal Spread (delta). 3. **Resilience**: Implements a 3-state Circuit Breaker (Closed, Open, Half-Open) to manage system faults. 4. **Networking**: Features a Zero-Copy Protocol design using `asyncio.Protocol` for minimizing latency. Usage: ------ Run this module directly to simulate the trading loop.

./core/trading/hft/avellaneda_stoikov_engine.py

Avellaneda-Stoikov Market Making Engine ======================================= This module implements the stochastic control framework for market making as described in the Unified Financial Operating System blueprint. Theoretical Foundation: ----------------------- - Reservation Price (r): The price where the MM is indifferent between buying and selling. r(s, q, t) = s - q * gamma * sigma^2 * (T - t) - Optimal Spread (delta): Half-spread distance from reservation price. delta(s, q, t) = (1 / gamma) * ln(1 + gamma / kappa) + 0.5 * gamma * sigma^2 * (T - t) Parameters: ----------- - s: Mid price - q: Inventory (signed) - t: Current time - T: Terminal time (end of trading session) - gamma: Risk aversion parameter - sigma: Volatility - kappa: Order book liquidity density

./core/learning/fine_tuning_driver.py

No docstring