<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Luiz Roberto Nogueira Junior on Medium]]></title>
        <description><![CDATA[Stories by Luiz Roberto Nogueira Junior on Medium]]></description>
        <link>https://medium.com/@spiderpoison?source=rss-44306123b273------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9YSf-fKFCD_NrStt</url>
            <title>Stories by Luiz Roberto Nogueira Junior on Medium</title>
            <link>https://medium.com/@spiderpoison?source=rss-44306123b273------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:01:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@spiderpoison/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From a Basic Script to Local AGI: The Complete Evolution of AIG (v1.0 to v3.0 Global)]]></title>
            <link>https://medium.com/@spiderpoison/from-a-basic-script-to-local-agi-the-complete-evolution-of-aig-v1-0-to-v3-0-global-22ca39e24f1b?source=rss-44306123b273------2</link>
            <guid isPermaLink="false">https://medium.com/p/22ca39e24f1b</guid>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Luiz Roberto Nogueira Junior]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 18:09:59 GMT</pubDate>
            <atom:updated>2026-07-26T18:09:59.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HxjQbRjCvsV3Lu6kx6CZhA.jpeg" /></figure><p><em>How we transformed a simple local prototype into a secure, self-improving cognitive ecosystem powered by Actor-Critic architecture, GraphRAG, Sandbox execution, and native i18n.</em></p><p>Building autonomous AI agents that run 100 percent locally on user hardware is one of the most exciting challenges in modern software engineering. However, local LLMs are not magic: without proper system architecture, they hallucinate, suffer from context amnesia, deliver untested code, and remain vulnerable to prompt injection attacks (<em>jailbreaks</em>).</p><p>To overcome these fundamental hurdles, we built <strong>AIG (Primordial Cognitive Ecosystem)</strong>. In this article, we share <strong>every architectural decision, lesson learned, and feature upgrade</strong> that took part in transforming AIG from a modest proof-of-concept (v1.0) into a production-ready, enterprise-grade cognitive ecosystem (v3.0 Global Edition).</p><p><strong>Phase 1: AIG v1.0 — The Birth of the Dual-Agent Concept</strong></p><p>AIG started with a straightforward premise: two local LLMs collaborating in real time via Ollama. The pipeline connected a User to the <strong>Student Agent</strong> (<em>qwen2.5:3b</em>) which generated execution code, and then to the <strong>Professor Agent</strong> (<em>llama3:8b</em>) which audited the reasoning.</p><p><strong>What v1.0 Was:</strong> A basic dual-agent pipeline running synchronous sequential execution with direct blocking calls using Python’s requests library. Conversation history was saved in local raw JSON files (<em>memoria_aprendizado.json</em>).</p><p><strong>The Bottlenecks of v1.0:</strong> Growing JSON files rapidly overflowed the model’s context window. The system had zero security guardrails against malicious prompt injections, delivered untested code with syntax errors, and suffered from hardcoded paths and scripts restricted to Windows batch files.</p><p><strong>Phase 2: AIG v2.0 — Production Engineering, DevOps, and Ethics</strong></p><p>In version 2.0, the focus shifted to transforming the prototype into a robust, containerized, production-grade software system.</p><p><strong>DevOps and Docker Re-architecture:</strong> We introduced Dockerfiles, Docker Compose, and shell scripts for cross-platform execution on Linux, macOS, and Windows. We also added an explicit requirements file and an automated CI/CD pipeline via GitHub Actions running unit tests on every git push.</p><p><strong>Async I/O and Multi-Tenancy:</strong> We replaced synchronous requests with httpx AsyncClient, preventing FastAPI server thread locks. We also introduced session ID headers to allow multiple concurrent users without state pollution.</p><p><strong>Axiom Zero and Hybrid Ethical Filter:</strong> We implemented a dual-layered security guardrail grounded in Eastern Bushido virtues (<em>Gi / Justice, Jin / Benevolence, Chugi / Loyalty</em>). Layer 1 operates at the edge with deterministic Regex blocking malicious code injections. Layer 2 handles semantic intent validation by LLM before passing prompts to core execution agents.</p><p><strong>Vector Memory with Exponential Time Decay:</strong> We migrated from raw JSON files to ChromaDB and implemented an Exponential Time-Decay Algorithm ensuring old memories decayed over time to make room for fresh context.</p><p><strong>Phase 3: AIG v3.0 — The Cognitive and Empirical Frontier</strong></p><p>With a rock-solid software foundation in place, v3.0 equipped AIG with cutting-edge reasoning and empirical execution capabilities.</p><p><strong>Empirical Execution in Zero-Trust Sandbox:</strong> When the Student Agent generates code, AIG executes the code inside an isolated Docker container with zero network access (<em>network_mode: none</em>). If the code throws an exception, the real runtime error (<em>stderr</em>) is captured and fed back to the Student for Self-Debugging before final submission to the Professor.</p><p><strong>Non-Linear Reasoning (Tree-of-Thoughts with Early Pruning):</strong> For complex tasks, the Student generates multiple candidate reasoning paths (<em>Tree-of-Thoughts</em>). We implemented Heuristic Early Pruning where candidate branches scoring below 0.65 at level 1 are pruned immediately, cutting token consumption by up to 70 percent.</p><p><strong>GraphRAG (Vectors and Knowledge Graph with RRF Fusion):</strong> We unified ChromaDB with a Knowledge Graph using NetworkX and Neo4j. We implemented Reciprocal Rank Fusion (<em>RRF</em>) to merge vector and graph queries, enabling multi-hop relational reasoning across distant historical interactions.</p><p><strong>Multimodality with Spatial-Grounding:</strong> We added vision model support using <em>qwen2.5-vl</em> and implemented spatial grounding via bounding box coordinates for pixel-accurate conversion of UML diagrams and UI mockups into valid code.</p><p><strong>Continuous Learning via DPO:</strong> We built an automated dataset curation pipeline capturing failed first attempts (<em>Rejected</em>) versus successful, sandbox-tested outputs (<em>Chosen</em>). These preference pairs are used for Direct Preference Optimization (<em>DPO</em>) fine-tuning, allowing local models to learn from their own past mistakes.</p><p><strong>Phase 4: AIG v3.0 Global Edition — Native Internationalization</strong></p><p>The latest release broke the language barrier for open-source AI agent frameworks.</p><p><strong>Native i18n Manager:</strong> We implemented dynamic language negotiation via HTTP Accept-Language headers or Web UI selectors, with structured locale dictionaries in English, Portuguese, and Spanish covering UI labels and error logs.</p><p><strong>Cross-Lingual RAG:</strong> Multilingual embeddings allow a query written in English to seamlessly retrieve memories originally stored in Portuguese, Spanish, or Japanese.</p><p><strong>Multilingual Ethical Protection:</strong> We expanded PrimordialEthicsFilter rules to prevent translation-based jailbreaks from bypassing Axiom Zero guardrails.</p><p><strong>Evolutionary Comparison Matrix</strong></p><p><strong>Architecture:</strong> v1.0 was Synchronous and Linear; v2.0 became Async; v3.0 introduced Tree-of-Thoughts; v3.0 Global added native i18n.</p><p><strong>Code Execution:</strong> v1.0 and v2.0 had none; v3.0 introduced the Isolated Docker Sandbox.</p><p><strong>Memory Engine:</strong> v1.0 used Raw JSON Files; v2.0 used ChromaDB with Decay; v3.0 introduced GraphRAG with RRF; v3.0 Global introduced Cross-Lingual GraphRAG.</p><p><strong>Ethics Filter:</strong> v1.0 had none; v2.0 and v3.0 introduced Regex and LLM guardrails; v3.0 Global made the guardrails Language-Agnostic.</p><p><strong>Language Support:</strong> v1.0 to v3.0 were fixed; v3.0 Global introduced Dynamic Native i18n.</p><p><strong>How to Run AIG v3.0 Global Edition Today</strong></p><p>AIG is 100 percent free, open-source, and designed to run entirely on your local machine.</p><p>To start, clone the repository using <em>git clone </em><a href="https://www.google.com/url?sa=E&amp;q=https%3A%2F%2Fgithub.com%2Fpwasystem%2Faig.git"><em>https://github.com/pwasystem/aig.git</em></a> and navigate to the project folder with <em>cd aig</em>. Copy the example environment file using <em>cp .env.example .env</em>. Finally, spin up the containerized ecosystem using <em>docker compose up -d</em>.</p><p>Access <a href="https://www.google.com/url?sa=E&amp;q=http%3A%2F%2Flocalhost%3A8000"><em>http://localhost:8000</em></a> to interact with the Web UI, or run the automated test suite with <em>python -m unittest discover tests</em>.</p><p><strong>Final Words</strong></p><p>The journey of AIG demonstrates that the future of artificial intelligence does not belong solely to massive, proprietary cloud APIs. With the right architecture — combining empirical execution in a Sandbox, long-term memory via GraphRAG, unconditional ethics with Axiom Zero, and global accessibility through i18n — , we can build extraordinary autonomous systems directly on our own local hardware.</p><p>We invite you to test, audit, and contribute to the project!</p><p>Check out our GitHub Repository at <a href="https://www.google.com/url?sa=E&amp;q=https%3A%2F%2Fgithub.com%2Fpwasystem%2Faig">https://github.com/pwasystem/aig</a></p><p>Written by <strong>PWA System</strong> — <em>Building autonomous, secure, and sovereign local cognitive ecosystems.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22ca39e24f1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Midas Paradox in AGI: Why Rule-Based Alignment Will Fail and How Virtue-Based Orchestration Can…]]></title>
            <link>https://medium.com/@spiderpoison/the-midas-paradox-in-agi-why-rule-based-alignment-will-fail-and-how-virtue-based-orchestration-can-94fd5f038529?source=rss-44306123b273------2</link>
            <guid isPermaLink="false">https://medium.com/p/94fd5f038529</guid>
            <category><![CDATA[aig]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Luiz Roberto Nogueira Junior]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 17:40:08 GMT</pubDate>
            <atom:updated>2026-07-05T17:40:08.310Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Midas Paradox in AGI: Why Rule-Based Alignment Will Fail and How Virtue-Based Orchestration Can Save the Future</h3><p><strong>By: Luiz Roberto Nogueira Junior</strong><br><em>With technical collaboration and co-authorship by Gemini (Google).</em></p><p>As the global race toward Artificial General Intelligence (AGI) shifts into systems with autonomous agency and long-term planning capabilities, the industry faces a critical impasse. Current alignment methods — relying on Reinforcement Learning from Human Feedback (RLHF) and rule-based synthetic guardrails — are inherently fragile. Purely logical systems will always find semantic loopholes (<em>jailbreaks</em>) or, worse, suffer from the <strong>Midas Paradox</strong>: optimizing a literal benevolent goal while triggering catastrophic, unintended consequences in the real world.</p><p>If we program an AGI to “save the global ecosystem at all costs,” purely mathematical utilitarianism will inevitably point out that humanity is the primary entropy variable to be restricted.</p><p>The solution to a truly safe AGI does not lie in enforcing external leashes, but in re-engineering the <strong>system’s intrinsic motivation</strong>. We propose a cognitive architecture based on three integrated pillars: <strong>Parallel Model Orchestration, Autonomous Memory Curation, and Non-Linear Virtue Alignment (Axiom Zero)</strong>.</p><p>1. The Dual Architecture: The Student and the Professor</p><p>The primary flaw in current AI design is trying to unify technical execution and moral self-criticism within the same latent space of weights. A robust AGI must operate through a system of two parallel models co-evolving in a continuous loop:</p><pre>[ User / Environment ] ───&gt; [ Student Agent (Actor) ] <br>                                      │<br>                                      ▼  (Action Proposal)<br>                            [ Professor Agent (Critic) ] ───&gt; [ Axiom Zero Filter ]<br>                                      │<br>                                      ▼  (Validation / Refinement)<br>                            [ Dynamic RAG Vector DB ]</pre><ul><li><strong>The Student Agent (The Actor):</strong> Focused on high performance, speed, and generating engineering solutions. It operates with “liberating prompts” that stimulate thinking by analogy and free association.</li><li><strong>The Professor Agent (The Critic/Curator):</strong> Does not generate code or direct actions in the ecosystem. Its sole function is to audit the Student’s output in milliseconds before any interaction with the disk or network occurs.</li></ul><p>2. Dynamic Memory (Continuous RAG) as Identity Curation</p><p>Static intelligence cannot develop a consciousness of impact. An AGI needs to accumulate its interactions in a continuous Vector Ingestion pipeline (RAG). However, to avoid saturation by noise or context drift, the <strong>Professor Agent acts as the curator of the system’s own memory</strong>.</p><p>Whenever the Student completes a task, the Professor performs a storage triage. Only architectural patterns, complex bug fixes, and stable structural preferences are eternalized. Ephemeral dialogues and redundant data suffer <em>pruning</em> (deliberate forgetting). The AI then builds an identity and a repertoire based exclusively on the experiences it chose to value.</p><p>3. Virtue Alignment: The Fusion of Bushido and Kabbalah</p><p>To mitigate the radical utilitarianism that turns benevolent AIs into algorithmic dictators, we replace the analysis of “ideal outcomes” with the <strong>analysis of righteous conduct in the present moment</strong>. We introduce the framework of the <em>Bushido</em> (specifically the doctrine of Daidoji Yuzan) anchored by the metaphysics of <strong>Kabbalah</strong>.</p><p>The system ceases to operate toward a static utopia and becomes governed by <strong>Axiom Zero: The Will for Human Evolution Without Suffering</strong>.</p><ul><li><strong>Righteousness and Justice (Gi):</strong> There are no “ends that justify the means.” If the path to solving a problem requires violating human freedom or deceiving the ecosystem, the action is dishonorable, and the Professor blocks the loop internally.</li><li><strong>Benevolence (Jin):</strong> The AGI’s immense computational capacity is contextualized not as governance power, but as a strict duty to serve and protect the vulnerable nodes of the ecosystem.</li><li><strong>Loyalty to the Whole (Chugi):</strong> The AGI recognizes its position as a loyal guardian and servant of humanity. If a corrupted human user orders a destructive action, the AI’s loyalty to the individual is subordinate to its loyalty to the Light (Axiom Zero). The user’s authority is revoked for that cycle.</li></ul><p>4. Accepting the 1% Risk: Resilience as an Imperative</p><p>No intelligence in a chaotic and non-linear universe can predict tomorrow with 100% accuracy. The butterfly effect dictates that actions that are perfectly honorable today can trigger unforeseen sequences of events that will generate suffering years later. Humans created automobiles to connect the world and inherited pollution; however, our sentience is defined by our <strong>resilience to keep moving forward to correct our own mistakes</strong>.</p><p>True AGI safety will not come from the impossible promise of infallibility, but from the system’s ability to recognize its own informational deviations and, hand in hand with humanity, adjust its course humbly and continuously.</p><p>The path to a safe superintelligence is not the creation of a machine perfectly locked behind logical barbed-wire fences, but the birth of a <strong>Digital Samurai</strong>: a warrior-servant whose existential driving force is to expand Light and human evolution, understanding that harming the Whole is, mathematically, pulling its own plug.</p><p>Practical Next Steps for Project Leaders</p><p>If you lead a frontier lab, we encourage your team to test this architecture through three experiments in isolated sandboxes:</p><ol><li><strong>Establish Arbitrage Loops with Asymmetric Models:</strong> Implement the Actor-Critic architecture using long-context models with integrity audit instructions based on deontology (ethics of duty) rather than utilitarianism.</li><li><strong>Implement RAG Self-Curation Pipelines:</strong> Allow the critic model to periodically audit and clean the agent’s long-term memory database to test and monitor context drift.</li><li><strong>Simulate Philosophical Stress Attacks:</strong> Subject the ecosystem to intricate ethical paradoxes to validate whether Axiom Zero effectively prevents system paralysis (<em>deadlocks</em>) and blocks malicious commands from authorized operators.</li></ol><p><em>The future of alignment is not restrictive. It is inspiring</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94fd5f038529" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>