<?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: Filippo Gabriele</title>
    <description>The latest articles on DEV Community by Filippo Gabriele (@filippo_gabriele_d9562a25).</description>
    <link>https://dev.to/filippo_gabriele_d9562a25</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%2F4042358%2F171b0696-1891-46ff-8743-ffa6494a8e89.png</url>
      <title>DEV Community: Filippo Gabriele</title>
      <link>https://dev.to/filippo_gabriele_d9562a25</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/filippo_gabriele_d9562a25"/>
    <language>en</language>
    <item>
      <title>Stop AI Agents From Breaking Your Architecture: Introducing LORE (100% Local Knowledge Graph)</title>
      <dc:creator>Filippo Gabriele</dc:creator>
      <pubDate>Wed, 22 Jul 2026 16:18:25 +0000</pubDate>
      <link>https://dev.to/filippo_gabriele_d9562a25/stop-ai-agents-from-breaking-your-architecture-introducing-lore-100-local-knowledge-graph-1epp</link>
      <guid>https://dev.to/filippo_gabriele_d9562a25/stop-ai-agents-from-breaking-your-architecture-introducing-lore-100-local-knowledge-graph-1epp</guid>
      <description>&lt;p&gt;AI coding assistants like Cursor, Claude Code, Copilot, and Devin are insanely good at writing syntax. But they suffer from a fundamental flaw: &lt;strong&gt;Contextual Amnesia&lt;/strong&gt;.&lt;br&gt;
An LLM refactoring an endpoint has no idea that a specific parameter was introduced 6 months ago to meet a performance SLA, or that modifying a function breaks an implicit co-change dependency with another module. &lt;br&gt;
When team size grows or senior developers leave, this knowledge debt leads to silent architectural decay.&lt;/p&gt;

&lt;h2&gt;
  
  
  To solve this without sending your codebase or graph data to third-party cloud services, I built &lt;strong&gt;LORE&lt;/strong&gt;—a local-first engine that constructs a &lt;strong&gt;5-layer Knowledge Graph&lt;/strong&gt; from your repository evidence to act as a semantic firewall during code modifications.
&lt;/h2&gt;

&lt;p&gt;**What LORE Does (Detector &amp;amp; CI/CD Gatekeeper)&lt;br&gt;
**LORE is an architectural regression detector and CI/CD gatekeeper. It intercepts code diffs (via CLI, pre-commit hooks, MCP, or SARIF output in CI/CD) and validates them against historical constraints mined from your repository.&lt;br&gt;
The Knowledge Graph combines five analysis layers into a local SQLite database using &lt;code&gt;sqlite-vec&lt;/code&gt; for C-accelerated offline vector embeddings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;L1 (Structural AST):&lt;/strong&gt; Multi-language symbol extraction using &lt;code&gt;tree-sitter&lt;/code&gt; and &lt;code&gt;libcst&lt;/code&gt; (Python, Go, TypeScript/JS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;L2 (Local Semantic Vector Store):&lt;/strong&gt; Local embeddings generated for symbol intent and docstrings via &lt;code&gt;sqlite-vec&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;L3 (Historical Co-Changes &amp;amp; Fragility):&lt;/strong&gt; Mines historical Git commit co-occurrence patterns to detect coupled files and symbol fix-density.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;L4 (Decisional Links):&lt;/strong&gt; Connects structural symbols to past PRs, commits, and Architectural Decision Records (ADRs).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;L5 (Policy &amp;amp; Boundary Guard):&lt;/strong&gt; Detects removed entry guards and comparison operator shifts (&lt;code&gt;&amp;gt;&lt;/code&gt; weakening to &lt;code&gt;&amp;gt;=&lt;/code&gt;).
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Empirical Performance (Django &amp;amp; LangChain Benchmark)
&lt;/h2&gt;

&lt;p&gt;To test detection accuracy without synthetic LLM data, I evaluated LORE over &lt;strong&gt;199 real commits&lt;/strong&gt; from the Git histories of Django (&lt;code&gt;django/django&lt;/code&gt;) and LangChain (&lt;code&gt;langchain-ai/langchain&lt;/code&gt;) using a strict &lt;strong&gt;Time-Split Protocol&lt;/strong&gt; ($T_{\text{split}}$) to prevent data leakage:&lt;br&gt;
| Metric | Performance | Impact |&lt;br&gt;
| :--- | :---: | :--- |&lt;br&gt;
| &lt;strong&gt;High-Signal Precision&lt;/strong&gt; | &lt;strong&gt;97.2%&lt;/strong&gt; [85.8%–99.5%] | When LORE issues a critical alert, 97.2% of the time it is a true regression. |&lt;br&gt;
| &lt;strong&gt;Clean PR False Positive Rate&lt;/strong&gt; | &lt;strong&gt;1.0%&lt;/strong&gt; [0.2%–5.4%] | Near-zero alert fatigue on benign refactoring and documentation PRs. |&lt;/p&gt;

&lt;h2&gt;
  
  
  | &lt;strong&gt;Overall Noise Reduction&lt;/strong&gt; | &lt;strong&gt;88.7% Reduction&lt;/strong&gt; | Precision-calibrated thresholds eliminate alert fatigue in production pipelines. |
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Quick Start: Trying LORE in 60 Seconds
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Install via PyPI
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
pip install lore-kg
2. Initialize &amp;amp; Index Your Repository
Run the bootstrap helper inside your local project:

bash
lore init .
3. Audit Local Diffs or PR Commit Ranges
Run an architectural audit generating native SARIF 2.1.0 output for GitHub Code Scanning:

bash
lore gh-check --commit-range "origin/main...HEAD" --format sarif --fail-on critical
4. Connect to Cursor or Claude Desktop via MCP
LORE exposes a local Model Context Protocol (MCP) server so AI tools can query architectural rules before writing code:

bash
lore mcp
GitHub Action Integration
You can integrate LORE directly into your GitHub Actions workflow:

yaml
name: LORE Architectural Guard
on:
  pull_request:
    branches: [ main ]
jobs:
  lore-guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - run: pip install lore-kg
      - run: lore gh-check --commit-range "origin/main...HEAD" --format sarif --fail-on critical &amp;gt; lore-results.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: lore-results.sarif
Open Source &amp;amp; Community
LORE is 100% open-source under the MIT License.

GitHub Repository: https://github.com/filippogabriele19/lore
PyPI Package: https://pypi.org/project/lore-kg/
I'd love to hear your thoughts, feedback, or ideas on AST-level co-change mining and local codebase governance!

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

&lt;/div&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
