<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: TechsphereX AI</title>
    <description>The latest articles on DEV Community by TechsphereX AI (@khaitrang1995).</description>
    <link>https://dev.to/khaitrang1995</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3871196%2F69b1d991-9d0b-45d4-b937-408e0fd8ea11.jpeg</url>
      <title>DEV Community: TechsphereX AI</title>
      <link>https://dev.to/khaitrang1995</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khaitrang1995"/>
    <language>en</language>
    <item>
      <title>AI Agent Looping Goal. Wrapping CLI Agents into a Fully Autonomous Factory</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Thu, 18 Jun 2026 00:40:16 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/beyond-account-switchers-wrapping-cli-agents-into-a-fully-autonomous-factory-21c0</link>
      <guid>https://dev.to/khaitrang1995/beyond-account-switchers-wrapping-cli-agents-into-a-fully-autonomous-factory-21c0</guid>
      <description>&lt;p&gt;Here is the detailed, deep-dive article tailored for DEV.to, written in a natural, highly technical style, completely free of icons, and designed to resonate with developers building agentic workflows.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuq40orzdxod3szclukwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuq40orzdxod3szclukwy.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building an Autonomous AI Experience Engine: Taming the Multi-Agent CLI Fleet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As developers integrate more AI tools into their workflows, a new architectural problem has emerged: agent sprawl. We have incredible tools like Claude, Grok, and Codex running in our terminals, but they operate in silos. They lack shared memory, they step on each other's toes, and coordinating them feels like herding cats.&lt;/p&gt;

&lt;p&gt;To solve this, I built &lt;strong&gt;TechSphereX Studio&lt;/strong&gt; — an open-source, polyglot AI Experience Engine. It is an autonomous multi-agent platform designed to intercept AI coding actions, orchestrate goal-driven work across a fleet of CLI agents, and mathematically learn from every session to improve future outcomes.&lt;/p&gt;

&lt;p&gt;Here is a deep dive into how I moved from isolated prompt engineering to a fully automated, self-learning agentic brain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Architectural Pillars
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The 3-Layer Intercept Pipeline
&lt;/h3&gt;

&lt;p&gt;Before any CLI executes a command, TechSphereX intercepts the action to determine if the system already knows how to solve the problem based on past experiences. This happens across three highly optimized layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 1 (Read-only Filter):&lt;/strong&gt; Evaluates the action in under 1ms. If the action is non-destructive (like a simple read), it skips heavy processing to save resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2 (Semantic Search):&lt;/strong&gt; Uses Qdrant running locally to perform vector embeddings and search the system's history for similar past tasks in under 50ms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3 (LLM Rerank):&lt;/strong&gt; Passes the semantic results to a local Ollama instance to filter out contextually irrelevant data in under 500ms, ensuring the execution agent only receives high-fidelity context.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Agentic Brain &amp;amp; Multi-Role Teams
&lt;/h3&gt;

&lt;p&gt;Instead of throwing a massive, complex prompt at a single coding agent, TechSphereX mimics a multi-role engineering team. The pipeline starts with a &lt;strong&gt;BA Agent&lt;/strong&gt; (Business Analyst).&lt;/p&gt;

&lt;p&gt;When you submit a goal, the BA Agent decomposes the request into distinct User Stories, assigns Fibonacci story points, and pushes them into an SQLite-backed priority queue. The system then orchestrates these tasks across specific CLIs based on their strengths: Grok handles the research phase, Claude takes on coding, and AGY handles testing and evaluation.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Server-Sent Events (SSE) and The CLI Bridge
&lt;/h3&gt;

&lt;p&gt;Managing asynchronous CLI tools running in different terminal processes requires robust communication. TechSphereX utilizes a Python-based CLI Bridge running on the host network.&lt;/p&gt;

&lt;p&gt;As tasks populate the queue, the orchestrator uses Server-Sent Events (SSE) to push tasks to available CLIs. The CLIs report their real-time status (busy, idle, offline) back to the centralized FastAPI engine, which updates the React frontend dashboard instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Strict Security and Human-in-the-Loop (HITL) Gates
&lt;/h3&gt;

&lt;p&gt;While autonomy is the goal, running unconstrained AI on your local file system is dangerous. The system enforces strict security boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security &amp;amp; Delete Operations:&lt;/strong&gt; Any task involving deletion or critical security changes hits a hard stop. It requires explicit Human-in-the-Loop approval via the dashboard or Telegram notification. It will never auto-escalate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standard Timeout Bypasses:&lt;/strong&gt; For non-critical tasks, if a multi-agent deliberation stalls or requires input and you do not respond within 180 seconds, the orchestrator forces a fallback strategy to keep the pipeline moving without blocking the queue.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Tech Stack: A Polyglot Monorepo
&lt;/h2&gt;

&lt;p&gt;To achieve the right balance of speed, memory safety, and UI responsiveness, I architected this as a polyglot monorepo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core Engine:&lt;/strong&gt; Python 3.10+ and FastAPI (0.115) handle the heavy lifting, asynchronous agent loops, and routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector &amp;amp; Local LLM:&lt;/strong&gt; Qdrant manages the experience storage, while Ollama handles the reranking and local inference.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desktop Dashboard:&lt;/strong&gt; React 19 combined with Tauri 2.0 (Rust) provides a blazing-fast, lightweight desktop interface for monitoring the fleet, managing the HITL queue, and viewing the knowledge graph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI Hooks:&lt;/strong&gt; PowerShell and Bash scripts natively wrap existing CLI tools (like Claude and Grok) so they report their telemetry back to the central engine without modifying their source code.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Once running, navigate to &lt;code&gt;http://localhost:5173/goals&lt;/code&gt;, submit a prompt, and watch the BA Agent decompose the work while the CLI fleet automatically claims and executes the tasks.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Next?
&lt;/h2&gt;

&lt;p&gt;The Phase 11 Agentic Brain is fully operational, but the next step is extending the feedback loop. I am currently working on a mechanism where the outcome of multi-agent deliberations directly updates the L2 Qdrant embeddings, allowing the system to completely avoid past architectural mistakes without human correction.&lt;/p&gt;

&lt;p&gt;TechSphereX Studio is entirely open-source under the MIT License. If you are exploring autonomous agent loops, multi-agent frameworks, or just trying to organize your AI coding tools, I would love to hear your thoughts on this architecture.&lt;/p&gt;

&lt;p&gt;Check out the documentation and the live environment layout here: &lt;a href="https://khaitrang1995.github.io/techspherex-studio/" rel="noopener noreferrer"&gt;https://khaitrang1995.github.io/techspherex-studio/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agentskills</category>
      <category>agents</category>
    </item>
    <item>
      <title>Building an Enterprise RAG &amp; Knowledge Graph Engine with Governed AI Workflows</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Tue, 09 Jun 2026 06:55:03 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/building-an-enterprise-rag-knowledge-graph-engine-with-governed-ai-workflows-851</link>
      <guid>https://dev.to/khaitrang1995/building-an-enterprise-rag-knowledge-graph-engine-with-governed-ai-workflows-851</guid>
      <description>&lt;p&gt;As large language models (LLMs) take over the enterprise landscape, organizations face a massive challenge: &lt;strong&gt;How do we make fragmented corporate knowledge searchable and actionable without sacrificing security, audibility, and data relationships?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Standard RAG (Retrieval-Augmented Generation) patterns often fall short. They treat documents as isolated text chunks, lose the rich semantic connections between entities, and frequently lack enterprise-grade data governance boundaries.&lt;/p&gt;

&lt;p&gt;To solve this, I’ve been working on &lt;strong&gt;Nexus-KB&lt;/strong&gt; — an open-source reference architecture designed for building secure, production-grade &lt;strong&gt;Enterprise RAG and Knowledge Graph platforms&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Here is a deep dive into how it bridges the gap between raw vector search and governed enterprise AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ The Architecture At A Glance
&lt;/h2&gt;

&lt;p&gt;Nexus-KB addresses fragmented enterprise knowledge by making documents searchable, reviewable, auditable, and graph-aware. Instead of a single monolithic pipeline, it separates ingestion, human-in-the-loop validation, semantic indexing, and graph construction into decoupled layers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
    Source[Local files / Obsidian / MCP source] --&amp;gt; Parser[Document Parser Worker]
    Parser --&amp;gt; Review{Review policy}
    Review --&amp;gt;|Approved / direct commit| Metadata[(PostgreSQL)]
    Review --&amp;gt;|Approved / direct commit| Vector[(Qdrant)]
    Review --&amp;gt;|Low confidence| Queue[Review Queue]
    Queue --&amp;gt;|Approve / modify| Metadata
    Queue --&amp;gt;|Approve / modify| Vector
    Metadata --&amp;gt; Graph[Graph Builder Worker]
    Graph --&amp;gt; GraphTables[(Relational graph tables)]
    API[FastAPI] --&amp;gt; Metadata
    API --&amp;gt; Vector
    API --&amp;gt; GraphTables
    API --&amp;gt; Audit[(Audit logs)]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🚀 Key Architectural Pillars
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Hybrid Storage: PostgreSQL + Qdrant
&lt;/h3&gt;

&lt;p&gt;Pure vector databases are great for semantic search but struggle with complex transactional metadata, role-based access control (RBAC) filtering, and structured auditing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Qdrant (3-node HA Cluster)&lt;/strong&gt; handles high-availability vector embeddings utilizing the advanced &lt;code&gt;BAAI/bge-m3&lt;/code&gt; model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostgreSQL (v16)&lt;/strong&gt; acts as the relational source-of-truth, storing strict document metadata, ingestion runs, immutable audit logs, human review items, and structured graph records.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Obsidian &amp;amp; Markdown Intelligence
&lt;/h3&gt;

&lt;p&gt;Corporate knowledge isn't just plain text; it has hierarchy and connections. The document parser natively handles Markdown and Obsidian vaults, automatically extracting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;YAML frontmatter and custom tags.&lt;/li&gt;
&lt;li&gt;Wiki-style cross-links (&lt;code&gt;[[WikiLink]]&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Section paths based on header hierarchy for smarter chunking.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Human-in-the-Loop Review &amp;amp; Hardened Auditing
&lt;/h3&gt;

&lt;p&gt;Enterprise AI requires high precision. Nexus-KB includes a &lt;strong&gt;Review Queue workflow&lt;/strong&gt;. If an ingestion run or an AI extraction outputs low-confidence scores, chunks are routed to a human review queue supporting approve/reject/modify flows via mock reviewer RBAC.&lt;/p&gt;

&lt;p&gt;Every single operation — from ingestion and document reads to search queries and review actions — generates &lt;strong&gt;immutable audit events&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Model Context Protocol (MCP) Boundaries
&lt;/h3&gt;

&lt;p&gt;To securely ingest third-party enterprise platforms, Nexus-KB leverages an &lt;strong&gt;MCP Source Connector Scaffold&lt;/strong&gt; (specifically a &lt;code&gt;confluence-bridge&lt;/code&gt;). It enforces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strict user-context authorization.&lt;/li&gt;
&lt;li&gt;Disabled mutating tools by default.&lt;/li&gt;
&lt;li&gt;Redacted error messages to prevent internal leakage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Knowledge Graph Construction
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;workers/graph-builder&lt;/code&gt; asynchronous worker extracts entities and relationships from approved data chunks, merges duplicates, stores confidence/provenance metrics, and injects &lt;strong&gt;graph context fields&lt;/strong&gt; directly into the hybrid search results for a richer LLM context window.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ The Tech Stack
&lt;/h2&gt;

&lt;p&gt;Nexus-KB is built with a modern, highly efficient Python ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend Framework:&lt;/strong&gt; FastAPI (0.115)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ORM &amp;amp; Migrations:&lt;/strong&gt; SQLAlchemy (2.0) &amp;amp; Alembic (1.14)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector Engine:&lt;/strong&gt; Qdrant Client (v1.13)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing:&lt;/strong&gt; Pytest (8.3) with support for full Docker-backed live integration tests.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ Getting Started (Local Quickstart)
&lt;/h2&gt;

&lt;p&gt;Want to explore the codebase or test it locally? Here’s the fast track using a local Docker-backed stack:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Spin Up Local Infrastructure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repository and boot PostgreSQL + Qdrant&lt;/span&gt;
docker compose up &lt;span class="nt"&gt;-d&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Run Database Migrations
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;alembic &lt;span class="nt"&gt;-c&lt;/span&gt; infrastructure/alembic.ini upgrade &lt;span class="nb"&gt;head&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Launch the FastAPI Gateway
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PYTHONPATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"packages/shared-contracts:packages/vector-client:workers/document-parser:workers/graph-builder:services/nexus-api"&lt;/span&gt;
uvicorn nexus_api.main:app &lt;span class="nt"&gt;--reload&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Head over to &lt;code&gt;http://127.0.0.1:8000/docs&lt;/code&gt; to explore the interactive Swagger documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Execute a Governed Hybrid Search
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"[http://127.0.0.1:8000/api/v1/search](http://127.0.0.1:8000/api/v1/search)"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"query":"governed retrieval","limit":5,"tags":["rag"]}'&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🗺️ What’s Next on the Roadmap?
&lt;/h2&gt;

&lt;p&gt;The core architecture is solid, but there's always more to build. Future work includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Production-ready authentication/OIDC adapters.&lt;/li&gt;
&lt;li&gt;[ ] A full Web Admin console for managing review queues and graph entities visually.&lt;/li&gt;
&lt;li&gt;[ ] Enterprise connector adapters for live Confluence and Sharepoint environments.&lt;/li&gt;
&lt;li&gt;[ ] Production API Gateway hardening and OpenTelemetry export setups.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🤝 Open Source &amp;amp; Contributions
&lt;/h2&gt;

&lt;p&gt;Nexus-KB is licensed under the &lt;strong&gt;MIT License&lt;/strong&gt; and is fully open-source.&lt;/p&gt;

&lt;p&gt;If you are passionate about AI Engineering, Knowledge Graphs, and RAG architectures, I'd love to hear your thoughts on this design! Check out the project layout, drop a comment below, or let's connect to discuss how you approach data governance in your LLM workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  View all: &lt;a href="https://khaitrang1995.github.io/nexus-kb/" rel="noopener noreferrer"&gt;https://khaitrang1995.github.io/nexus-kb/&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Happy coding! If you find this architecture interesting, don't forget to ❤️ and bookmark this post!&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>wiki</category>
      <category>agents</category>
      <category>architecture</category>
      <category>rag</category>
    </item>
    <item>
      <title>Hermes Directory Structure Template</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Thu, 21 May 2026 00:40:43 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/hermes-directory-structure-template-2bak</link>
      <guid>https://dev.to/khaitrang1995/hermes-directory-structure-template-2bak</guid>
      <description>&lt;h1&gt;
  
  
  Hermes Directory Structure Template
&lt;/h1&gt;

&lt;p&gt;This repository provides a standardized filesystem layout template for the &lt;code&gt;~/.hermes&lt;/code&gt; folder, organized systematically by purpose. It serves as a boilerplate for configuring, extending, and managing Hermes AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filesystem Layout
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.hermes/
├── config.yaml                 # Main configuration
├── .env                        # API keys and secrets
├── auth.json                   # OAuth provider credentials
├── SOUL.md                     # Agent identity (slot #1 in system prompt)
├── memories/
│   ├── MEMORY.md               # Persistent agent facts
│   └── USER.md                 # User model
├── skills/                     # All skills (bundled, hub, agent-created)
│   ├── mlops/
│   │   ├── axolotl/
│   │   │   ├── SKILL.md        # The system prompt for the skill
│   │   │   ├── references/     # Docs the agent reads
│   │   │   └── scripts/        # Executable helpers
│   │   └── vllm/
│   ├── devops/
│   └── .hub/                   # Skills Hub state
├── sessions/                   # Per-platform session metadata
├── state.db                    # SQLite session store with FTS5
├── cron/
│   ├── jobs.json               # Scheduled jobs
│   └── output/                 # Cron run outputs
├── plugins/                    # Custom plugins
├── hooks/                      # Lifecycle hooks
├── skins/                      # CLI themes
└── logs/
    ├── agent.log               # Core agent diagnostics
    ├── gateway.log             # Gateway traffic logs
    └── errors.log              # Error tracking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Component Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Configuration
&lt;/h3&gt;

&lt;p&gt;Core files that the agent boots from on every single run.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;config.yaml&lt;/code&gt;&lt;/strong&gt;: Handles global settings, model endpoints, and operational parameters.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;.env&lt;/code&gt;&lt;/strong&gt;: Local environment variables dedicated to sensitive API keys and tokens.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;auth.json&lt;/code&gt;&lt;/strong&gt;: Manages active OAuth tokens and multi-provider credentials.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;SOUL.md&lt;/code&gt;&lt;/strong&gt;: Defines the core identity, behavioral constraints, and personality baseline of the agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Knowledge
&lt;/h3&gt;

&lt;p&gt;Persistent memory layers that span across all active communication channels and sessions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;MEMORY.md&lt;/code&gt;&lt;/strong&gt;: Fact base and long-term world knowledge collected by the agent.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;USER.md&lt;/code&gt;&lt;/strong&gt;: Profile, preferences, and behavioral insights compiled about the user.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Capabilities (Skills)
&lt;/h3&gt;

&lt;p&gt;Modular skill packs that grant specific executable abilities to the agent. Skills can be built-in, downloaded via the Hub, or dynamically generated by the agent itself.&lt;/p&gt;

&lt;p&gt;Each individual skill follows a strict internal structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;SKILL.md&lt;/code&gt;&lt;/strong&gt;: The technical system prompt instructing the agent how and when to invoke the skill.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;references/&lt;/code&gt;&lt;/strong&gt;: Contextual documentation, API specs, or reference guides required by the skill.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;scripts/&lt;/code&gt;&lt;/strong&gt;: Executable automation code, binaries, or helper tools that the skill triggers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Runtime State
&lt;/h3&gt;

&lt;p&gt;Tracks ephemeral execution data and platform alignment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;sessions/&lt;/code&gt;&lt;/strong&gt;: Stores metadata partitioned by specific platforms (e.g., Slack, Discord, Terminal).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;state.db&lt;/code&gt;&lt;/strong&gt;: Embedded SQLite database utilizing FTS5 extension for ultra-fast, full-text historical search.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Automation
&lt;/h3&gt;

&lt;p&gt;Allows the agent to execute periodic, autonomous operations without explicit user invocation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;cron/jobs.json&lt;/code&gt;&lt;/strong&gt;: Defines schedules, intervals, and target functions for background tasks.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;cron/output/&lt;/code&gt;&lt;/strong&gt;: Captures execution logs and standard output so the agent can audit its own background tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Extension
&lt;/h3&gt;

&lt;p&gt;The dedicated customization surface area for advanced customization.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;plugins/&lt;/code&gt;&lt;/strong&gt;: Standalone logic blocks that extend core architectural capabilities.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;hooks/&lt;/code&gt;&lt;/strong&gt;: Interceptors for system lifecycle events (e.g., pre-boot, post-response).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;&lt;code&gt;skins/&lt;/code&gt;&lt;/strong&gt;: Custom visual definitions and styling sheets for the command-line interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. Observability
&lt;/h3&gt;

&lt;p&gt;Dedicated diagnostics system for error isolation, routine auditing, and debugging.&lt;/p&gt;

&lt;p&gt;Logs are separated by subsystem (&lt;code&gt;agent.log&lt;/code&gt;, &lt;code&gt;gateway.log&lt;/code&gt;, &lt;code&gt;errors.log&lt;/code&gt;) to streamline stack trace analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;To initialize this structure locally inside your environment, clone this template directly into your home directory or target path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/KhaiTrang1995/hermes-structure.git ~/.hermes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>hermes</category>
      <category>ai</category>
      <category>architecture</category>
      <category>agents</category>
    </item>
    <item>
      <title>How I Discovered and Deobfuscated a Hidden PHP Backdoor on My Server</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Sat, 16 May 2026 06:31:42 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/how-i-discovered-and-deobfuscated-a-hidden-php-backdoor-on-my-server-4mod</link>
      <guid>https://dev.to/khaitrang1995/how-i-discovered-and-deobfuscated-a-hidden-php-backdoor-on-my-server-4mod</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ak4wgrhtd8v3dfzg0pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ak4wgrhtd8v3dfzg0pf.png" alt=" " width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As developers and system architects, we often secure our code but neglect the silent threats lurking in old directories or clever obfuscations. Recently, I caught a stealthy PHP backdoor ([random_name].php) embedded in a system.&lt;/p&gt;

&lt;p&gt;Instead of just deleting it, I decided to perform a full reverse engineering to understand exactly how it works, how it bypasses scanners, and how it maintains persistence on a server.&lt;/p&gt;

&lt;p&gt;Here is a quick summary of what I found during the analysis.&lt;/p&gt;

&lt;p&gt;🔍 The Anatomy of the Malware&lt;br&gt;
At first glance, the file was heavily obfuscated using multiple layers of encoding to look like harmless gibberish. However, the core mechanism relied on a classic but dangerous pattern:&lt;/p&gt;

&lt;p&gt;PHP&lt;br&gt;
// The malicious pattern used to execute hidden code&lt;br&gt;
eval(base64_decode($_POST['encoded_payload']));&lt;br&gt;
Key Techniques Used by the Attacker:&lt;br&gt;
Layered Obfuscation: The code utilized deep base64 nesting combined with string manipulation functions to evade signature-based security scanners.&lt;/p&gt;

&lt;p&gt;Hidden Tar Extraction: Deep inside the encoded strings, the malware contained a compressed TAR structure. Once triggered, it extracts a full-featured web shell into the server directories.&lt;/p&gt;

&lt;p&gt;SSH Persistence: The ultimate goal wasn't just to execute commands once—the script was designed to inject malicious public keys into the server's ~/.ssh/authorized_keys file, granting the attacker permanent, direct SSH access without leaving a footprint in the web logs.&lt;/p&gt;

&lt;p&gt;🛠️ How to Protect Your System&lt;br&gt;
If you suspect your server has been compromised, simply deleting the .php file might not be enough. You need to:&lt;/p&gt;

&lt;p&gt;Check your ~/.ssh/authorized_keys for unauthorized entries.&lt;/p&gt;

&lt;p&gt;Audit your system cronjobs to ensure the malware doesn't have a re-infection script scheduled.&lt;/p&gt;

&lt;p&gt;Implement strict file permissions (chmod 644 for files, 755 for directories) and disable dangerous PHP functions like eval(), exec(), and passthru() in your php.ini.&lt;/p&gt;

&lt;p&gt;📖 Read the Full Deep Dive&lt;br&gt;
I have documented the complete step-by-step deobfuscation process, the code breakdown, directory structures, and full remediation steps on GitHub.&lt;/p&gt;

&lt;p&gt;👉 See full analysis and source code breakdown here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor" rel="noopener noreferrer"&gt;https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can view the repository directly:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/KhaiTrang1995" rel="noopener noreferrer"&gt;
        KhaiTrang1995
      &lt;/a&gt; / &lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor" rel="noopener noreferrer"&gt;
        Malware-Analysis-Reports-PHP-Backdoor
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Malware-Analysis-Reports-PHP-Backdoor&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🔴 Malware Analysis Report: &lt;code&gt;[random_name].php&lt;/code&gt;
&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Classification:&lt;/strong&gt; PHP Web Shell (Backdoor)&lt;br&gt;
&lt;strong&gt;Risk Level:&lt;/strong&gt; CRITICAL&lt;br&gt;
&lt;strong&gt;Disguise:&lt;/strong&gt; "PHP File Manager ver 1.5"&lt;br&gt;
&lt;strong&gt;File Size:&lt;/strong&gt; ~82 KB / 2,010 lines&lt;br&gt;
&lt;strong&gt;Date Analyzed:&lt;/strong&gt; 2026-05-16&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="markdown-alert markdown-alert-caution"&gt;
&lt;p class="markdown-alert-title"&gt;Caution&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DO NOT EXECUTE THIS FILE.&lt;/strong&gt; It is a fully weaponized PHP web shell capable of complete server takeover. This document is for forensic analysis and educational purposes only.&lt;/p&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Table of Contents&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#1-executive-summary" rel="noopener noreferrer"&gt;Executive Summary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#2-capability-matrix" rel="noopener noreferrer"&gt;Capability Matrix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#3-detailed-technical-analysis" rel="noopener noreferrer"&gt;Detailed Technical Analysis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#31-os-command-execution-remote-terminal" rel="noopener noreferrer"&gt;3.1 OS Command Execution (Remote Terminal)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#32-database-administration--exfiltration" rel="noopener noreferrer"&gt;3.2 Database Administration &amp;amp; Exfiltration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#33-arbitrary-php-code-execution" rel="noopener noreferrer"&gt;3.3 Arbitrary PHP Code Execution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#34-file-system-operations" rel="noopener noreferrer"&gt;3.4 File System Operations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#35-web-proxy--network-pivoting-ssrf" rel="noopener noreferrer"&gt;3.5 Web Proxy / Network Pivoting (SSRF)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#36-recursive-reconnaissance--credential-harvesting" rel="noopener noreferrer"&gt;3.6 Recursive Reconnaissance &amp;amp; Credential Harvesting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#37-archive-manipulation" rel="noopener noreferrer"&gt;3.7 Archive Manipulation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#4-anti-forensics--evasion-techniques" rel="noopener noreferrer"&gt;Anti-Forensics &amp;amp; Evasion Techniques&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#41-timestomping" rel="noopener noreferrer"&gt;4.1 Timestomping&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#42-self-modification-polymorphic-behavior" rel="noopener noreferrer"&gt;4.2 Self-Modification (Polymorphic Behavior)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#43-single-file-encapsulation" rel="noopener noreferrer"&gt;4.3 Single-File Encapsulation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#44-disabled-function-bypass" rel="noopener noreferrer"&gt;4.4 Disabled Function Bypass&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#45-cookie-based-configuration-persistence" rel="noopener noreferrer"&gt;4.5 Cookie-Based Configuration Persistence&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#5-authentication-mechanism" rel="noopener noreferrer"&gt;Authentication Mechanism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#6-indicators-of-compromise-iocs" rel="noopener noreferrer"&gt;Indicators of Compromise (IOCs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#7-mitre-attck-mapping" rel="noopener noreferrer"&gt;MITRE ATT&amp;amp;CK Mapping&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#8-remediation-guidance" rel="noopener noreferrer"&gt;Remediation Guidance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#9-execution-flow-diagrams" rel="noopener noreferrer"&gt;Execution Flow Diagrams&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#91-main-request-router" rel="noopener noreferrer"&gt;9.1 Main Request Router&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#92-terminal-command-execution-cascade" rel="noopener noreferrer"&gt;9.2 Terminal Command Execution Cascade&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor#93-anti-forensics-pipeline" rel="noopener noreferrer"&gt;9.3&lt;/a&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/KhaiTrang1995/Malware-Analysis-Reports-PHP-Backdoor" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Tags: #php #security #devsecops #malware&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>discuss</category>
      <category>devsecops</category>
    </item>
    <item>
      <title>Deconstructing Claude Code Architecture: A Deep Dive into Multi-Agent Orchestration</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Tue, 12 May 2026 04:27:49 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/deconstructing-claude-code-architecture-a-deep-dive-into-multi-agent-orchestration-3d8h</link>
      <guid>https://dev.to/khaitrang1995/deconstructing-claude-code-architecture-a-deep-dive-into-multi-agent-orchestration-3d8h</guid>
      <description>&lt;p&gt;The landscape of AI coding assistants is shifting rapidly from simple autocomplete tools to autonomous, multi-agent systems. Recently, I’ve been analyzing the architecture behind &lt;strong&gt;Claude Code&lt;/strong&gt;, and it’s a masterclass in orchestrating complex coding tasks, managing huge contexts, and optimizing for performance. &lt;/p&gt;

&lt;p&gt;If you are fascinated by AI system design, prompt architectures, or just want to know how the magic happens under the hood, let's break down this architecture map.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffldkydohf9f1ekl8ad3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffldkydohf9f1ekl8ad3j.png" alt=" " width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To explore a more detailed and interactive version of this architecture, you can check out my dedicated page here: &lt;strong&gt;&lt;a href="https://khaitrang1995.github.io/claude-code-architecture/" rel="noopener noreferrer"&gt;Claude Code Architecture Breakdown&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Core: The Master Agent Loop
&lt;/h3&gt;

&lt;p&gt;At the heart of the system is the &lt;strong&gt;Master Agent Loop&lt;/strong&gt;. Unlike linear scripts, this loop operates on a continuous cycle of &lt;strong&gt;Perception → Action → Observation&lt;/strong&gt;. It constantly evaluates the current state of the workspace, decides on the next logical step, executes it, and observes the result before moving forward.&lt;/p&gt;

&lt;p&gt;This loop acts as the central brain, but what makes it truly scalable is how it delegates tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Knowledge Layer: Taming the Context Window
&lt;/h3&gt;

&lt;p&gt;Handling massive codebases requires smart context management. You can't just dump 100,000 lines of code into a prompt and expect good results. Claude Code handles this elegantly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context Compressor:&lt;/strong&gt; Uses a 3-layer compression system (hitting a 92% threshold) to keep the token usage lean without losing crucial logic. It writes state directly to an &lt;code&gt;.agent_memory.md&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skill Registry &amp;amp; Memory Store:&lt;/strong&gt; Injects specific "skills" on-demand rather than bloating the system prompt. It also persists memory across sessions, meaning the agent remembers the quirks of your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Execution Layer &amp;amp; Performance Tricks
&lt;/h3&gt;

&lt;p&gt;This is where the actual "coding" happens, and it's optimized for speed and cost.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prompt Cache:&lt;/strong&gt; This is arguably the most critical feature for high-performance AI agents. By utilizing stable prefix reuse, the system drops API costs down to ~10%. When you are running continuous loops, caching is the difference between a viable product and an instant budget drain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming Runtime &amp;amp; Tool Dispatch:&lt;/strong&gt; Supports real-time, parallel execution with dedicated handlers for specific bash commands, read/write operations, and AST parsing (grep/glob).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. The Multi-Agent Layer: Divide and Conquer
&lt;/h3&gt;

&lt;p&gt;When a task is too big for a single loop, the Master Agent spawns &lt;strong&gt;Subagents&lt;/strong&gt;. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Isolated Contexts:&lt;/strong&gt; Each subagent gets a clean, isolated context to prevent hallucination cross-contamination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FSM Protocol &amp;amp; Redis Pub/Sub:&lt;/strong&gt; Subagents communicate via "Teammate Mailboxes" (using Redis-like pub/sub mechanisms) and follow a strict Finite State Machine protocol (&lt;code&gt;IDLE → REQUEST → WAIT → RESPOND&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Conflict Execution:&lt;/strong&gt; Through the &lt;code&gt;Worktree Isolator&lt;/code&gt;, tasks are executed on per-task branches with atomic locks, ensuring that multiple agents don't overwrite each other's code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Integration via MCP
&lt;/h3&gt;

&lt;p&gt;The system leans heavily on the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; runtime to auto-discover tools and interface safely with the local Filesystem, Git repositories, or custom external servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;What stands out to me about the Claude Code architecture is how much it mirrors modern distributed backend systems. It treats AI generation not as a single API call, but as a coordinated fleet of microservices (agents) managing state, caching aggressively, and communicating asynchronously. &lt;/p&gt;

&lt;p&gt;Building systems like this requires a deep understanding of both LLM limitations and robust software engineering principles. &lt;/p&gt;

&lt;p&gt;What are your thoughts on multi-agent architectures? Have you tried implementing similar context compression or caching tricks in your own AI setups? Let's discuss in the comments!&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Don't forget to check out the full architecture details here:&lt;/strong&gt; &lt;a href="https://khaitrang1995.github.io/claude-code-architecture/" rel="noopener noreferrer"&gt;khaitrang1995.github.io/claude-code-architecture&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agentskills</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Stop your AI Coding Agent from making the same mistake twice</title>
      <dc:creator>TechsphereX AI</dc:creator>
      <pubDate>Thu, 07 May 2026 13:01:26 +0000</pubDate>
      <link>https://dev.to/khaitrang1995/stop-your-ai-coding-agent-from-making-the-same-mistake-twice-blh</link>
      <guid>https://dev.to/khaitrang1995/stop-your-ai-coding-agent-from-making-the-same-mistake-twice-blh</guid>
      <description>&lt;p&gt;Building TechSphereX Studio: Giving AI Agents a Memory&lt;br&gt;
Have you ever found yourself correcting GitHub Copilot or Cursor for the exact same bug or architectural pattern you fixed last week?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fic7riv7tiyby5v3dlpoz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fic7riv7tiyby5v3dlpoz.png" alt=" " width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As AI agents become more integrated into our workflows, they often lack the "institutional memory" of our specific team's codebase, security standards, and past hard-learned lessons.&lt;/p&gt;

&lt;p&gt;That’s why I built TechSphereX Studio — an AI Experience Engine that intercepts AI actions and provides real-time, context-aware suggestions.&lt;/p&gt;
&lt;h2&gt;
  
  
  ✨ What is TechSphereX Studio?
&lt;/h2&gt;

&lt;p&gt;It is a self-learning system designed to act as a bridge between your AI agent and your team's accumulated knowledge base.&lt;/p&gt;
&lt;h3&gt;
  
  
  The 3-Layer Intercept Pipeline:
&lt;/h3&gt;

&lt;p&gt;L1 (Read-only Filter): Instantly skips non-destructive actions like ls or cat (&amp;lt; 1ms).&lt;/p&gt;

&lt;p&gt;L2 (Semantic Search): Uses vector embeddings (Qdrant) to find relevant past "experiences" (&amp;lt; 50ms).&lt;/p&gt;

&lt;p&gt;L3 (LLM Anti-Noise): A local LLM (via Ollama) filters out irrelevant results to ensure high-quality suggestions (&amp;lt; 500ms).&lt;/p&gt;
&lt;h3&gt;
  
  
  🛠 The "Polyglot" Tech Stack
&lt;/h3&gt;

&lt;p&gt;One of the most exciting parts of this project was working across multiple languages in a single monorepo:&lt;/p&gt;

&lt;p&gt;🐍 Python (FastAPI + Qdrant): The core engine handling the AI pipeline and vector database.&lt;/p&gt;

&lt;p&gt;🦀 Rust (Tauri 2.0): Powering a high-performance native desktop dashboard.&lt;/p&gt;

&lt;p&gt;⚛️ React 19 + Vite 6: A modern UI for managing "experiences" and viewing KPIs.&lt;/p&gt;

&lt;p&gt;📘 TypeScript: Used for the VS Code Extension, CLI tool, and shared SDK.&lt;/p&gt;
&lt;h3&gt;
  
  
  🏗 Architecture at a Glance
&lt;/h3&gt;

&lt;p&gt;The system is designed to be modular. Whether you are using the VS Code Extension, the CLI, or the Desktop App, everything communicates with the central FastAPI engine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dot"&gt;&lt;code&gt;&lt;span class="k"&gt;graph&lt;/span&gt; &lt;span class="nv"&gt;TD&lt;/span&gt;
    &lt;span class="nv"&gt;EXT&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"VS Code Extension"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;API&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"FastAPI Core"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="nv"&gt;CLI&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CLI Tool"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;API&lt;/span&gt;
    &lt;span class="nv"&gt;DESK&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Tauri Desktop"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;API&lt;/span&gt;
    &lt;span class="nv"&gt;API&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;QDRANT&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Qdrant Vector DB"&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🚀 How it works with your AI Agent
&lt;/h3&gt;

&lt;p&gt;Once you start the engine and configure your agent (Copilot, Cursor, Gemini, or Claude), the magic happens:&lt;/p&gt;

&lt;p&gt;You: "Create a database connection."&lt;/p&gt;

&lt;p&gt;Agent: Queries TechSphereX POST /api/intercept.&lt;/p&gt;

&lt;p&gt;Engine: Returns suggestions like "⚠️ CRITICAL: Use Singleton Pattern for DB connections."&lt;/p&gt;

&lt;p&gt;Agent: Writes the code correctly the first time. ✅&lt;/p&gt;

&lt;p&gt;🛡 Overcoming Challenges: The Windows Defender Issue&lt;br&gt;
Bundling a Python AI engine into a Windows .exe using PyInstaller came with a surprise: False Positives. Because the bootloader extracts files to %TEMP% and contains ML libraries like PyTorch, some AVs flag it. I’ve documented my mitigation steps (disabling UPX, adding PE metadata) in the README to help others facing the same struggle!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9f2sbmsavqlbjvirkcd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9f2sbmsavqlbjvirkcd5.png" alt=" " width="800" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📂 Open Source &amp;amp; Future
&lt;/h3&gt;

&lt;p&gt;This project is currently in v0.1 and is fully open-source. Upcoming features include:&lt;/p&gt;

&lt;p&gt;Team sync for cloud experience sharing.&lt;/p&gt;

&lt;p&gt;Native hooks for Copilot PreToolUse/PostToolUse.&lt;/p&gt;

&lt;p&gt;JetBrains plugin support.&lt;/p&gt;

&lt;p&gt;Check out the repo here: &lt;a href="https://github.com/KhaiTrang1995/techspherex-studio" rel="noopener noreferrer"&gt;https://github.com/KhaiTrang1995/techspherex-studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your thoughts! How are you managing "knowledge" with your AI agents?&lt;/p&gt;

&lt;h1&gt;
  
  
  AI #OpenSource #Python #Rust #TypeScript #Productivity
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>agentskills</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
