<?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: Paulo Costa</title>
    <description>The latest articles on DEV Community by Paulo Costa (@paulowdev).</description>
    <link>https://dev.to/paulowdev</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%2F1105911%2F9dccd0b7-ae4f-4783-b6af-a9aee833e13f.png</url>
      <title>DEV Community: Paulo Costa</title>
      <link>https://dev.to/paulowdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulowdev"/>
    <language>en</language>
    <item>
      <title>I built Brokspace: local-first code search and context for AI coding agents</title>
      <dc:creator>Paulo Costa</dc:creator>
      <pubDate>Tue, 24 Nov 2026 02:06:34 +0000</pubDate>
      <link>https://dev.to/paulowdev/i-built-brokspace-local-first-code-search-and-context-for-ai-coding-agents-4ffj</link>
      <guid>https://dev.to/paulowdev/i-built-brokspace-local-first-code-search-and-context-for-ai-coding-agents-4ffj</guid>
      <description>&lt;p&gt;I have a small confession: I'm much more comfortable building things than talking about the things I build. But after working on this project for a while, I figured it was time to leave my comfort zone and share it.&lt;/p&gt;

&lt;p&gt;Meet &lt;strong&gt;&lt;a href="https://brokspace.org" rel="noopener noreferrer"&gt;Brokspace&lt;/a&gt;&lt;/strong&gt; - a local-first tool that makes your development workspace searchable and ready for AI coding agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  It started with a problem I kept running into
&lt;/h2&gt;

&lt;p&gt;Around May 2026, I started building a small tool in Rust to help with my studies and day-to-day project work.&lt;/p&gt;

&lt;p&gt;As AI became a bigger part of my development workflow, I found myself spending more time managing the surrounding chaos: prompts, MCP servers, skills, agents, project context, and all the little pieces needed to help an AI assistant understand a codebase.&lt;/p&gt;

&lt;p&gt;And there was another problem: asking an LLM to understand a large repository often meant spending time collecting context, sending too much information, waiting for responses, and repeating the process in the next session.&lt;/p&gt;

&lt;p&gt;I wanted something that could understand my workspace locally, find the relevant pieces of code, and make that context available to the tools and agents I already use.&lt;/p&gt;

&lt;p&gt;So I started building it. With a little help from my friend &lt;em&gt;Claudinho&lt;/em&gt; (Claude Code), the original study helper gradually became something much bigger.&lt;/p&gt;

&lt;p&gt;I eventually decided to open source it. If it was helping me every day, maybe it could help another developer too.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what is Brokspace?
&lt;/h2&gt;

&lt;p&gt;Brokspace gives your workspace a local index that can be used by the terminal, the editor, your LLM, and coding agents.&lt;/p&gt;

&lt;p&gt;The goal is simple: &lt;strong&gt;let agents find and use relevant project context without having to ingest your entire codebase every time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today, the project includes a Rust-based CLI and runtime, a VS Code extension, an agent integration, an SDK for building extensions, and a shard template.&lt;/p&gt;

&lt;p&gt;Some of the things you can do with it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search code by meaning or keywords across repositories and linked workspaces.&lt;/li&gt;
&lt;li&gt;Ask questions about your code and get answers grounded in retrieved source references.&lt;/li&gt;
&lt;li&gt;Expose workspace search and memory to coding agents through MCP.&lt;/li&gt;
&lt;li&gt;Reuse engineering workflows through shareable &lt;code&gt;SKILL.md&lt;/code&gt; skills.&lt;/li&gt;
&lt;li&gt;Review local changes and generate commit messages from staged diffs.&lt;/li&gt;
&lt;li&gt;Extend the workspace with small event-driven programs called &lt;strong&gt;shards&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A little bit under the hood
&lt;/h2&gt;

&lt;p&gt;I wanted to make the project useful, but also interesting to build. A few implementation details:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Syntax-aware indexing
&lt;/h3&gt;

&lt;p&gt;Instead of splitting source code into arbitrary text windows, Brokspace uses Tree-sitter-based parsing to create chunks around code structures such as functions, classes, and other definitions. That helps keep useful pieces of code together when building the index.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Hybrid search
&lt;/h3&gt;

&lt;p&gt;Search combines two approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BM25&lt;/strong&gt;, for keyword-based retrieval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic search&lt;/strong&gt;, using embeddings generated locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rankings are fused so a result can be relevant by meaning even when it doesn't contain the exact words in the query, while still benefiting from precise keyword matches.&lt;/p&gt;

&lt;p&gt;The current implementation uses a local embedding model through ONNX Runtime and stores index data in LanceDB or memory-mapped Arrow files. The index lives inside the workspace's &lt;code&gt;.brokspace/&lt;/code&gt; directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. One local context layer for different tools
&lt;/h3&gt;

&lt;p&gt;The CLI, VS Code extension, and coding-agent integrations share the same workspace index. Brokspace exposes tools through MCP, so compatible agents can search the project and use workspace memory without each integration building its own separate index.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. An event bus and extensible shards
&lt;/h3&gt;

&lt;p&gt;The runtime includes a local event bus. The default &lt;code&gt;brok-agent&lt;/code&gt; shard tracks workspace changes and supports agent workflows such as grounded answers and reviews.&lt;/p&gt;

&lt;p&gt;Shards are small, separate programs that subscribe to declared workspace events and publish their own events. The &lt;code&gt;brok-sdk&lt;/code&gt; provides the protocol, manifest schema, and Rust client, while the wire protocol is documented for other implementations too.&lt;/p&gt;

&lt;p&gt;This is one of the parts I'm especially excited about: instead of hard-coding every possible integration into the core, developers can build small extensions that react to what happens in a workspace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local-first means being deliberate about data
&lt;/h2&gt;

&lt;p&gt;The index is created and stored on your machine. You can use a local model through Ollama or LM Studio, or choose a hosted OpenAI-compatible provider.&lt;/p&gt;

&lt;p&gt;One important distinction: when you choose a hosted model, the relevant context included in a request is sent to that provider so it can generate an answer. Brokspace does not need to upload your entire repository to build its index, and the agent scrubs common secrets from context before sending it to a model. I prefer being explicit about this rather than calling something “private” without explaining the trade-offs.&lt;/p&gt;

&lt;p&gt;A similar note applies to shards: their requested capabilities are declared and shown during installation, but filesystem and network restrictions are not yet enforced by an OS-level sandbox. As always, review what you install and trust the code you run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;On macOS or Linux, you can install the CLI and initialize a workspace with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://brokspace.org/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh

&lt;span class="nb"&gt;cd&lt;/span&gt; /path/to/your/project
brok init
brok search &lt;span class="s2"&gt;"where do we validate access tokens?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use the &lt;a href="https://github.com/brokspace/vscode" rel="noopener noreferrer"&gt;VS Code extension&lt;/a&gt; or explore the &lt;a href="https://brokspace.org/docs" rel="noopener noreferrer"&gt;getting started guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open source it now?
&lt;/h2&gt;

&lt;p&gt;The core CLI has passed &lt;strong&gt;300 downloads&lt;/strong&gt;, and I've already received some early contributions from the community. That encouragement gave me the push to share the project more broadly.&lt;/p&gt;

&lt;p&gt;Brokspace is still evolving. There are rough edges, things to improve, and probably a few bugs waiting for their moment to shine. That's part of why I'm opening it up: feedback from people using it in different workflows is incredibly valuable.&lt;/p&gt;

&lt;p&gt;The project is dual-licensed under &lt;strong&gt;MIT or Apache-2.0&lt;/strong&gt;. You can explore the code, open an issue, start a discussion, build a shard, or send a pull request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌐 Website: &lt;a href="https://brokspace.org" rel="noopener noreferrer"&gt;brokspace.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🦀 Core project: &lt;a href="https://github.com/brokspace/brok" rel="noopener noreferrer"&gt;github.com/brokspace/brok&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧩 VS Code extension: &lt;a href="https://github.com/brokspace/vscode" rel="noopener noreferrer"&gt;github.com/brokspace/vscode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💬 Discussions: &lt;a href="https://github.com/brokspace/brok/discussions" rel="noopener noreferrer"&gt;Brokspace on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that's Brokspace. The name is inspired by &lt;strong&gt;Brokkr&lt;/strong&gt;, the master blacksmith from Norse mythology, and the forge where he worked. I liked the idea of a tool that helps developers forge better workflows. Apparently, naming things is still one of the hardest problems in software engineering.&lt;/p&gt;

&lt;p&gt;Give it a try, tell me what breaks, suggest what should be better, contribute if something catches your eye , and constructive criticism is very welcome. And naturally, I'm always open to an invitation to grab a coffee.&lt;/p&gt;

&lt;p&gt;Thanks for reading! ☕&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>rust</category>
      <category>ai</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
