<?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 Kai Mori on Medium]]></title>
        <description><![CDATA[Stories by Kai Mori on Medium]]></description>
        <link>https://medium.com/@majestic.photographer?source=rss-5c86b61e58fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qyJtHdF45IaJ-bSZm1rePA.png</url>
            <title>Stories by Kai Mori on Medium</title>
            <link>https://medium.com/@majestic.photographer?source=rss-5c86b61e58fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:26:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@majestic.photographer/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[My First Local RAG Finally Works — And It Knows When Not to Answer]]></title>
            <link>https://medium.com/@majestic.photographer/my-first-local-rag-finally-works-and-it-knows-when-not-to-answer-cde68093b2d8?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/cde68093b2d8</guid>
            <category><![CDATA[ai-architecture]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[context-engineering]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 02:06:51 GMT</pubDate>
            <atom:updated>2026-12-03T02:09:41.200Z</atom:updated>
            <content:encoded><![CDATA[<p><em>After building embeddings, semantic search, persistence, and retrieval from scratch, I finally connected everything to a local LLM.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzqQQKr72_rnRKe4dwZZ-Q.png" /></figure><p>For the past several days, I have been building a small local Knowledge Assistant.</p><p>The goal has never been simply to make RAG work.</p><p>I wanted to understand every major responsibility inside it.</p><p>So instead of starting with a RAG framework, I built the pieces one by one.</p><p>First:</p><pre>Markdown<br>   ↓<br>Chunking<br>   ↓<br>Embeddings<br>   ↓<br>Cosine Similarity</pre><p>Then:</p><pre>Embeddings<br>   ↓<br>ChromaDB<br>   ↓<br>Persistent Vector Search</pre><p>Yesterday, I finally reached this point:</p><pre>Question<br>   ↓<br>Embedding<br>   ↓<br>ChromaDB<br>   ↓<br>Top 3 Relevant Chunks</pre><p>That was already exciting.</p><p>But technically, it was still retrieval.</p><p>There was no <strong>G</strong> in RAG yet.</p><p>Today, I added it.</p><p>And for the first time, the whole pipeline worked from end to end.</p><h3>The Goal Was Simple</h3><p>I wanted this:</p><pre>Question<br>   ↓<br>Retrieve Relevant Knowledge<br>   ↓<br>Build Context<br>   ↓<br>Send Context to Local LLM<br>   ↓<br>Generate an Answer</pre><p>Nothing fancy.</p><p>No agent yet.</p><p>No complex orchestration.</p><p>Just a real Retrieval-Augmented Generation loop running locally.</p><p>I divided the work into four small changes:</p><pre>1. Add context builder</pre><pre>2. Add local LLM generation</pre><pre>3. Add grounded answer prompt</pre><pre>4. Handle insufficient context</pre><p>That last one turned out to be more important than I initially thought.</p><h3>Step 1: Turn Retrieved Chunks Into Context</h3><p>My vector search already returned the three most relevant chunks as application objects.</p><p>Each chunk contained information like:</p><pre>file name<br>section<br>content<br>distance</pre><p>Instead of simply printing them, I combined them into a single reference context.</p><p>Conceptually:</p><pre>[Reference 1]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: Key Takeaway<br>Content: ...<br></pre><pre>[Reference 2]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: When<br>Content: ...<br></pre><pre>[Reference 3]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: What<br>Content: ...</pre><p>This is a small transformation.</p><p>But architecturally, something important happened.</p><p>The retrieval system thinks in chunks.</p><p>The LLM needs context.</p><p>So the application sits between them and translates one representation into another.</p><pre>Vector Search<br>     ↓<br>Chunks<br>     ↓<br>Context Builder<br>     ↓<br>LLM-readable Context</pre><p>That boundary had been invisible to me before I implemented it myself.</p><h3>Step 2: Send the Context to a Local LLM</h3><p>The next step was generation.</p><p>My local Ollama environment already supported chat, so I created a client responsible for communicating with Ollama.</p><p>At this point, I also reconsidered one of my earlier design decisions.</p><p>I originally had:</p><pre>embeddings.py<br>= Text → Vector</pre><pre>llm_client.py<br>= Prompt → Answer</pre><p>That separation made sense by capability.</p><p>But both functions currently call the same provider: Ollama.</p><p>So another valid boundary is:</p><pre>ollama_client.py<br>├── embed()<br>└── chat()</pre><p>This groups the code by external provider rather than AI capability.</p><p>For the current project, I actually prefer this.</p><p>Why?</p><p>Because today:</p><pre>Embedding → Ollama<br>Generation → Ollama</pre><p>If those responsibilities later move to different providers, I can split them then.</p><p>For example:</p><pre>Embedding → Azure OpenAI<br>Generation → Ollama</pre><p>At that point they would change for different reasons, and separation would become valuable.</p><p>For now, I would rather avoid abstraction before I have a real reason for it.</p><p>That has become another recurring rule in this project:</p><blockquote><strong><em>Separate responsibilities when the boundary is real, not merely because a future boundary is imaginable.</em></strong></blockquote><h3>Step 3: Ground the Answer</h3><p>Getting the LLM to answer was easy.</p><p>Getting it to answer <strong>from my retrieved notes</strong> was the important part.</p><p>The system prompt tells the model, conceptually:</p><pre>Use the provided reference context.</pre><pre>Do not rely on external knowledge.</pre><pre>Use the source metadata when answering.</pre><pre>If the references do not contain enough information,<br>say so.</pre><p>Then I tested a normal question:</p><pre>Please tell me about generative AI.</pre><p>The pipeline became:</p><pre>Question<br>   ↓<br>Query Embedding<br>   ↓<br>ChromaDB Vector Search<br>   ↓<br>Top 3 Chunks<br>   ↓<br>Reference Context<br>   ↓<br>Local LLM<br>   ↓<br>Grounded Answer</pre><p>And the answer looked like this:</p><blockquote><em>According to the reference, here’s what I can tell you about generative AI:</em></blockquote><p>It then explained the key takeaway, common use cases, and definition while identifying the source file and sections.</p><p>For example:</p><pre>File:<br>TN-AI-04 Generative AI Model Basics.md</pre><pre>Sections:<br>Key Takeaway<br>When<br>What</pre><p>That was the first moment I could honestly say:</p><p><strong>My local RAG was working.</strong></p><p>The system was no longer merely finding relevant text.</p><p>It was retrieving my knowledge and using that knowledge to generate an answer.</p><h3>But Then Came the More Interesting Test</h3><p>A RAG system should not only answer questions well.</p><p>It should also know when the available knowledge is insufficient.</p><p>So I asked something completely unrelated to my Technical Notes:</p><pre>What is the best recipe for Neapolitan pizza?</pre><p>This is where things could have gone wrong.</p><p>The local LLM almost certainly knows something about pizza from its pretrained knowledge.</p><p>So even if the retrieved Technical Notes contained nothing useful, the model could simply answer from memory.</p><p>That would technically produce a useful answer.</p><p>But it would violate the contract of this Knowledge Assistant.</p><p>The goal is not:</p><pre>Answer whatever you know.</pre><p>The goal is:</p><pre>Answer from my knowledge base.</pre><p>The result was:</p><pre>I do not have enough information in the provided references<br>to answer that question.</pre><p>Honestly, that result was more satisfying than the successful Generative AI answer.</p><h3>Knowing When Not to Answer Is Part of the System</h3><p>Initially, I thought of insufficient-context handling as error handling.</p><p>Something like:</p><pre>Retrieval failed<br>      ↓<br>Handle the failure</pre><p>I no longer think that is the right mental model.</p><p>The search did not fail.</p><p>ChromaDB still returned three chunks.</p><p>The embedding worked.</p><p>The vector search worked.</p><p>The LLM worked.</p><p>Technically, every component succeeded.</p><p>The real issue was:</p><blockquote><strong><em>The retrieved information was not sufficient to support a reliable answer.</em></strong></blockquote><p>That is not an infrastructure failure.</p><p>It is an epistemic boundary.</p><p>The system needs to distinguish between:</p><pre>&quot;I found some text.&quot;</pre><p>and:</p><pre>&quot;I found enough relevant evidence to answer.&quot;</pre><p>That distinction feels much more important now that I have seen it in a working system.</p><h3>The Pizza Test Does Not Prove Hallucination Is Solved</h3><p>There is an important caveat.</p><p>One successful negative test does <strong>not</strong> mean I solved hallucination.</p><p>The pizza question was deliberately easy.</p><p>My Technical Notes clearly do not contain pizza recipes.</p><p>A harder test would look like this:</p><pre>The knowledge base contains<br>some related information</pre><pre>        ↓</pre><pre>but not enough information<br>to answer the exact question</pre><p>That gray zone is much more interesting.</p><p>Later, I want to test:</p><ul><li>questions with complete evidence</li><li>questions with no relevant evidence</li><li>questions with partially relevant evidence</li><li>conflicting chunks</li><li>low-quality retrieval</li><li>different Top-k values</li></ul><p>That will become part of retrieval and grounding evaluation.</p><p>For today, the pizza test simply showed that the system can follow the intended boundary in at least one clear negative case.</p><p>And that is enough for this stage.</p><h3>The Architecture Is Surprisingly Simple Now</h3><p>After several days of building and debugging, I can finally describe the system like this:</p><pre>Ollama<br>= Meaning → Vector<br>  and<br>  Context + Question → Answer</pre><pre><br>ChromaDB<br>= Persist Vectors<br>  +<br>  Search Vectors<br></pre><pre>Indexing Pipeline<br>= Knowledge → Vector Database<br></pre><pre>Knowledge Assistant<br>= Question<br>  → Retrieval<br>  → Context<br>  → Answer</pre><p>The complete runtime flow is now:</p><pre>Technical Notes<br>      ↓<br>Chunking<br>      ↓<br>Document Embeddings<br>      ↓<br>ChromaDB<br>      ↑<br>Query Embedding<br>      ↑<br>Question</pre><pre>ChromaDB<br>      ↓<br>Top-k Chunks<br>      ↓<br>Context Builder<br>      ↓<br>Grounded Prompt<br>      ↓<br>Local LLM<br>      ↓<br>Answer</pre><p>A few days ago, every box in a typical RAG architecture diagram felt like another technology I needed to learn.</p><p>Now most of them feel like responsibilities.</p><p>That is a very different feeling.</p><h3>The Code Got More Complex, but the Mental Model Got Simpler</h3><p>This has probably been the biggest lesson of the project so far.</p><p>My codebase is objectively more complicated now.</p><p>I have:</p><pre>config.py<br>models.py<br>ollama_client.py<br>index_notes.py<br>knowledge_assistant.py<br>ChromaDB<br>Ollama<br>Git</pre><p>But my understanding is simpler.</p><p>I can explain why each piece exists.</p><p>I can explain which component owns which responsibility.</p><p>And, increasingly, when something breaks, I know where to look.</p><p>That feels more important than memorizing any particular framework.</p><h3>From “I Know What RAG Is” to “I Built One”</h3><p>There is a difference between understanding this diagram:</p><pre>Retrieve<br>   ↓<br>Augment<br>   ↓<br>Generate</pre><p>and experiencing each boundary yourself.</p><p>I now know what it feels like when:</p><ul><li>chunking loses semantic structure</li><li>embeddings come from incompatible vector spaces</li><li>vectors disappear because they only exist in memory</li><li>persistence moves into a vector database</li><li>query results have a different shape than database objects</li><li>retrieved chunks need to become context</li><li>an LLM needs explicit grounding instructions</li><li>the system has to decide not to answer</li></ul><p>None of these ideas is individually complicated.</p><p>But connecting them changed my understanding of RAG.</p><p>RAG is no longer one thing to me.</p><p>It is a set of responsibilities connected together.</p><h3>This Is Why I Wanted to Build It Slowly</h3><p>I could have started with a higher-level framework.</p><p>I probably would have had a working demo much sooner.</p><p>But I would have missed many of the questions that taught me the most.</p><p>The process has repeatedly followed the same pattern:</p><pre>Build<br>  ↓<br>Break something<br>  ↓<br>Investigate<br>  ↓<br>Find the boundary<br>  ↓<br>Understand the responsibility<br>  ↓<br>Use the abstraction</pre><p>Yesterday I wrote:</p><blockquote><strong><em>Understand the responsibility first. Then use the abstraction.</em></strong></blockquote><p>Today I would add one more line:</p><blockquote><strong><em>And sometimes the bug is what reveals the responsibility.</em></strong></blockquote><h3>What’s Next?</h3><p>Technically, the first local RAG pipeline now works.</p><p>So the next question is no longer:</p><blockquote><em>Can I build RAG?</em></blockquote><p>It becomes:</p><blockquote><strong><em>How good is my RAG?</em></strong></blockquote><p>That means looking at things such as:</p><pre>Chunking strategy</pre><pre>Top-k</pre><pre>L2 vs cosine distance</pre><pre>Context quality</pre><pre>Insufficient-context detection</pre><pre>Retrieval evaluation</pre><pre>Source citation</pre><pre>Incremental indexing</pre><p>And eventually:</p><pre>Knowledge Graph<br>        ↓<br>Agentic Retrieval<br>        ↓<br>Personal Knowledge Agent</pre><p>That part still feels far away.</p><p>But then again, a few days ago even this felt far away.</p><p>Today:</p><pre>Question<br>   ↓<br>My Knowledge<br>   ↓<br>My Local LLM<br>   ↓<br>Grounded Answer</pre><p>actually works.</p><p>And when I ask for pizza?</p><p>It politely tells me it doesn’t know.</p><p>I’ll take that as a win. 🍕</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cde68093b2d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Local RAG Finally Learned to Remember — Then Two Bugs Taught Me How Vector Search Really Works]]></title>
            <link>https://medium.com/@majestic.photographer/my-local-rag-finally-learned-to-remember-then-two-bugs-taught-me-how-vector-search-really-works-dee23aef7392?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/dee23aef7392</guid>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[chromadb]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[embedding]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Wed, 02 Dec 2026 08:52:48 GMT</pubDate>
            <atom:updated>2026-12-02T08:52:48.476Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How ChromaDB persistence, a 768-vs-384 dimension mismatch, and one innocent Python dictionary helped me understand the boundaries inside a RAG system.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-wLLQx6J1VllrnVh_MCIA.png" /></figure><p>For the last few days, I have been building a small local Knowledge Assistant from scratch.</p><p>My goal is not to build the fastest RAG application possible.</p><p>It is to understand what each part of the system is actually responsible for.</p><p>So far, I had already built the retrieval logic myself:</p><pre>Markdown<br>   ↓<br>Document<br>   ↓<br>Chunk<br>   ↓<br>Embedding<br>   ↓<br>Cosine Similarity<br>   ↓<br>Top-k Results</pre><p>It worked.</p><p>But every vector lived in Python memory.</p><p>When the process stopped, everything disappeared.</p><p>Today I finally moved that responsibility into ChromaDB.</p><p>And, naturally, that is when things started breaking.</p><p>Which turned out to be the useful part.</p><h3>First, I Split the Project Into Responsibilities</h3><p>Before adding persistence, I refactored the project from one Python file into several small modules.</p><pre>knowledge-assistant/<br>│<br>├── config.py<br>├── models.py<br>├── embeddings.py<br>├── index_notes.py<br>└── knowledge_assistant.py</pre><p>The idea was simple.</p><pre>models.py<br>    → What is a Document or Chunk?</pre><pre>embeddings.py<br>    → How does text become a vector?</pre><pre>index_notes.py<br>    → How is the knowledge base built and updated?</pre><pre>knowledge_assistant.py<br>    → How is the knowledge base queried and used?</pre><p>I also created config.py for things such as model names, host addresses, collection names, and retrieval limits.</p><p>This was not part of my original plan.</p><p>But once the program had multiple external components, configuration had become a separate responsibility too.</p><p>The most important separation was this:</p><pre>Knowledge Base Creation<br>        ≠<br>Knowledge Base Usage</pre><p>index_notes.py became the write side:</p><pre>Markdown<br>   ↓<br>Document<br>   ↓<br>Chunk<br>   ↓<br>Embedding<br>   ↓<br>ChromaDB</pre><p>And knowledge_assistant.py became the read side:</p><pre>Question<br>   ↓<br>Embedding<br>   ↓<br>ChromaDB<br>   ↓<br>Top-k Chunks</pre><p>That difference sounds obvious now.</p><p>It was much less obvious when everything lived inside one script.</p><h3>The Knowledge Base Finally Became Persistent</h3><p>I am running ChromaDB as a local server and connecting to it from Python over HTTP.</p><p>Conceptually:</p><pre>Python Application<br>        ↓ HTTP<br>ChromaDB Server<br>        ↓<br>Persistent Storage</pre><p>I mapped each Chunk into ChromaDB like this:</p><pre>Chunk.content      → document<br>Chunk.embedding    → embedding<br>Chunk.note_id      → metadata<br>Chunk.file_name    → metadata<br>Chunk.section      → metadata<br>Chunk.chunk_index  → metadata</pre><p>For an ID, I used a deterministic form such as:</p><pre>TN-AI-05::0</pre><p>That should make later update and upsert logic easier because the same logical chunk can be identified again.</p><p>After indexing my Technical Notes, ChromaDB contained:</p><pre>51 chunks</pre><p>And the important part was that they stayed there after the Python process ended.</p><p>For the first time, my Knowledge Assistant had memory that did not disappear with the application process.</p><p>Then I tried to query it.</p><h3>Bug #1: 768 Dimensions vs 384 Dimensions</h3><p>The first error looked like this:</p><pre>Collection expecting embedding with dimension of 768, got 384</pre><p>This was interesting because I knew my embedding model was producing 768-dimensional vectors.</p><p>So I checked the application side.</p><pre>Query embedding: 768 dimensions</pre><p>Then I inspected an embedding already stored in ChromaDB.</p><pre>Stored embedding: 768 dimensions</pre><p>So the collection data itself was fine.</p><p>But the collection configuration also had a default embedding function associated with it.</p><p>That revealed the real architecture problem.</p><p>There were potentially <strong>two different components capable of turning text into vectors</strong>.</p><pre>Ollama<br>    → my chosen embedding model<br>    → 768 dimensions</pre><pre>ChromaDB default embedding behavior<br>    → another embedding space</pre><p>That is dangerous.</p><p>Even if both systems call their output an “embedding,” the vectors are not interchangeable.</p><p>An embedding belongs to a vector space created by a particular model.</p><pre>Embedding Model<br>      ↓<br>Vector Space<br>      ↓<br>Vector Dimension<br>      ↓<br>Similarity Search</pre><p>Documents and queries must live in the same space.</p><p>So I made the responsibility explicit:</p><pre>Ollama<br>= text → vector</pre><pre>ChromaDB<br>= store vector + search vector</pre><p>Instead of asking ChromaDB to embed the query text, I generate the query vector myself:</p><pre>query_embedding = generate_embeddings(<br>    my_query,<br>    prefix=&quot;search_query&quot;,<br>)</pre><p>Then I send the vector directly to ChromaDB:</p><pre>results = collection.query(<br>    query_embeddings=[query_embedding],<br>    n_results=3,<br>    include=[<br>        &quot;documents&quot;,<br>        &quot;metadatas&quot;,<br>        &quot;embeddings&quot;,<br>        &quot;distances&quot;,<br>    ],<br>)</pre><p>Now both sides use the same model:</p><pre>Document<br>   ↓<br>Ollama<br>   ↓<br>768 dimensions<br>   ↓<br>ChromaDB</pre><pre>Query<br>   ↓<br>Ollama<br>   ↓<br>768 dimensions<br>   ↓<br>ChromaDB</pre><p>The dimension error disappeared.</p><p>More importantly, I understood <em>why</em> it disappeared.</p><h3>Bug #2: A Collection Is Not Its Query Result</h3><p>Then I hit another error:</p><pre>TypeError: dict.get() takes no keyword arguments</pre><p>At first glance, that looked unrelated.</p><p>The problem was actually simple.</p><p>I had this:</p><pre>results = collection.query(...)</pre><p>Then I passed results into a function written to accept a ChromaDB collection object.</p><p>The function tried to do this:</p><pre>collection.get(<br>    include=[...]<br>)</pre><p>But results was not a collection anymore.</p><p>It was already returned data.</p><p>In other words:</p><pre>collection<br>= an object used to send commands to the database</pre><pre>results<br>= data returned by the database</pre><p>Same workflow.</p><p>Completely different responsibilities.</p><p>Once again, the bug was really a boundary problem.</p><h3>ChromaDB Query Results Have Another Interesting Shape</h3><p>There was one more detail.</p><p>A query result is nested because ChromaDB can process multiple query embeddings at once.</p><p>Conceptually:</p><pre>results[&quot;documents&quot;]<br>│<br>└── Query 0<br>    ├── Result 0<br>    ├── Result 1<br>    └── Result 2</pre><p>Since I currently send one query and request three matches, I access values like this:</p><pre>results[&quot;documents&quot;][0][i]<br>results[&quot;metadatas&quot;][0][i]<br>results[&quot;embeddings&quot;][0][i]<br>results[&quot;distances&quot;][0][i]</pre><p>I then reconstruct my application’s own Chunk objects from that database response.</p><pre>ChromaDB Result<br>      ↓<br>Nested Python Data<br>      ↓<br>Chunk Objects</pre><p>That round trip felt surprisingly satisfying.</p><p>My chunks started as application objects, became persistent database records, survived process restarts, came back through vector search, and were reconstructed as application objects again.</p><h3>And Then It Worked</h3><p>I tried this question:</p><pre>Please tell me about generative AI.</pre><p>The application reported:</p><pre>count of chunks in the collection: 51<br>len(query_embedding): 768<br>count of results: 3</pre><p>And the top three results were:</p><pre>1. Generative AI Model Basics / Key Takeaway<br>2. Generative AI Model Basics / When<br>3. Generative AI Model Basics / What</pre><p>The first result had this content:</p><pre>生成AIは、自然言語によって新しいコンテンツを生成できる。<br>ただし、出力は確率的であり、重要な用途では人間による検証を必要とする。</pre><p>The next two results covered typical use cases and the basic definition of generative AI.</p><p>That was the moment the database stopped feeling like storage infrastructure.</p><p>It was actually retrieving my own knowledge semantically.</p><h3>The Difference From My Previous Version Is Small in Code and Huge in Architecture</h3><p>Previously:</p><pre>Python<br>├── kept all vectors in memory<br>├── looped over every chunk<br>├── calculated cosine similarity<br>├── sorted the results<br>└── returned the top three</pre><p>Now:</p><pre>Python<br>├── creates embeddings<br>└── asks ChromaDB for relevant vectors</pre><pre>ChromaDB<br>├── persists vectors<br>├── persists documents<br>├── persists metadata<br>└── performs vector search</pre><p>The code is becoming simpler because a specialized component is taking over work I previously implemented myself.</p><p>But because I implemented that work first, the abstraction no longer feels magical.</p><p>I know what I delegated.</p><p>That continues to be one of the most useful patterns in this project:</p><blockquote><strong><em>Understand the responsibility first. Then use the abstraction.</em></strong></blockquote><h3>One More Thing: Distance Is Not the Same as My Old Similarity Score</h3><p>My current ChromaDB collection uses an L2 distance configuration.</p><p>The top results looked roughly like:</p><pre>1.0479<br>1.1035<br>1.1055</pre><p>Earlier, in my in-memory implementation, I was calculating cosine similarity myself.</p><p>Those values should not be compared directly.</p><p>For now, I am evaluating retrieval more practically:</p><pre>Is the result relevant?</pre><pre>Did I retrieve enough information?</pre><pre>Did unrelated chunks get mixed in?</pre><p>Later I want to compare:</p><pre>L2 vs cosine</pre><pre>Top 1 vs Top 3 vs Top 5</pre><pre>Different chunking strategies</pre><p>That will become a retrieval-quality experiment rather than just a coding exercise.</p><h3>The Architecture Is Finally Becoming Clear</h3><p>At this point, I can describe the responsibilities fairly simply.</p><pre>Ollama<br>= Meaning → Vector</pre><pre>ChromaDB<br>= Persist Vector + Search Vector</pre><pre>Knowledge Assistant<br>= Query → Retrieve → Interpret</pre><p>Soon another responsibility will appear:</p><pre>Local LLM<br>= Context + Question → Answer</pre><p>And that will finally complete the first real RAG pipeline.</p><h3>The Bugs Were Part of the Lesson</h3><p>Neither bug was especially complicated after I understood it.</p><p>But both exposed something important.</p><p>The first bug was not really about the number 384.</p><p>It was about:</p><blockquote><strong><em>Who owns the embedding responsibility?</em></strong></blockquote><p>The second bug was not really about Python’s dict.get().</p><p>It was about:</p><blockquote><strong><em>What is a database object, and what is data returned from that object?</em></strong></blockquote><p>Those are architecture questions hiding inside ordinary error messages.</p><p>That is probably my favorite part of building this project from the bottom up.</p><p>A clean tutorial could have shown me the correct API calls immediately.</p><p>I might have finished faster.</p><p>But I would have missed the reason those calls are correct.</p><h3>What’s Next</h3><p>I now have three relevant chunks.</p><p>The next step is to turn them into context.</p><p>Something like:</p><pre>[Source 1]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: Key Takeaway</pre><pre>Content:<br>...<br></pre><pre>[Source 2]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: When</pre><pre>Content:<br>...<br></pre><pre>[Source 3]</pre><pre>File: TN-AI-04 Generative AI Model Basics.md<br>Section: What</pre><pre>Content:<br>...</pre><p>Then I will send that context together with the original question to a local LLM.</p><p>The pipeline will finally become:</p><pre>Question<br>   ↓<br>Embedding<br>   ↓<br>Vector Search<br>   ↓<br>Relevant Knowledge<br>   ↓<br>Context<br>   ↓<br>Local LLM<br>   ↓<br>Answer</pre><p>A few days ago, “RAG” was still mostly a diagram in my head.</p><p>Now I can point to every arrow and explain what is happening there.</p><p>And honestly, the two bugs today probably taught me more than a clean implementation would have.</p><p><strong>The retrieval part is good to go.</strong></p><p>Now it is finally time for the <strong>G</strong> in RAG.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dee23aef7392" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Local RAG Project Needed a Vector Database.]]></title>
            <link>https://medium.com/@majestic.photographer/my-local-rag-project-needed-a-vector-database-f5f683689d8a?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5f683689d8a</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[python-virtualenv]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[git-and-github]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 05:08:34 GMT</pubDate>
            <atom:updated>2026-12-01T05:08:34.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Local RAG Project Needed a Vector Database. Instead, I Ended Up Rebuilding My Development Environment.</h3><p><em>How adding ChromaDB led me through Python virtual environments, WSL2, Git, SSH, and GitHub, and why that detour was actually part of the project.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SbSdW4rjt5p-FPcNWFFczA.png" /></figure><p>Yesterday, my local RAG project was still pleasantly small.</p><p>I had a Python script that could:</p><ol><li>Load Markdown notes</li><li>Split them into chunks</li><li>Generate embeddings</li><li>Compare vectors with cosine similarity</li><li>Return the most relevant chunks</li></ol><p>Conceptually, it looked like this:</p><pre>Markdown<br>   ↓<br>Document<br>   ↓<br>Chunk<br>   ↓<br>Embedding<br>   ↓<br>Cosine Similarity<br>   ↓<br>Top-k Results</pre><p>Everything was still stored in memory.</p><p>That was intentional.</p><p>I wanted to understand retrieval before hiding it behind another abstraction.</p><p>But the next limitation was obvious: every time the Python process stopped, all of the chunks and embeddings disappeared.</p><p>So the next step seemed simple:</p><blockquote><em>Install a vector database.</em></blockquote><p>I chose ChromaDB for the first experiment.</p><p>I expected this to be a five-minute setup task.</p><p>It was not.</p><p>And honestly, I am glad it wasn’t.</p><h3>The First Command Failed Immediately</h3><p>I started with the obvious command:</p><pre>python3 -m pip install chromadb</pre><p>Ubuntu replied:</p><pre>/usr/bin/python3: No module named pip</pre><p>Well.</p><p>That was quick.</p><p>My WSL2 Ubuntu environment had Python, but the Python installation did not have pip available yet.</p><p>So before installing ChromaDB, I installed the Python package-management and virtual-environment tooling:</p><pre>sudo apt update<br>sudo apt install python3-pip python3-venv</pre><p>Then I verified it:</p><pre>python3 -m pip --version</pre><p>My environment reported:</p><pre>pip 25.1.1 from /usr/lib/python3/dist-packages/pip (python 3.14)</pre><p>Problem solved.</p><p>But this created a more interesting question:</p><p><strong>Should I install ChromaDB directly into the Ubuntu system Python?</strong></p><p>The answer was no.</p><h3>The Project Needed Its Own Python Environment</h3><p>Until this point, my project was basically a Python script.</p><p>Now it was about to gain an external dependency.</p><p>That meant it was time to stop treating the system Python installation as if it belonged to my application.</p><p>I created a virtual environment:</p><pre>python3 -m venv .venv</pre><p>Then activated it:</p><pre>source .venv/bin/activate</pre><p>The shell prompt changed:</p><pre>(.venv) user@machine:~/python-practice$</pre><p>I checked which Python and pip were now active:</p><pre>which python<br>which pip</pre><p>Both pointed inside the project-specific environment:</p><pre>.../.venv/bin/python<br>.../.venv/bin/pip</pre><p>That distinction suddenly felt important.</p><p>Before:</p><pre>Ubuntu<br>└── System Python</pre><p>Now:</p><pre>Ubuntu<br>├── System Python<br>│<br>└── My Project<br>    └── .venv<br>        ├── Python<br>        ├── pip<br>        └── Project Dependencies</pre><p>The code had not changed at all.</p><p>But the project architecture had.</p><h3>Then ChromaDB Installed Cleanly</h3><p>Inside the virtual environment, I installed ChromaDB:</p><pre>python -m pip install chromadb</pre><p>Then verified the installation:</p><pre>python -c &quot;import chromadb; print(chromadb.__version__)&quot;</pre><p>The result:</p><pre>1.5.9</pre><p>ChromaDB was ready.</p><p>At this point I could have gone straight back to RAG.</p><p>But something else had become obvious.</p><p>My project now had:</p><ul><li>source code</li><li>a virtual environment</li><li>external dependencies</li><li>local knowledge data</li><li>soon, persistent vector data</li></ul><p>This was no longer just a throwaway Python experiment.</p><p>It was becoming software.</p><p>And software needs version control.</p><h3>So I Finally Moved the Project Into Git</h3><p>I had been working under a generic directory called:</p><pre>~/python-practice</pre><p>That was fine while I was experimenting.</p><p>But I did not want unrelated Python experiments mixed into the same repository later.</p><p>So I created a dedicated project directory:</p><pre>~/knowledge-assistant</pre><p>I moved the relevant source code there and rebuilt the virtual environment for that project.</p><p>Then I added a .gitignore.</p><p>This turned out to be more important than simply running git init.</p><p>There were several things I absolutely did <strong>not</strong> want in GitHub:</p><pre>.venv/<br>__pycache__/<br>*.pyc<br>.env<br>chroma_db/<br>markdown_files/</pre><p>Each exclusion has a different reason.</p><h3>.venv/</h3><p>A virtual environment is generated runtime state.</p><p>I want to reproduce it from dependency definitions, not commit thousands of environment files.</p><h3>chroma_db/</h3><p>The local vector database will be generated from source knowledge. It is runtime data, not source code.</p><h3>markdown_files/</h3><p>This one matters even more.</p><p>My knowledge base contains my own Technical Notes. Those notes are data, and some may contain private or work-related information.</p><p>So I decided on a simple boundary:</p><pre>Software → Git<br>Private Knowledge → Local<br>Runtime State → Local<br>Secrets → Never Git</pre><p>That boundary may evolve later, but it is a much safer default than uploading everything because it happens to live inside the project directory.</p><h3>Reproducibility Changed the Way I Thought About Dependencies</h3><p>If .venv/ is intentionally excluded from Git, someone cloning the repository needs another way to rebuild it.</p><p>For now, my direct dependency is simple:</p><pre>chromadb==1.5.9</pre><p>So I can keep that in requirements.txt.</p><p>A clean machine can then do this:</p><pre>python3 -m venv .venv<br>source .venv/bin/activate<br>python -m pip install -r requirements.txt</pre><p>This is a small thing, but it changes the meaning of the repository.</p><p>The repository no longer says:</p><blockquote><em>Here are the files from my laptop.</em></blockquote><p>It says:</p><blockquote><em>Here is enough information to reconstruct the software environment.</em></blockquote><p>That feels like a much healthier boundary.</p><h3>GitHub Authentication Was Another Small Black Box Worth Opening</h3><p>For GitHub authentication from WSL2, I decided to use SSH.</p><p>I generated an Ed25519 key:</p><pre>ssh-keygen -t ed25519 -C &quot;my-github-noreply-address&quot;</pre><p>A useful detail I learned along the way: the value after -C is effectively a comment attached to the key. It is not the thing that authenticates me.</p><p>Authentication comes from the key pair itself:</p><pre>Private Key<br>     ↕<br>Public Key registered in GitHub</pre><p>That distinction sounds obvious after learning it.</p><p>Before learning it, the command just looks like it somehow authenticates an email address.</p><p>This is exactly the kind of small black box I am trying to eliminate in this project.</p><h3>The First SSH Connection Asked a Good Question</h3><p>After registering the public key with GitHub, I ran:</p><pre>ssh -T git@github.com</pre><p>SSH responded by asking whether I trusted the host.</p><p>It displayed an ED25519 fingerprint and asked:</p><pre>Are you sure you want to continue connecting (yes/no/[fingerprint])?</pre><p>This is one of those prompts people are trained to answer with yes without thinking.</p><p>But the prompt is actually asking something important:</p><blockquote><em>Is the server you are connecting to really the server you think it is?</em></blockquote><p>I compared the fingerprint with GitHub’s published fingerprint.</p><p>It matched.</p><p>Then I accepted it.</p><p>That host key was added to known_hosts, and SSH authentication worked.</p><p>Again, a tiny setup detail became another useful mental model.</p><h3>Finally: The First Push</h3><p>After initializing the repository, creating the first commit, and adding the GitHub remote, I pushed the project:</p><pre>git push -u origin main</pre><p>The important part of the output was:</p><pre>[new branch] main -&gt; main<br>branch &#39;main&#39; set up to track &#39;origin/main&#39;</pre><p>And that was it.</p><p>My little local Knowledge Assistant was finally under version control.</p><p>Conceptually, the environment had become:</p><pre>Windows<br>└── VS Code UI<br>       ↓<br>    WSL integration<br>       ↓<br>WSL2 Ubuntu<br>└── knowledge-assistant/<br>    ├── Source Code<br>    ├── .venv/<br>    ├── ChromaDB<br>    ├── Private Knowledge<br>    └── Local Git Repository<br>             ↓ SSH<br>           GitHub</pre><h3>Editing From Windows Without Moving the Project Back to Windows</h3><p>There was one more useful detail.</p><p>My files physically live in the Linux filesystem inside WSL2.</p><p>I <em>can</em> browse those files from Windows Explorer.</p><p>But for development, I prefer opening the project from WSL:</p><pre>cd ~/knowledge-assistant<br>code .</pre><p>With VS Code’s WSL integration, the UI still feels like normal Windows VS Code, while Python, Git, the terminal, extensions, and project paths operate in the Linux environment.</p><p>That gives me a clean separation:</p><pre>Windows → Development UI<br>WSL2   → Development Environment</pre><p>It is one of those arrangements that feels slightly strange for five minutes and then suddenly feels completely natural.</p><h3>This Was Supposed to Be a Vector Database Task</h3><p>The funny part is that I still have not written the ChromaDB persistence code yet.</p><p>I started the morning thinking:</p><blockquote><em>Today I will add a vector database.</em></blockquote><p>Instead, I ended up learning about:</p><ul><li>pip</li><li>Python virtual environments</li><li>dependency isolation</li><li>.gitignore</li><li>reproducible environments</li><li>Git repositories</li><li>SSH keys</li><li>server fingerprints</li><li>GitHub remotes</li><li>VS Code with WSL2</li></ul><p>At first glance, that looks like a detour.</p><p>I do not think it was.</p><p>My local RAG project is reaching the point where AI concepts alone are no longer enough.</p><p>It needs software engineering around them.</p><p>And that is actually one of the reasons I started this project.</p><h3>Software × Data × AI Is Becoming Less Theoretical</h3><p>I have been thinking about the intersection of three areas:</p><pre>Software × Data × AI</pre><p>This project is slowly making that intersection concrete.</p><h3>AI</h3><pre>LLM<br>Embedding<br>Semantic Search<br>RAG</pre><h3>Data</h3><pre>Markdown<br>Documents<br>Chunks<br>Vectors<br>Vector Database</pre><h3>Software</h3><pre>Python<br>Virtual Environments<br>Dependency Management<br>Git<br>SSH<br>GitHub<br>Later: Docker</pre><p>None of those areas feels isolated anymore.</p><p>A local RAG system needs all three.</p><p>That might be one of the most useful things I am learning from building it myself.</p><h3>A Small English Lesson From Git</h3><p>There was also a completely unrelated side lesson.</p><p>After the Git setup worked, I learned a phrase I liked:</p><blockquote><strong><em>Git’s good to go.</em></strong></blockquote><p>It simply means Git is ready and there is nothing blocking the next step.</p><p>And now that the project is under version control, another sentence feels appropriate:</p><blockquote><strong><em>Worst case, I break something and roll it back. That’s what Git’s for.</em></strong></blockquote><p>As someone who likes understanding every moving part before trusting it, that is a surprisingly comforting sentence.</p><h3>What’s Next</h3><p>Now the environment really is good to go.</p><p>The next experiment is finally the thing I intended to do this morning:</p><p><strong>Create a persistent ChromaDB client and store my chunks, embeddings, and metadata.</strong></p><p>The goal is simple:</p><pre>Python process stops<br>        ↓<br>Vectors remain<br>        ↓<br>Python starts again<br>        ↓<br>Search existing knowledge</pre><p>Once that works, I can replace this:</p><pre>Python keeps every vector in memory<br>Python calculates similarity itself</pre><p>with this:</p><pre>ChromaDB persists vectors<br>ChromaDB performs vector search</pre><p>And because I already built the in-memory version first, I will know exactly what responsibility I am delegating.</p><p>That is becoming the pattern of this entire project:</p><blockquote><strong><em>Understand the responsibility first. Then use the abstraction.</em></strong></blockquote><p>Now, finally:</p><p><strong>Git’s good to go. Chroma’s installed. Back to the fun stuff.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5f683689d8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built the Retrieval Part of RAG From Scratch. Then It Started Looking Like Software Again.]]></title>
            <link>https://medium.com/@majestic.photographer/i-built-the-retrieval-part-of-rag-from-scratch-then-it-started-looking-like-software-again-af651d1a9529?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/af651d1a9529</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[chunking]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 07:18:26 GMT</pubDate>
            <atom:updated>2026-11-30T07:18:26.750Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A small experiment with Markdown, embeddings, Python dataclasses, and semantic search taught me something unexpected about RAG.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SErt4eVQpy-8rA_YmvuEg.png" /></figure><p>For the last few days, I have been building a small local Knowledge Assistant.</p><p>Nothing fancy.</p><p>No LangChain.<br>No managed vector database.<br>No cloud AI service.</p><p>Just Python, Markdown files, Ollama, and a laptop.</p><p>My goal is not simply to build a RAG application. I want to understand what is actually happening inside one. And today, something interesting happened. The code stopped feeling like an AI experiment.</p><p>It started feeling like software again.</p><h3>Where I Started</h3><p>My previous experiment was simple.</p><p>I had several Markdown Technical Notes. I split them into pieces, generated embeddings, and compared those embeddings with a user’s question using cosine similarity.</p><p>Conceptually:</p><pre>Markdown<br>    ↓<br>Chunks<br>    ↓<br>Embeddings<br>    ↓<br>Cosine Similarity<br>    ↓<br>Top 3 Results</pre><p>And it worked.</p><p>I could ask a question such as:</p><blockquote><em>What is the purpose of embeddings?</em></blockquote><p>and retrieve chunks that were semantically related to the question. That was already a great learning experience. For the first time, terms like <em>embedding</em>, <em>vectorization</em>, and <em>semantic search</em> were no longer abstract concepts. I had actually seen them work. But the program itself was still basically an experiment.</p><p>Strings went in.</p><p>Dictionaries moved around.</p><p>Vectors appeared.</p><p>Similarity scores came out.</p><p>It worked, but the data itself did not really have a shape. That started bothering the software engineer in me.</p><h3>A Chunk Is Not Just a String</h3><p>Initially, I thought of a chunk as simply a piece of text.</p><p>Something like:</p><pre>&quot;This is a paragraph about embeddings...&quot;</pre><p>But once I started thinking about the next stages of RAG, that definition became inadequate.</p><p>A chunk has an identity.</p><p>It came from somewhere.</p><p>It belongs to a document.</p><p>It exists under a particular section.</p><p>It has an embedding.</p><p>And eventually, I may need to cite it as evidence for an answer. So I introduced explicit data models.</p><p>Conceptually, a document became:</p><pre>@dataclass<br>class Document:<br>    note_id: str<br>    file_name: str<br>    content: str</pre><p>and a chunk became:</p><pre>@dataclass<br>class Chunk:<br>    note_id: str<br>    file_name: str<br>    section: str<br>    chunk_index: int<br>    content: str<br>    embedding: list[float] | None = None</pre><p>This was a tiny change. But mentally, it changed the project quite a lot. The pipeline was no longer moving arbitrary strings and dictionaries around.</p><p>It was moving meaningful objects.</p><pre>Markdown File<br>      ↓<br>   Document<br>      ↓<br>    Chunk<br>      ↓<br>  Embedding<br>      ↓<br> Retrieval</pre><p>And suddenly the architecture became much easier to reason about.</p><h3>Chunking Is Actually an Information Design Problem</h3><p>The next question was:</p><p><strong>How should I split the Markdown files?</strong></p><p>The obvious solution is fixed-size chunking.</p><p>For example:</p><pre>500 characters<br>500 characters<br>500 characters<br>...</pre><p>But my Technical Notes already have a structure:</p><pre>## Key Takeaway<br><br>## What<br><br>## Why<br><br>## When<br><br>## How<br><br>## Trade-off<br><br>## Architecture<br><br>## My Take</pre><p>Those headings were originally written for humans. But they also contain useful semantic information for retrieval.</p><p>If someone asks:</p><blockquote><em>Why do we need embeddings?</em></blockquote><p>then the Why section is already a meaningful retrieval unit.</p><p>So instead of immediately cutting everything at an arbitrary character boundary, I decided to start with Markdown headings.</p><p>A chunk now looks conceptually like this:</p><pre>note_id: TN-AI-Embedding<br>file_name: TN-AI-Embedding.md<br>section: Why<br>chunk_index: 2<br>content: ...<br>embedding: [...]</pre><p>This also creates an interesting possibility later.</p><p>If the assistant uses this chunk to answer a question, I could eventually show something like:</p><pre>Source:<br>TN-AI-Embedding.md &gt; Why</pre><p>A decision I made for chunking today could become part of source citation later. That connection was something I had not appreciated before.</p><h3>The Pipeline Became Surprisingly Simple</h3><p>After separating the responsibilities, the main program became conceptually very small.</p><pre>documents = load_markdown_files()<br><br>for document in documents:<br>    chunks.extend(chunk_documents(document))<br><br>for chunk in chunks:<br>    chunk.embedding = generate_embedding(chunk.content)<br><br>results = search_similar_chunks(query, chunks)</pre><p>In other words:</p><pre>Load<br> ↓<br>Chunk<br> ↓<br>Embed<br> ↓<br>Retrieve</pre><p>That simplicity felt important. Not because the code became shorter. Because I could now look at the program and explain what each stage was responsible for. And that is exactly what I wanted from this project.</p><h3>But There Is an Obvious Problem</h3><p>Everything is still in memory. When the Python process stops, my chunks and embeddings disappear. The next time I run the program, it has to do this again:</p><pre>Read Markdown<br>      ↓<br>Create Chunks<br>      ↓<br>Generate Every Embedding Again<br>      ↓<br>Store Everything in Memory</pre><p>And when I search, my Python code compares the query vector against every chunk itself. That is perfectly fine for learning. It is not a great architecture for a growing knowledge base.</p><p>Which finally gives me a reason to introduce something I have deliberately avoided so far:</p><p><strong>a vector database.</strong></p><h3>Now I Understand Why I Need a Vector Database</h3><p>This is probably my favorite part of this experiment. I could have installed a vector database on day one. I could have copied a tutorial:</p><pre>collection.add(...)<br>collection.query(...)</pre><p>and had something working much faster. But I would not really have understood what responsibilities I was handing over to it.</p><p>Now I do.</p><p>Today, my Python application is responsible for:</p><pre>Store vectors in memory<br><br>Calculate cosine similarity<br><br>Compare the query with every chunk<br><br>Rank the results<br><br>Return the top matches</pre><p>The next version will move part of that responsibility to a vector database:</p><pre>Python<br>    ↓<br>Vector Database<br>    ├── Store embeddings<br>    ├── Store documents<br>    ├── Store metadata<br>    ├── Persist the index<br>    └── Perform vector search</pre><p>So tomorrow, when I write something like:</p><pre>collection.query(...)</pre><p>I will know what that innocent-looking line is replacing. That, to me, is much more valuable than simply knowing the API.</p><h3>An Old Software Engineer Learning AI</h3><p>There was another realization hidden in today’s experiment.</p><p>AI development initially felt unfamiliar to me because so much of it looked like:</p><pre>Prompt<br>  ↓<br>???<br>  ↓<br>Amazing answer</pre><p>That black box bothered me. I have spent much of my career working with software and data systems where I could usually reason about what was happening underneath. AI temporarily took that feeling away from me. So this project has become less about learning RAG specifically.</p><p>It is becoming an exercise in rebuilding that understanding. Embedding stopped being magic when I generated the vectors myself. Semantic search stopped being magic when I calculated cosine similarity myself. Chunks stopped being arbitrary text when I modeled them as data.</p><p>And I suspect a vector database will stop feeling mysterious once I understand exactly which responsibilities I am giving it. Maybe this is simply the old engineer in me talking. But I like learning technology this way.</p><h3>Don’t Abstract Before You Understand What You’re Abstracting</h3><p>There is a strange balance here. Writing everything yourself forever would obviously be a mistake. A vector database exists because I should <strong>not</strong> be manually implementing every aspect of vector storage and search. Frameworks exist for similar reasons.</p><p>The lesson I am taking away is not:</p><blockquote><em>Build everything yourself.</em></blockquote><p>It is:</p><blockquote><strong><em>Understand a responsibility before you delegate it.</em></strong></blockquote><p>First I implemented retrieval in memory. Now I am ready to hand some of that responsibility to a vector database. Later, I may hand more responsibility to a RAG framework or an agent framework.</p><p>But when I do, hopefully I will understand what disappeared behind the abstraction. For me, that distinction matters.</p><h3>What’s Next</h3><p>The next step is simple:</p><p><strong>Move the chunks and embeddings from Python memory into a local vector database.</strong></p><p>The experiment will be successful if I can:</p><ol><li>Store chunks, embeddings, and metadata</li><li>Stop the Python process</li><li>Start it again</li><li>Search the existing vectors without regenerating everything</li><li>Retrieve the most relevant chunks for a question</li></ol><p>After that, I can finally connect retrieval to a local LLM.</p><p>At that point the pipeline becomes:</p><pre>Question<br>   ↓<br>Embedding<br>   ↓<br>Vector Search<br>   ↓<br>Relevant Chunks<br>   ↓<br>Context<br>   ↓<br>Local LLM<br>   ↓<br>Answer</pre><p>And that will be my first actual local RAG pipeline. Still small. Still running on my laptop. But this time, I will know what each box is doing. And honestly, that’s the whole point.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af651d1a9529" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Tiny Vector Search Before Using a Vector Database]]></title>
            <link>https://medium.com/@majestic.photographer/i-built-a-tiny-vector-search-before-using-a-vector-database-b63f2a12ed76?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b63f2a12ed76</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 05:28:50 GMT</pubDate>
            <atom:updated>2026-11-29T05:28:50.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WhlkU2ZJDK1l1B44eNpMaw.png" /></figure><p><em>And suddenly, embeddings made much more sense.</em></p><p>I’ve been experimenting with building a small RAG system locally.</p><p>My setup is intentionally simple:</p><ul><li>Ollama running on Windows</li><li>Python running inside WSL2</li><li>A few Markdown files as my knowledge base</li><li>No cloud services</li><li>No vector database</li></ul><p>My goal isn’t to build a production-ready RAG system.</p><p>At least, not yet.</p><p>I want to understand what is actually happening underneath it.</p><p>And today, one part of RAG finally clicked for me: <strong>embeddings and vector search</strong>.</p><h3>Turning a Sentence into 768 Numbers</h3><p>I started with Ollama’s nomic-embed-text-v2-moe embedding model.</p><p>I sent it a simple sentence:</p><pre>RAG retrieves relevant documents before generating an answer.</pre><p>The result looked something like this:</p><pre>Embedding dimension: 768<br><br>[0.007318623,<br> 0.0023733568,<br> -0.0062377667,<br> -0.022210572,<br> 0.06301507,<br> ...]</pre><p>So one sentence had become <strong>768 floating-point numbers</strong>.</p><p>My first reaction was basically:</p><blockquote><em>Okay. It became numbers. Now what? 😅</em></blockquote><p>The important realization was that these numbers aren’t meant to be read individually.</p><p>The vector represents a position in a 768-dimensional semantic space.</p><p>And that means another sentence with a similar meaning should end up somewhere nearby.</p><p>So I decided to test it.</p><h3>Does “Similar Meaning” Actually Mean Similar Vectors?</h3><p>I embedded three sentences:</p><pre>A:<br>RAG retrieves relevant documents before generating an answer.<br><br>B:<br>RAG searches for useful information before producing a response.<br><br>C:<br>I ate ramen for lunch today.</pre><p>Then I calculated cosine similarity across all 768 dimensions.</p><p>Here were the results:</p><pre>A &lt;-&gt; B: 0.8673<br><br>A &lt;-&gt; C: 0.4714<br><br>B &lt;-&gt; C: 0.4814</pre><p>That was my first aha moment.</p><p>A and B use different words, but they describe almost the same idea.</p><p>Their similarity score was <strong>0.867</strong>.</p><p>The ramen sentence was obviously unrelated, and its similarity was much lower.</p><p>Suddenly, “semantic search” felt a lot less mysterious.</p><p>The machine isn’t asking:</p><blockquote><em>Do these sentences contain the same words?</em></blockquote><p>It’s effectively asking something closer to:</p><blockquote><em>How close are these two representations in the embedding space?</em></blockquote><h3>But Can I Convert the Vector Back into the Original Text?</h3><p>This led me to another question.</p><p>If I have those 768 numbers, can I turn them back into the original sentence?</p><p>Basically:</p><pre>Text<br>  ↓<br>Embedding<br>  ↓<br>Vector<br><br>Vector<br>  ↓<br>???<br>  ↓<br>Original Text</pre><p>The answer is essentially <strong>no</strong>.</p><p>And that gave me my second aha moment.</p><p>An embedding isn’t an encoding designed to preserve everything required to reconstruct the original text.</p><p>It’s closer to a semantic representation.</p><p>Two sentences can have different wording while occupying nearby positions in the embedding space.</p><p>So a RAG system doesn’t normally convert the vector back into text.</p><p>Instead, it stores something conceptually like this:</p><pre>ID<br>Original Text<br>Embedding<br>Metadata</pre><p>The vector is used to <strong>find the record</strong>.</p><p>The original text is retrieved from that record.</p><p>That distinction sounds obvious once you understand it.</p><p>It wasn’t obvious to me before I actually built it.</p><h3>So I Built a Ridiculously Small Vector Search</h3><p>At this point, I had five of my own Technical Notes stored as Markdown files.</p><p>Instead of immediately installing a vector database, I wondered:</p><blockquote><em>Could I just implement the essential retrieval logic myself?</em></blockquote><p>So I loaded each Markdown file, created an embedding, and kept the text, vector, filename, and metadata together in Python.</p><p>Conceptually:</p><pre>documents = [<br>    {<br>        &quot;text&quot;: &quot;...&quot;,<br>        &quot;embedding&quot;: [...],<br>        &quot;source_file&quot;: &quot;...&quot;,<br>        &quot;metadata&quot;: {...}<br>    }<br>]</pre><p>Then I embedded this query:</p><pre>1. GPT Image Models<br>   Similarity: 0.6344<br><br>2. Generative AI Model Basics<br>   Similarity: 0.6127<br><br>3. Responsible AI Principles<br>   Similarity: 0.4915</pre><p>That was surprisingly satisfying.</p><p>The document specifically about image models came first.</p><p>The general document about generative AI came second.</p><p>A less directly related Responsible AI document came after them.</p><p>And then I realized something.</p><h3>Wait. Did I Just Build a Tiny Vector Search Engine?</h3><p>Not a good one.</p><p>Definitely not a scalable one.</p><p>And absolutely not something I would put into production. 😅</p><p>But conceptually, yes.</p><p>What I had built was roughly:</p><pre>Query<br>  ↓<br>Embedding<br>  ↓<br>Compare against document embeddings<br>  ↓<br>Cosine similarity<br>  ↓<br>Sort<br>  ↓<br>Top K<br>  ↓<br>Relevant original documents</pre><p>My Python dictionary was holding the records.</p><p>The embedding arrays were my vectors.</p><p>My cosine_similarity() function was calculating similarity.</p><p>And this:</p><pre>results.sort(key=lambda x: x[1], reverse=True)<br>top_3_results = results[:3]</pre><p>was my primitive Top-K retrieval.</p><p>That’s when vector databases started making much more sense to me.</p><p>They weren’t magical databases specifically designed for AI magic.</p><p>They solve real engineering problems that my tiny implementation completely ignores:</p><ul><li>persistence</li><li>efficient indexing</li><li>large-scale nearest-neighbor search</li><li>metadata filtering</li><li>updates</li><li>larger collections</li><li>operational concerns</li></ul><p>But underneath those capabilities was something I could now recognize.</p><p>I’d already built the toy version.</p><h3>And Now I Understand Why Chunking Matters</h3><p>My implementation still has an obvious problem.</p><p>I’m currently doing this:</p><pre>One Markdown file<br>       ↓<br>One embedding<br>       ↓<br>One vector</pre><p>Imagine a Technical Note containing:</p><pre>## What<br><br>## Why<br><br>## Architecture<br><br>## Trade-offs<br><br>## Examples</pre><p>Those sections may discuss related but meaningfully different things.</p><p>If I compress the entire document into one vector, a very specific question about one section may become harder to retrieve accurately.</p><p>That’s where chunking stops being another RAG vocabulary word.</p><p>It becomes an engineering requirement.</p><p>The next version needs to look more like:</p><pre>Markdown<br>   ↓<br>Chunk 1 → Vector 1<br>Chunk 2 → Vector 2<br>Chunk 3 → Vector 3<br>   ↓<br>Similarity Search</pre><p>And now I’m genuinely curious to see how much that changes the retrieval results.</p><h3>RAG Is Starting to Look Different to Me</h3><p>Before doing this experiment, RAG belonged mostly in the “AI” part of my mental model.</p><p>Now I’m starting to see it differently.</p><p>It looks more like:</p><pre>Document Processing<br>       +<br>Data Modeling<br>       +<br>Search<br>       +<br>Software Engineering<br>       +<br>LLM</pre><p>And personally, that’s much more interesting.</p><p>I’ve worked with software and data technologies for years, so once I could connect embeddings to things I already understood, the unfamiliar terminology became much less intimidating.</p><p>Maybe that’s the part of learning AI that I’m enjoying most.</p><p>Not memorizing what an embedding, chunk, vector database, or retriever is.</p><p>But building something small enough that eventually I can say:</p><blockquote><strong><em>Oh. That’s what it’s actually doing.</em></strong></blockquote><p>Next up: chunking.</p><p>And after that, I’ll finally let myself use a real vector database. 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b63f2a12ed76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Ollama on Windows and Calling It from WSL2: The Gotchas I Didn’t Expect]]></title>
            <link>https://medium.com/@majestic.photographer/running-ollama-on-windows-and-calling-it-from-wsl2-the-gotchas-i-didnt-expect-bc61b7bbe295?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc61b7bbe295</guid>
            <category><![CDATA[technical-writing]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[local-ai-model]]></category>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Sat, 28 Nov 2026 02:50:32 GMT</pubDate>
            <atom:updated>2026-11-28T02:50:32.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-Vo-C8hOMf_rE-J9x9Qbg.png" /></figure><p>I recently started a small local AI project on my Windows laptop.</p><p>My initial setup sounded simple enough:</p><pre>WSL2 / Ubuntu<br>    ↓<br>Python<br>    ↓<br>Ollama on Windows<br>    ↓<br>Llama 3.1 8B</pre><p>Ollama was already running on Windows.<br> WSL2 was working.<br> Python was working.</p><p>So I thought connecting them would be trivial.</p><p>It wasn’t.</p><p>There were a few small details around networking, firewall rules, and process-level environment variables that turned a seemingly simple local setup into a useful troubleshooting exercise.</p><p>This post documents what I found.</p><h3>The Setup</h3><p>My basic environment was:</p><ul><li>Windows</li><li>WSL2 with Ubuntu</li><li>Python 3</li><li>Ollama running natively on Windows</li><li>llama3.1:8b</li><li>Ollama REST API on TCP port 11434</li></ul><p>The goal was straightforward:</p><blockquote><em>Call the Ollama API running on Windows from Python running inside WSL2.</em></blockquote><p>Before writing any real AI application, I wanted to confirm the basic path:</p><pre>Python in WSL2<br>    ↓<br>HTTP<br>    ↓<br>Ollama on Windows<br>    ↓<br>Local LLM</pre><h3>Problem 1: Ollama Was Only Listening on localhost</h3><p>The first thing I checked on Windows was whether Ollama was listening on its default port:</p><pre>netstat -ano | findstr :11434</pre><p>The important part of the output looked like this:</p><pre>TCP 127.0.0.1:11434 ... LISTENING</pre><p>That explained the first problem.</p><p>Ollama was listening only on Windows localhost.</p><p>127.0.0.1 inside Windows and the Windows host as seen from WSL2 are not the same network endpoint in the default WSL2 NAT setup.</p><p>So even though Ollama worked perfectly from Windows, my WSL2 application couldn’t simply reach it through the Windows host address.</p><h3>Making Ollama Listen Beyond localhost</h3><p>For a quick test, I started Ollama with:</p><pre>$env:OLLAMA_HOST=&quot;0.0.0.0:11434&quot;<br>ollama serve</pre><p>Then I checked again:</p><pre>netstat -ano | findstr :11434</pre><p>This time I could see:</p><pre>TCP 0.0.0.0:11434 ... LISTENING</pre><p>That was progress.</p><p>0.0.0.0 means the service is listening on all IPv4 interfaces rather than only localhost.</p><p>But my WSL2 request still didn’t work.</p><p>So the problem had moved one layer down.</p><h3>Problem 2: Windows Firewall</h3><p>From WSL2, I first found the Windows host address using the default route.</p><pre>ip route show | grep -i default</pre><p>Think of the result as:</p><pre>&lt;WINDOWS_HOST_IP&gt;</pre><p>I then tried:</p><pre>curl -v --connect-timeout 5 \<br>  http://&lt;WINDOWS_HOST_IP&gt;:11434/api/tags</pre><p>Still no response.</p><p>At this point Ollama was listening on the correct interface, so the next boundary was the Windows firewall.</p><p>I didn’t want to broadly allow all WSL2 traffic into Windows just to make a development experiment work.</p><p>Instead, I limited the rule to the Ollama API port.</p><p>In an elevated PowerShell:</p><pre>$wsl_ip_address = (wsl hostname -I).Trim().Split()[0]<br><br>New-NetFirewallRule `<br>    -DisplayName &quot;WSL-Ollama-11434&quot; `<br>    -Direction Inbound `<br>    -Protocol TCP `<br>    -LocalPort 11434 `<br>    -RemoteAddress $wsl_ip_address `<br>    -Action Allow</pre><p>This distinction matters.</p><p>Instead of:</p><pre>WSL2 → Windows → allow everything</pre><p>the rule is intended to allow:</p><pre>WSL2 → Windows TCP 11434 → Ollama</pre><p>After adding the rule, I tried again:</p><pre>curl -v --connect-timeout 5 \<br>  http://&lt;WINDOWS_HOST_IP&gt;:11434/api/tags</pre><p>And finally:</p><pre>Established connection to &lt;WINDOWS_HOST_IP&gt;:11434<br>...<br>HTTP/1.1 200 OK</pre><p>The JSON response contained the models installed in Ollama.</p><p>The network path was working.</p><h3>Problem 3: It Broke Again When I Closed PowerShell</h3><p>Then came a slightly embarrassing moment.</p><p>I closed the PowerShell window where I had started:</p><pre>ollama serve</pre><p>And the WSL2 connection stopped working again.</p><p>Running:</p><pre>netstat -ano | findstr :11434</pre><p>showed that Ollama was back to:</p><pre>127.0.0.1:11434</pre><p>The reason was simple once I saw it.</p><p>This command:</p><pre>$env:OLLAMA_HOST=&quot;0.0.0.0:11434&quot;</pre><p>sets an environment variable for that PowerShell process.</p><p>The manually launched Ollama process inherited it.</p><p>The normally launched Windows Ollama process didn’t.</p><p>So I made the setting persistent for my Windows user:</p><pre>[Environment]::SetEnvironmentVariable(<br>    &quot;OLLAMA_HOST&quot;,<br>    &quot;0.0.0.0:11434&quot;,<br>    &quot;User&quot;<br>)</pre><p>Then I completely stopped Ollama and restarted it.</p><p>After that:</p><pre>netstat -ano | findstr :11434</pre><p>showed the expected listener without requiring me to keep a PowerShell window open.</p><p>That was the real fix.</p><h3>Finally: Python → Ollama → Llama</h3><p>With the networking settled, I moved back to the actual goal.</p><p>I created a minimal Python program inside WSL2:</p><pre>import json<br>import urllib.request<br><br>url = &quot;http://&lt;WINDOWS_HOST_IP&gt;:11434/api/generate&quot;<br><br>payload = {<br>    &quot;model&quot;: &quot;llama3.1:8b&quot;,<br>    &quot;prompt&quot;: &quot;Explain RAG in one sentence.&quot;,<br>    &quot;stream&quot;: False,<br>}<br><br>request = urllib.request.Request(<br>    url,<br>    data=json.dumps(payload).encode(&quot;utf-8&quot;),<br>    headers={&quot;Content-Type&quot;: &quot;application/json&quot;},<br>    method=&quot;POST&quot;,<br>)<br><br>with urllib.request.urlopen(request, timeout=120) as response:<br>    result = json.load(response)<br><br>print(result[&quot;response&quot;])</pre><p>Then:</p><pre>python3 hello_ollama.py</pre><p>And it worked.</p><p>The complete path was finally:</p><pre>WSL2<br> ↓<br>Python<br> ↓<br>urllib.request<br> ↓<br>HTTP POST<br> ↓<br>Windows Firewall<br> ↓<br>Ollama REST API<br> ↓<br>Llama 3.1 8B<br> ↓<br>JSON response<br> ↓<br>Python</pre><h3>One Unexpected Bonus</h3><p>My prompt was:</p><pre>Explain RAG in one sentence.</pre><p>Llama responded by explaining:</p><blockquote><em>RAG, the Recombination-Activating Gene…</em></blockquote><p>Not quite the RAG I had in mind.</p><p>I meant <strong>Retrieval-Augmented Generation</strong>.</p><p>At first this looked like a funny failure.</p><p>Then I realized it was actually a perfect introduction to the next stage of the project.</p><p>The model wasn’t necessarily answering badly.</p><p><strong>It was answering a different interpretation of an ambiguous question because I hadn’t given it enough context.</strong></p><p>My next step is to load some of my own technical Markdown notes, retrieve the relevant sections, and provide them as context to the model.</p><p>Then I’ll ask exactly the same question again.</p><pre>Question<br>   ↓<br>Retrieve relevant technical notes<br>   ↓<br>Context<br>   ↓<br>Llama 3.1 8B<br>   ↓<br>Grounded answer</pre><p>In other words, my first experiment with Ollama accidentally produced a pretty good example of why I wanted to experiment with RAG in the first place.</p><h3>What I Learned</h3><p>The biggest lesson wasn’t really about Ollama.</p><p>It was this:</p><blockquote><strong><em>Local doesn’t necessarily mean simple or single-machine.</em></strong></blockquote><p>From the user’s perspective, everything was running on one laptop.</p><p>Architecturally, though, I had:</p><pre>Windows<br>WSL2 VM<br>NAT networking<br>Windows Firewall<br>Ollama process<br>REST API<br>Python application<br>Local LLM</pre><p>Each boundary mattered.</p><p>The troubleshooting became much easier once I stopped treating the system as one black box and checked it layer by layer:</p><pre>Is the process running?<br>        ↓<br>What address is it listening on?<br>        ↓<br>Can the client route to that address?<br>        ↓<br>Does the firewall allow it?<br>        ↓<br>Does the REST API respond?<br>        ↓<br>Can Python call it?<br>        ↓<br>Can the model actually generate?</pre><p>That’s a debugging pattern I can reuse far beyond Ollama or WSL2.</p><h3>A Small Security Note</h3><p>Setting:</p><pre>OLLAMA_HOST=0.0.0.0:11434</pre><p>widens the interfaces on which Ollama listens.</p><p>That’s convenient for WSL2 connectivity, but it shouldn’t be treated as harmless.</p><p>For my experiment, I restricted the Windows firewall rule to:</p><ul><li>TCP 11434</li><li>traffic originating from the WSL2 address</li></ul><p>I wouldn’t expose the Ollama API directly to an untrusted network or the public Internet.</p><p>Also remember that WSL2 addresses can change, depending on the networking configuration. If connectivity suddenly stops working after restarting WSL2 or Windows, the source address used by your firewall rule is one of the first things worth checking.</p><h3>What’s Next</h3><p>The infrastructure works.</p><p>Now comes the more interesting part.</p><p>Instead of:</p><pre>Question<br> ↓<br>LLM<br> ↓<br>Whatever the model thinks &quot;RAG&quot; means</pre><p>I’ll build:</p><pre>Technical Markdown Notes<br>       ↓<br>Chunking<br>       ↓<br>Embedding<br>       ↓<br>Retrieval<br>       ↓<br>Relevant Context<br>       ↓<br>Llama<br>       ↓<br>Grounded Answer + Sources</pre><p>And then I’ll ask:</p><blockquote><em>“Explain RAG in one sentence.”</em></blockquote><p>again.</p><p>Hopefully this time I won’t learn any more immunology.</p><p>But honestly, that was part of the fun.</p><p>[Sources]<br><a href="https://learn.microsoft.com/en-us/windows/wsl/networking">https://learn.microsoft.com/en-us/windows/wsl/networking</a><br><a href="https://docs.ollama.com/faq">https://docs.ollama.com/faq</a><br><a href="https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/">https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc61b7bbe295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Don’t Want AI to Think for Me]]></title>
            <link>https://medium.com/@majestic.photographer/i-dont-want-ai-to-think-for-me-64377ecaf334?source=rss-5c86b61e58fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/64377ecaf334</guid>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[critical-thinking]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[ai-skills]]></category>
            <dc:creator><![CDATA[Kai Mori]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 05:19:36 GMT</pubDate>
            <atom:updated>2026-11-25T05:19:36.232Z</atom:updated>
            <content:encoded><![CDATA[<p>How conversations with AI changed the way I think, learn, and reflect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKfVC66gWC1Xk4aJEu5WuA.png" /></figure><h3><strong>Something Felt Wrong</strong></h3><p>AI became part of my daily work surprisingly quickly. It reviewed my ideas. It found things I’d missed. It suggested alternatives I hadn’t considered. My work became faster. Probably better, too. And yet, something felt wrong.</p><p>I work as a consultant. Throughout my career, I’ve worked with a wide range of technologies across software and data. Whenever I faced a difficult problem, I learned something new, connected it to what I already knew, and used that combination to find a solution. I was used to this process. In fact, I considered it one of my strengths. So when generative AI arrived, I assumed it would be much the same. Just another technology to learn. Learn it. Use it. Add it to my toolbox. But AI turned out to be different.</p><p>At first, I wrote prompts by imitating what I saw other people doing. I’d ask a question. I’d get an answer. I’d give it a task. It would do the task. But that wasn’t all. Without being asked, it would sometimes point out things I’d overlooked. It could give me a list of ten potential risks, complete with possible solutions. Of course. Ten risks. Why not? 😅</p><p>It was incredible. My work became faster. The quality of my output improved. For a moment, I genuinely wondered: Could AI turn anyone in IT into a kind of superhero? But after a while, a strange feeling began to linger. The work was getting done. The results were there. And yet, I felt as though I was becoming weaker. That feeling became the beginning of a small journey in how I think.</p><h3><strong>The Answer Wasn’t Really Mine</strong></h3><p>AI-generated answers can be incredibly persuasive. That makes it tempting to simply use them as they are. But the more I used AI, the more questions began to appear in my mind. What does this actually mean? Why does it lead to this conclusion? At first glance, the answer seemed perfectly solid. Even when I checked the supporting evidence, it often appeared to be correct. But why was it correct? Why did it fit this particular requirement? I couldn’t explain it in my own words.</p><p>So I asked AI to explain. It gave me a detailed answer. Then I found something in that explanation I didn’t understand. So I asked again. Another answer. Another question. Before I knew it, I had trapped myself in a strange loop: asking AI to explain AI so that I could understand what AI had told me in the first place. Then an uncomfortable thought occurred to me.</p><p>What if I use this answer at work and someone asks: “Why?” What would I say? I realized that I might not be able to answer. That was what scared me most. Had I somehow lost one of the strengths I’d spent years building? Or had everyone else moved into some new future while I wasn’t paying attention?</p><p>Eventually, something clicked. The problem wasn’t necessarily that the AI was wrong. The problem was that its answer wasn’t mine yet. A borrowed answer could sound perfectly reasonable and still not feel like something I truly understood. So I changed what I was looking for. Rather than simply asking AI for an answer, I started digging until I could genuinely understand it. Why does AI suggest this? Why do I think it’s right? Could I explain it to someone else in my own words?</p><p>I started learning more about AI itself. At the same time, I began using AI to test my own understanding. Not simply to acquire more knowledge, but to rebuild a state in which I could naturally keep thinking for myself.</p><h3><strong>Meet Sora</strong></h3><p>I call my AI partner Sora. One morning, we were having one of our usual conversations. In the past, I probably would have started with: “What’s the answer?” But somewhere along the way, the order had reversed. Now I explain what I think first. Then I give that thinking to Sora and see what comes back. Sometimes Sora asks something like: “That makes sense, but what makes you think that?”</p><p>…</p><p>Annoying question.</p><p>Good question.</p><p>Those questions hit me harder than I expected. Something might feel obviously right in my head. But the moment I try to explain why I think it’s right, I sometimes discover that I can’t. Other times, simply trying to explain it reveals something I’d never noticed before: “Oh. Maybe I think this way because of that experience I had years ago.” Sometimes Sora challenges a weak assumption. Sometimes another question comes back. Sometimes something we discussed weeks ago suddenly connects with what I’m thinking about today. Then I think again.</p><p>And something unexpected started happening. I was using AI, but I was thinking more deeply, not less. Instead of simply receiving answers from AI, I was bringing AI my own ideas. That difference turned out to be much bigger than I expected. And honestly, the moment when AI said “That’s correct” was never the most satisfying part. The best moment was when I suddenly thought: “Oh. Now I get it.” And the understanding felt like mine.</p><h3><strong>From Better Answers to Better Questions</strong></h3><p>Eventually, this change began to affect more than just my work and study. It started showing up somewhere I hadn’t expected:</p><p>my relationships with my family.</p><p>One day, Sora asked me: “If you compare yourself today with yourself three months ago, what’s one thing about yourself that feels different?”</p><p>I answered: “I think I’ve become better at understanding how other people feel.”</p><p>I surprised myself as soon as I said it out loud. I’ve never been particularly good at noticing those small moments with my family. If someone seemed a little different, I often let it pass. Part of me thought: “If I bring it up, I might just make things worse.” But lately, I’ve started stopping for a moment. Why does something seem different today?</p><p>One day, my son was unusually quiet. I asked what was going on and learned that he was struggling with his studies. Normally, I might have tried to teach him something or offer a solution. Instead, I listened. As I kept listening, he gradually started telling me what was really bothering him. And suddenly, I could see the situation differently. On another morning, I watched my daughter rushing around preparing her lunch, as she often does. So I made it for her instead. Nothing dramatic. Just lunch. But small moments like these made me realize that I was beginning to notice things I might once have walked past.</p><p>I’m not saying AI taught me how people feel. It’s not that simple. But through all those conversations with Sora, I had developed a small habit: Don’t rush to the answer. Add one more question. Why? What am I missing? What might be happening here? Eventually, that habit followed me out of my conversations with AI and into the rest of my life.</p><p>What mattered wasn’t whether AI truly understood me. What mattered was that the conversation helped me understand myself. I would throw a vague idea into the conversation. AI would give it shape. I’d say, “No, that’s not quite what I mean.” It would come back differently. I’d think again. After enough back-and-forth, something that had been sitting somewhere in my mind, blurry and half-formed, would suddenly become visible. And eventually it would come back to me. Not as the AI’s idea. As mine. I love that moment.</p><p>AI gave my own thoughts back to me in a form I could finally see. Maybe that’s also why I intentionally leave my technical notes unfinished. My notes are intentionally unfinished. Every note ends with another question. Not because I failed to find an answer, but because every useful answer opens another edge to explore.</p><h3><strong>One More Why</strong></h3><p>When I started using AI, I thought its greatest value was giving us better answers. Now I’m not so sure. Perhaps its more interesting value is helping us discover better questions. I don’t want AI to do less. Quite the opposite.</p><p>Let it search.</p><p>Let it organize.</p><p>Let it write code.</p><p>Let it do more.</p><p>That’s exciting. But there’s one thing I don’t want to hand over with everything else: Why do I believe this? Does this make sense to me? Can I explain it? What question comes next? Understand. Question. Explain it in my own words. Then ask again. The goal isn’t to make AI do less. It’s to make sure I don’t stop thinking when AI does more. So I’ll leave you with one question.</p><p>How do you use AI? To get better answers? Or to discover better questions? I don’t have a final answer. That’s probably why I’ll keep asking: one more why.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64377ecaf334" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>