<?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 Tirth Kanani on Medium]]></title>
        <description><![CDATA[Stories by Tirth Kanani on Medium]]></description>
        <link>https://medium.com/@tirthkanani18?source=rss-5b9aafae0030------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yM46EF-RxUdzq3RWdDrRRA.jpeg</url>
            <title>Stories by Tirth Kanani on Medium</title>
            <link>https://medium.com/@tirthkanani18?source=rss-5b9aafae0030------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:46:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tirthkanani18/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[The Coming Intelligence Import Bill]]></title>
            <link>https://tirthkanani18.medium.com/the-coming-intelligence-import-bill-520186a5c7d2?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/520186a5c7d2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[sovereignty]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 20:39:33 GMT</pubDate>
            <atom:updated>2026-07-27T20:39:33.757Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3uRsA3uJ6BEUd51sViofQ.png" /></figure><p>Frontier AI needs common standards. It also needs more countries capable of building, adapting and controlling the systems those standards govern.</p><p>The next customs frontier may be an API gateway.</p><p>On 30 March 2026, a 28-year assumption about digital trade expired.</p><p>Since 1998, members of the World Trade Organization had repeatedly agreed not to impose customs duties on electronic transmissions. At the WTO’s Fourteenth Ministerial Conference in Yaoundé, they failed to renew that moratorium.</p><p>The United States Trade Representative blamed Brazil and Türkiye for blocking a US-backed proposal to extend the arrangement until the end of 2030. Brazil’s position was different: it supported a shorter continuation and resisted turning a repeatedly renewed temporary measure into something approaching permanence. The allocation of blame remains contested. The outcome does not. According to the <a href="https://www.wto.org/english/tratop_e/ecom_e/ecom_work_programme_e.htm">WTO’s post-conference account</a>, the moratorium lapsed on 30 March. The <a href="https://ustr.gov/about/policy-offices/press-office/press-releases/2026/march/press-release-regarding-wtos-14th-ministerial-conference">United States Trade Representative’s statement</a> records the American position.</p><p>No customs officer immediately began inspecting software downloads, cloud queries or artificial-intelligence prompts. Nor does the lapse mean governments will necessarily impose tariffs on AI services.</p><p>There are also partial alternatives. Under the WTO’s separate <a href="https://www.wto.org/english/tratop_e/ecom_e/joint_statement_e.htm">Agreement on Electronic Commerce</a>, 67 members representing approximately 70 per cent of global trade have adopted interim arrangements intended to bring a permanent duty-free framework into force. But the agreement is not yet in force. It requires 45 formal acceptances, which its co-convenors aim to secure by mid-2027. The United States is not among the 67 participants, although in May it introduced a separate <a href="https://www.wto.org/english/news_e/news26_e/gc_06may26_386_e.htm">19-member commitment</a> not to impose duties on electronic transmissions among its signatories.</p><p>The resulting patchwork matters. It shows that international digital trade is fragmenting just as artificial intelligence is becoming one of its most valuable products.</p><p>When a company sends data to a model operating abroad and receives software, analysis, product designs, scientific hypotheses or operational decisions in return, nothing physical crosses a port. Productive capability has nevertheless crossed a border.</p><p>Today, the payment appears as an API charge, an enterprise licence or a cloud-computing bill.</p><p>Tomorrow, the intelligence import bill may contain more lines.</p><h3>Standards are necessary. They are not sovereignty.</h3><p>On 14 July, Demis Hassabis published one of the most consequential AI-governance proposals of the year.</p><p>In <a href="https://demishassabis.substack.com/p/a-framework-for-frontier-ai-and-the-dawning-of-a-new-age">A Framework for Frontier AI and the Dawning of a New Age</a>, the Google DeepMind co-founder and chief executive called for a US-led standards body modelled partly on FINRA, the industry-funded organisation that oversees American securities brokerages under federal supervision.</p><p>Frontier laboratories would initially submit their most capable models voluntarily, potentially up to 30 days before release. The body would test those systems for dangerous cyber capabilities, biological and nuclear risks, deception, attempts to evade safeguards and other high-risk behaviour. Once the process proved sufficiently reliable, passing it could become a condition for deploying a frontier model in the United States.</p><p>The proposal is no longer merely an academic thought experiment. Sam Altman and Elon Musk publicly described it favourably, David Sacks said it had merit, and the White House is reportedly reviewing a related FINRA-style design. The standards track is becoming a live policy question, as <a href="https://fortune.com/2026/07/21/google-deepmind-ceo-demis-hassabis-finra-for-ai-proposal-gains-momentum-but-is-it-any-good/">Fortune reported</a>.</p><p>That is welcome. Frontier AI needs credible, continuously updated and technically sophisticated evaluation. Governments cannot govern systems they do not understand, and static legislation will struggle to keep pace with capabilities that can change substantially within months.</p><p>But Hassabis’s proposal raises a second question.</p><p>Who will build the models being tested?</p><blockquote><em>Standards can make imported intelligence safer. They cannot guarantee that it will remain affordable, available or under the importing country’s control.</em></blockquote><p>A country may possess excellent regulators, respected testing institutions and responsible deployment rules while remaining dependent on foreign laboratories for the models, weights, infrastructure and updates beneath its economy.</p><p>That is not sovereignty.</p><p>It is well-managed dependency.</p><h3>AI is not simply another software dependency</h3><p>The strongest objection is that countries have depended on foreign technology for decades.</p><p>Governments, hospitals and major companies operate using Windows, SAP, American cloud platforms and semiconductors manufactured through globally distributed supply chains. Why should reliance on foreign AI be treated as a distinct sovereignty problem?</p><p>Some existing software and semiconductor dependencies are already strategic vulnerabilities. But advanced AI adds three characteristics that make the dependency broader and potentially harder to reverse.</p><p>First, AI is becoming an input into decisions rather than merely a tool performing a discrete function.</p><p>Traditional software generally executes a process specified by its users. Advanced AI increasingly interprets information, recommends actions, writes the software connecting other systems and operates through semi-autonomous agents.</p><p>As these systems enter scientific research, defence, finance, medicine, energy, manufacturing and public administration, they may influence not one isolated process but the operation of the institution itself.</p><p>Second, the dependency compounds.</p><p>An organisation may redesign its data, workflows, security controls and employee practices around a particular model. AI agents may be connected to databases, communications systems and other software. Replacing the provider may therefore require rebuilding a network of organisational processes rather than installing a substitute application.</p><p>A company can remain theoretically free to change suppliers while becoming practically unable to do so without substantial cost and disruption.</p><p>Third, AI dependence has a normative dimension.</p><p>Every advanced model embodies choices about acceptable behaviour, prohibited uses, access to information and tolerable risk. A country relying entirely on foreign systems may find that commercially or socially important decisions are mediated by policies created under another jurisdiction’s laws, political pressures and national-security priorities.</p><p>A government can regulate how a foreign model is used within its territory. Its influence is nevertheless limited when it cannot inspect, modify or credibly replace the system underneath.</p><blockquote><em>Advanced AI is therefore becoming both deeply embedded and externally conditionable.</em></blockquote><p>The second part of that combination is already visible in semiconductor policy. Under <a href="https://www.bis.gov/media/documents/bis-guidance-may-31-2026.pdf">US Bureau of Industry and Security guidance</a>, specified advanced computing equipment can require an export licence based on the headquarters or ultimate ownership of the recipient, even when the recipient itself is located in another country. These controls concern particular hardware and defined activities, not ordinary chatbot use. But they establish the relevant principle: access to infrastructure underlying advanced intelligence can be conditioned by nationality, ownership and geopolitical alignment.</p><p>It is not difficult to imagine that principle extending, in some circumstances, to high-end inference capacity, advanced model weights, specialised agents or assistance in developing frontier systems.</p><p>That is a forecast, not a description of a universal policy already in force.</p><p>But the assumption that access will remain permanently unrestricted is also a forecast.</p><h3>Friction will come from both directions</h3><p>A conventional customs duty is normally collected by the importing country’s government. It is not handed to the country that produced the imported product.</p><p>An API payment is different. It flows principally to the company supplying the model.</p><p>The future intelligence import bill could combine commercial payments, domestic taxes and foreign access conditions. More importantly, the friction may be created from two different directions.</p><p>The first is importer-side taxation.</p><p>Governments buying digital services from foreign companies may seek to preserve their tax bases, raise public revenue or ensure that overseas providers contribute to the economies from which they earn income.</p><p>That consideration sat behind part of the dispute in Yaoundé. Brazil and other developing economies have argued that an indefinite prohibition on digital customs duties could constrain their future fiscal choices while disproportionately benefiting the largest technology-exporting economies.</p><blockquote><em>The first formal intelligence duties may therefore be imposed not by model-producing countries seeking to withhold capability, but by importing governments seeking to tax it.</em></blockquote><p>They could use customs duties, digital-services taxes, consumption taxes, withholding arrangements or local-presence requirements. Most of those instruments are not unique to AI; they already form part of the wider debate over digital services. Their extension to AI would represent one component of the bill, not the entire argument.</p><p>The second direction is producer-side conditioning.</p><p>Countries controlling advanced chips, models and computing infrastructure may decide where those capabilities can be supplied and on what terms. They could require export licences, limit transfers of model weights, prioritise domestic customers or trusted allies, or prohibit access to particular capabilities in particular jurisdictions.</p><p>Some restrictions may be defensible on national-security grounds. Some taxes may be legitimate exercises of fiscal sovereignty. The point is not that every new condition will be unreasonable.</p><p>The point is that a supposedly borderless market for digital intelligence is likely to acquire more borders.</p><p>Nor does every restriction need to take the form of money. During a semiconductor shortage, cyber emergency or geopolitical dispute, the relevant cost may be delay, reduced capacity or denial of access.</p><p>A producing country may permit use of a model but withhold its most powerful tools. A provider may prioritise domestic institutions when computing capacity becomes scarce. A government may prevent a laboratory from supplying an advanced system to a particular customer or country.</p><p>In those circumstances, dependency would not appear as a tariff.</p><p>It would appear as a capability that is unavailable precisely when it is most valuable.</p><p>The genuinely novel issue is therefore not whether VAT or digital-services taxes will be applied to another category of software. It is that access to frontier intelligence is becoming a strategic trade relationship, and strategic trade relationships rarely remain free of conditions.</p><h3>The frontier is concentrated</h3><p>That would matter less if advanced AI capability were widely distributed.</p><p>It is not.</p><p>The <a href="https://hai.stanford.edu/ai-index/2026-ai-index-report">2026 Stanford AI Index</a> reports that industry produced more than 90 per cent of notable models in 2025. US-based organisations produced 50 notable models and Chinese organisations produced 30. Stanford also estimates that private AI investment in the United States reached $285.9 billion in 2025, more than 23 times China’s recorded $12.4 billion, while cautioning that the private figures understate Chinese investment supported through government guidance funds.</p><p>This concentration is not evidence of wrongdoing.</p><p>American laboratories have attracted extraordinary capital and talent, assembled enormous infrastructure and taken substantial scientific and commercial risks. China has built an increasingly capable parallel ecosystem. The organisations involved have achieved genuine engineering breakthroughs.</p><p>But concentration creates leverage regardless of how fairly it arose.</p><p>Several foreign providers can compete vigorously with one another while an importing country remains collectively dependent on the group.</p><p>The danger emerges when three conditions coincide: the capability becomes essential, its production remains concentrated, and replacing it becomes progressively harder.</p><p>A country may provide the electricity, host the data centres, generate local data and supply customers while the most valuable intellectual property, platform margins and engineering experience accumulate elsewhere.</p><p>Domestic companies can still create considerable value using foreign models. International trade and technical specialisation are beneficial. But an economy permanently confined to the application layer risks surrendering much of the bargaining power, learning and strategic option value associated with the foundation layer.</p><h3>Open weights may change the equation</h3><p>The strongest counterargument is open-weight AI.</p><p>If highly capable open models continue to be released, countries may be able to download, adapt and operate them without paying permanent fees to a closed foreign provider. That would weaken both the provider’s pricing power and the threat that access could suddenly be withdrawn.</p><p>This is not a theoretical possibility. In July, the UK’s <a href="https://www.aisi.gov.uk/blog/how-far-behind-the-frontier-are-leading-open-weight-models-on-cyber">AI Security Institute reported</a> that the most capable open-weight model it tested performed similarly on its cyber evaluations to leading closed systems released only four to seven months earlier. The precise result applies to AISI’s particular cyber tasks, not every measure of general capability, but it shows why open weights must be treated as a central part of the sovereignty debate.</p><p>Open models can support local deployment, independent evaluation, adaptation to national languages and operation inside secure environments that cannot rely on an external API.</p><p>Governments should encourage them where the security risks are manageable.</p><p>But open weights do not remove every dependency. A country may be able to operate the present generation while lacking the compute, research teams and industrial knowledge required to develop its successor.</p><p>It may control today’s model while remaining dependent on another country for tomorrow’s major advance.</p><p>There is also no guarantee that the most capable future systems will always be released openly. As cyber, biological and autonomous capabilities increase, developers and governments may become less willing to distribute powerful weights without restrictions.</p><p>The prudent strategy is neither to assume open models will disappear nor to assume they will permanently solve the problem.</p><p>Countries should use open weights as a route towards capability, not as an excuse to avoid building capability.</p><h3>Not every country can reproduce Silicon Valley</h3><p>This leads to the hardest question.</p><p>Can a medium-sized economy realistically compete?</p><p>The financial scale is daunting. Stanford’s $285.9 billion figure represents an entire year of private AI investment across the United States. Britain’s Sovereign AI programme is a £500 million public fund. The categories and currencies are not directly comparable, but the distance is large enough to expose the limits of any strategy based on imitating the American ecosystem within one national programme.</p><blockquote><em>Pretending otherwise would turn sovereignty into branding.</em></blockquote><p>Britain nevertheless illustrates what a serious beginning can look like. The Government formally launched its <a href="https://www.gov.uk/government/news/ai-firms-pioneering-drug-discovery-cheaper-supercomputing-and-more-get-first-backing-through-uks-sovereign-ai">£500 million Sovereign AI programme</a> on 16 April. It combines equity investment, assistance with recruitment and procurement, and access to as many as one million GPU-hours of national computing capacity for an individual supported company. Its first cohort includes companies working on computing infrastructure, biological models, agentic systems and world models.</p><p>Britain has also announced a <a href="https://www.gov.uk/government/news/a-decisive-shift-to-power-british-ai-new-11-billion-plan-to-back-chip-firms-boost-computing-power-and-skills-for-the-ai-revolution">£1.1 billion AI Hardware Plan</a>, including £750 million for a new national supercomputer. The AI Security Institute gives the country an internationally respected base for model evaluation.</p><p>These are meaningful commitments. They do not place Britain on equal financial terms with the largest American technology companies.</p><p>Nor should every project using nationally controlled computing infrastructure automatically be described as globally frontier-leading. A secure model adapted to domestic institutions and capable of operating in regulated or air-gapped environments may deliver substantial strategic value without topping every general-purpose leaderboard.</p><p>That distinction is not defeatism. It is the beginning of an honest strategy.</p><p>For most countries, minimum viable sovereignty will not mean independently matching the largest American or Chinese laboratory. It will mean combining domestic technical expertise, competitive open weights, national or regional computing infrastructure and dependable collaboration with trusted partners.</p><p>Pooled allied capability may be more realistic than complete national self-sufficiency.</p><p>A group of aligned countries could jointly fund training runs, share specialised computing infrastructure, guarantee emergency capacity and divide work across general, scientific, defence and multilingual systems. One country might contribute energy, another semiconductor expertise, and others capital, research, data or evaluation capacity.</p><p>Britain is not alone in recognising this. The <a href="https://digital-strategy.ec.europa.eu/en/library/ai-office-publishes-frontier-ai-expert-findings-eu-competitiveness-sovereignty-and-security">European AI Office’s expert forum</a> has warned that the next one to two years could be decisive for Europe and identified computing infrastructure and the energy to power it as urgent priorities. India is supporting indigenous foundation models through the <a href="https://indiaai.gov.in/article/indiaai-mission-call-for-proposals-to-build-foundational-ai-models">IndiaAI Mission</a>, while Japan’s GENIAC programme is providing computing resources for domestic model development.</p><p>These programmes will not all succeed. The term sovereign will sometimes be used more generously than the underlying technical evidence permits.</p><p>But their direction is rational.</p><p>Buying AI services and possessing AI capability are not the same thing.</p><h3>From national models to capability ecosystems</h3><p>Governments should stop treating sovereignty as the announcement of a single national model.</p><p>A model is an output. Sovereignty is a continuing capability.</p><p>It requires researchers who can train and modify systems, engineers who can deploy them securely, computing capacity available over several generations, reliable energy, evaluation institutions, demanding customers and access to essential hardware.</p><p>The first task is to measure dependency.</p><p>Governments should identify which critical functions rely on externally controlled models, how much expenditure flows to foreign model and cloud providers, whether relevant weights are accessible, where sensitive data are processed and how quickly essential services could be migrated.</p><p>The important measure is not how many AI pilot schemes a government has announced. It is what proportion of critical national inference depends on systems the country cannot control or replace.</p><p>The second task is to define minimum viable sovereignty.</p><p>A domestic, regional or allied system does not need to outperform every global model at every task. It must be sufficiently capable in areas that matter strategically: cyber defence, scientific research, healthcare, engineering, financial supervision, public administration and national security.</p><p>For a large economy, that may require several competing domestic laboratories. For a smaller country, it may mean adapting open models, contributing to regional computing infrastructure and negotiating guaranteed access to jointly governed systems.</p><p>Every country does not need to build everything.</p><p>Every country needs a strategy for what it must be able to do without asking another country’s permission.</p><p>The third task is to support capability ecosystems rather than permanent national champions.</p><p>Frontier development remains uncertain. Supporting several teams reduces the risk of technical failure, complacency and political favouritism. Public computing capacity should be allocated in stages against measurable engineering, security and performance milestones.</p><p>The fourth task is to create demand.</p><p>Government procurement should not protect inferior domestic technology. But capable national, regional or open-weight systems need a credible route into public services and regulated industries.</p><p>Grants can produce demonstrations. Customers build industries.</p><p>The fifth task is to negotiate AI partnerships before a crisis occurs.</p><p>Trusted countries should develop agreements covering shared computing infrastructure, reciprocal emergency capacity, model access, semiconductor supply, evaluation standards and the treatment of cross-border AI services.</p><p>Those agreements should also seek to preserve predictable and, where appropriate, duty-free digital trade among participants. Importing governments should retain legitimate taxing powers, but arbitrary barriers and sudden discriminatory charges would weaken the allied ecosystems on which many countries will depend.</p><p>International cooperation is not weakened when countries retain capabilities of their own.</p><p>It becomes more balanced.</p><h3>Standards among makers, not only customers</h3><p>This returns to Hassabis’s proposal.</p><p>A frontier AI standards body could become an important institution. Shared evaluation methods would improve safety, reduce duplication and give governments a common language for understanding dangerous capabilities.</p><p>But standards regimes are shaped most strongly by those capable of developing the systems they govern.</p><p>Countries bringing models, computing resources, research and evaluation expertise to the table will participate as technical peers.</p><p>Countries bringing only demand will participate principally as customers.</p><p>A more widely distributed frontier carries risks. More development teams could create more opportunities for weak security, misuse and irresponsible release. That is why capability and evaluation must advance together.</p><p>A country that develops models without the capacity to test them may create danger. A country that evaluates models but cannot build or adapt them may become dependent. Countries capable of doing both can contribute to international governance from a position of technical credibility.</p><p>This is not an argument against the United States, China, frontier laboratories or international trade. The organisations building advanced models have created extraordinary technologies from which the world will benefit.</p><p>It is an argument against permanent dependency.</p><h3>Before the gateway acquires a toll</h3><p>There may never be a single universal tariff called an AI duty.</p><p>Some of the coming cost may be imposed by importing governments seeking revenue. Some may come from producing countries placing conditions on access to strategic capabilities. Some may simply be commercial pricing exercised in a concentrated market.</p><p>The name of the mechanism matters less than the position of the country facing it.</p><p>Countries that can train, adapt, evaluate and securely operate competitive systems will continue using foreign models. The difference is that they will do so from a position of choice.</p><p>Countries without credible alternatives may receive the same technology, but on terms established largely elsewhere.</p><p>Governments have repeatedly recognised their dependence on imported energy, machinery and semiconductors only after those relationships became expensive and difficult to change.</p><p>They should not repeat that mistake with intelligence.</p><p>The next customs frontier may have no ports, cargo ships or border posts.</p><p>It may be an API gateway.</p><p>The time to build an alternative is before that gateway acquires a toll.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=520186a5c7d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Knowledge Graph That Cuts Claude Code’s Token Usage by 49x]]></title>
            <link>https://tirthkanani18.medium.com/i-built-a-knowledge-graph-that-cuts-claude-codes-token-usage-by-49x-ca73ef078981?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca73ef078981</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 15:31:27 GMT</pubDate>
            <atom:updated>2026-03-16T15:31:27.452Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Tree-sitter parsing and blast-radius analysis give AI code reviewers surgical precision</h3><p>Every time Claude Code reviews your code, it reads your entire codebase. Every function. Every import. Every test file. On a 500-file project, that’s thousands of tokens burned on files that have nothing to do with the two lines you changed.</p><p>I was watching my token budget drain during a code review session on a FastAPI project with nearly 3,000 files. Claude was reading middleware, database models, and utility files that had nothing to do with the endpoint I’d just modified. The review was decent, but it cost 5,500 tokens when it should have cost 800.</p><p>That’s when I started building <strong>code-review-graph</strong> — a persistent, incremental knowledge graph that tells Claude exactly which files matter for any given change.</p><p>The result: <strong>6.8x fewer tokens on average, with review quality that actually improved.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_O310wLdYdfAZZiMaBTA1A.png" /></figure><p>When you ask Claude Code to review a pull request, here’s what happens behind the scenes:</p><ol><li>Claude reads the git diff to see what changed</li><li>It opens the changed files to understand context</li><li>It reads imports and related files to understand dependencies</li><li>It reads tests to check coverage</li></ol><p>Step 2 through 4 is where the problem lives. Claude doesn’t know which related files actually matter. So it reads everything it can find. In a monorepo like Next.js (27,732 files), that means Claude might scan hundreds of files when only 15 are relevant.</p><p>This isn’t just a cost problem. It’s a quality problem. When Claude reads 20,000 tokens of irrelevant code, the signal-to-noise ratio drops. The actual change gets buried under context that adds nothing to the review.</p><p><strong>What if Claude could know, before reading a single file, exactly which functions, classes, and tests are affected by a change?</strong></p><p>That’s what a code knowledge graph provides.</p><h3>How It Works: From Source Code to Surgical Reviews</h3><p>The system has four stages: <strong>parse</strong>, <strong>store</strong>, <strong>trace</strong>, and <strong>serve</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E0hNCkUOeaj83cHrHIZspw.png" /></figure><h3>Stage 1: Parse with Tree-sitter</h3><p>Every source file gets parsed into an Abstract Syntax Tree using Tree-sitter grammars. The parser extracts five types of structural nodes:</p><ul><li><strong>Files</strong> — source code files as top-level containers</li><li><strong>Classes</strong> — classes, structs, interfaces, enums</li><li><strong>Functions</strong> — functions, methods, constructors</li><li><strong>Types</strong> — type aliases, interfaces (TypeScript, Go, Rust)</li><li><strong>Tests</strong> — test functions, auto-detected by naming patterns</li></ul><p>And seven types of edges between them:</p><ul><li><strong>CALLS</strong> — function A invokes function B</li><li><strong>IMPORTS_FROM</strong> — file A imports from file B</li><li><strong>INHERITS</strong> — class A extends class B</li><li><strong>IMPLEMENTS</strong> — class A implements interface B</li><li><strong>CONTAINS</strong> — file contains class, class contains method</li><li><strong>TESTED_BY</strong> — function A is tested by test B</li><li><strong>DEPENDS_ON</strong> — general dependency relationship</li></ul><p>This works across 12 languages: Python, TypeScript, JavaScript, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, and C/C++. Each language has its own Tree-sitter grammar with specific AST node mappings — class_definition for Python, class_declaration for Java, struct_item for Rust, and so on.</p><p>Here’s a simplified version of how the parser maps language-specific AST nodes:</p><pre>_CLASS_TYPES = {<br>    &quot;python&quot;:     [&quot;class_definition&quot;],<br>    &quot;typescript&quot;: [&quot;class_declaration&quot;, &quot;interface_declaration&quot;],<br>    &quot;go&quot;:         [&quot;type_declaration&quot;],<br>    &quot;rust&quot;:       [&quot;struct_item&quot;, &quot;enum_item&quot;, &quot;impl_item&quot;],<br>    &quot;java&quot;:       [&quot;class_declaration&quot;, &quot;interface_declaration&quot;],<br>}</pre><pre>_FUNCTION_TYPES = {<br>    &quot;python&quot;:     [&quot;function_definition&quot;],<br>    &quot;typescript&quot;: [&quot;function_declaration&quot;, &quot;method_definition&quot;],<br>    &quot;go&quot;:         [&quot;function_declaration&quot;, &quot;method_declaration&quot;],<br>    &quot;rust&quot;:       [&quot;function_item&quot;],<br>    &quot;java&quot;:       [&quot;method_declaration&quot;, &quot;constructor_declaration&quot;],<br>}</pre><p>The parser walks each AST recursively, extracting qualified names (like auth.py::UserService.login), line numbers, parameters, and return types.</p><h3>Stage 2: Store in SQLite</h3><p>Everything goes into a local SQLite database with three tables:</p><pre>CREATE TABLE nodes (<br>    id INTEGER PRIMARY KEY,<br>    kind TEXT,             -- File, Class, Function, Type, Test<br>    qualified_name TEXT,   -- e.g., &quot;auth.py::UserService.login&quot;<br>    file_path TEXT,<br>    line_start INTEGER,<br>    line_end INTEGER,<br>    language TEXT,<br>    parent_name TEXT,      -- enclosing class for methods<br>    params TEXT,<br>    return_type TEXT,<br>    is_test BOOLEAN<br>);</pre><pre>CREATE TABLE edges (<br>    kind TEXT,                -- CALLS, IMPORTS_FROM, INHERITS, etc.<br>    source_qualified TEXT,<br>    target_qualified TEXT,<br>    file_path TEXT,<br>    line INTEGER<br>);</pre><pre>CREATE TABLE metadata (key TEXT, value TEXT);</pre><p>SQLite runs in WAL (Write-Ahead Logging) mode for concurrent reads during updates. Indexes on qualified_name, file_path, and edge endpoints keep queries fast. The entire graph lives in a single file at .code-review-graph/graph.db — no external database, no cloud, no latency.</p><h3>Stage 3: Trace the Blast Radius</h3><p>This is where the magic happens. When you change a file, the graph computes the <strong>blast radius</strong> — every function, class, and test that could be affected by the change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58zW_G1d4pW19lCWGfhUQQ.png" /></figure><p>The algorithm is a breadth-first search (BFS) from the changed nodes:</p><ol><li>Identify which code entities (functions, classes) were modified</li><li>Traverse <strong>forward</strong> — what does the changed code call? (downstream impact)</li><li>Traverse <strong>backward</strong> — what calls the changed code? (upstream dependents)</li><li>Include tests that cover any impacted node</li><li>Stop at depth 2 (configurable) to keep the radius focused</li></ol><p>In the diagram above, changing login() in auth.py ripples out to validate_token() (called by login), AuthMiddleware and protected_route() (which call validate_token), plus test_login() and test_protected(). Meanwhile, utils.py, config.py, and database.py are completely unrelated and get excluded.</p><p>Claude reads 5 files instead of 12. The review focuses on the code that actually matters.</p><h3>Stage 4: Serve via MCP</h3><p>The graph runs as an MCP (Model Context Protocol) server that Claude Code connects to. When Claude needs to review code, it calls the graph’s tools instead of scanning the filesystem:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;code-review-graph&quot;: {<br>      &quot;command&quot;: &quot;uvx&quot;,<br>      &quot;args&quot;: [&quot;code-review-graph&quot;, &quot;serve&quot;]<br>    }<br>  }<br>}</pre><p>Eight MCP tools are available:</p><ul><li>build_or_update_graph_tool — full or incremental build</li><li>get_impact_radius_tool — blast radius from changed files</li><li>get_review_context_tool — focused review context with structural summary</li><li>query_graph_tool — explore code relationships (callers_of, callees_of, etc.)</li><li>semantic_search_nodes_tool — find code by name or meaning</li><li>embed_graph_tool — compute vector embeddings for semantic search</li><li>list_graph_stats_tool — graph statistics</li><li>get_docs_section_tool — documentation sections</li></ul><h3>The Key Insight: Incremental Updates</h3><p>A code knowledge graph is only useful if it stays current. Rebuilding the entire graph after every edit would be impractical. So the system uses incremental updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KtzFwy7UZOGtg9NzzAzwjw.png" /></figure><p>When a hook fires (on file save or git commit):</p><ol><li><strong>git diff</strong> identifies which files changed</li><li><strong>SHA-256 hash comparison</strong> confirms actual content changes (not just timestamp updates)</li><li><strong>Dependency traversal</strong> finds files that import or use the changed files</li><li><strong>Selective re-parsing</strong> only processes changed files and their dependents</li></ol><p>On a 2,915-file project (FastAPI), an incremental update touches 5 files and completes in under 2 seconds. The other 2,910 files are skipped entirely.</p><p>This is set up through Claude Code hooks that fire automatically:</p><pre>{<br>  &quot;hooks&quot;: {<br>    &quot;PostEdit&quot;: [{<br>      &quot;matcher&quot;: &quot;Write|Edit&quot;,<br>      &quot;hooks&quot;: [{&quot;type&quot;: &quot;command&quot;, &quot;command&quot;: &quot;code-review-graph update&quot;}]<br>    }],<br>    &quot;PostGit&quot;: [{<br>      &quot;matcher&quot;: &quot;commit&quot;,<br>      &quot;hooks&quot;: [{&quot;type&quot;: &quot;command&quot;, &quot;command&quot;: &quot;code-review-graph update&quot;}]<br>    }]<br>  }<br>}</pre><p>You never think about the graph. It just stays current.</p><h3>Benchmarks: Real Numbers on Real Repositories</h3><p>I tested on three open-source repositories of increasing scale: httpx (125 files), FastAPI (2,915 files), and Next.js (27,732 files).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3qvrQyVjahXNy5qk95aOw.png" /></figure><h3>Code Review Results</h3><p>Across 6 real git commits, the graph delivered a <strong>6.8x average token reduction</strong>:</p><p><strong>httpx (125 files)</strong></p><p>Standard approach: 12,507 tokens | With graph: 458 tokens | <strong>26.2x reduction</strong></p><p>Review quality: 9.0/10 vs 7.0/10</p><p><strong>FastAPI (2,915 files)</strong></p><p>Standard approach: 5,495 tokens | With graph: 871 tokens | <strong>8.1x reduction</strong></p><p>Review quality: 8.5/10 vs 7.5/10</p><p><strong>Next.js (27,732 files)</strong></p><p>Standard approach: 21,614 tokens | With graph: 4,457 tokens | <strong>6.0x reduction</strong></p><p>Review quality: 9.0/10 vs 7.0/10</p><p>Quality was scored on four dimensions: accuracy, completeness, bug-catching potential, and actionable insight (1–10 scale). The graph-assisted reviews scored <strong>1.6 points higher on average</strong> — not despite the reduced context, but because of it. Less noise means Claude focuses on what actually matters.</p><h3>Live Coding Tasks</h3><p>I also tested 6 real coding tasks (adding features, fixing bugs) where an agent used the graph to navigate the codebase. The savings were even more dramatic:</p><p><strong>httpx:</strong> 14,090 tokens vs 64,666 without graph (<strong>4.6x</strong>, 58 files skipped)</p><p><strong>FastAPI:</strong> 37,217 tokens vs 138,585 without graph (<strong>3.7x</strong>, 1,120 files skipped)</p><p><strong>Next.js:</strong> 15,049 tokens vs 739,352 without graph (<strong>49.1x</strong>, ~16,000 files skipped)</p><h3>The Monorepo Case</h3><p>The Next.js result deserves its own section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uMtx3lbPMXtOt1RBSQQAw.png" /></figure><p>27,732 files. 739,352 tokens. Without the graph, Claude would need to scan a significant portion of this to understand how a change in one package affects the rest. With the graph, it reads ~15 files. <strong>49x fewer tokens.</strong> 27,700+ files excluded from the review context entirely.</p><p>This is where the approach really shines. The larger your codebase, the more irrelevant context the graph eliminates. Token savings scale superlinearly with repository size.</p><h3>Architecture Decisions That Made It Work</h3><p>A few design choices were critical to making this practical rather than theoretical.</p><h3>SQLite Over a Graph Database</h3><p>I chose SQLite instead of Neo4j or Memgraph for several reasons:</p><ul><li><strong>Zero setup.</strong> No server to run, no Docker container, no connection string. The graph is a single file.</li><li><strong>Portability.</strong> The .code-review-graph/ directory travels with the repo. Clone and go.</li><li><strong>Performance.</strong> For codebases up to ~50k files, SQLite with proper indexes handles BFS traversal in milliseconds. NetworkX provides the graph algorithms on top.</li><li><strong>Reliability.</strong> WAL mode handles concurrent reads during hook-triggered updates without corruption.</li></ul><p>For codebases larger than 50k files, a dedicated graph database would be warranted. That’s on the v2.0 roadmap.</p><h3>Tree-sitter Over Regex or LSP</h3><p>Tree-sitter gives production-grade ASTs for 12 languages with a single unified API. The alternatives:</p><ul><li><strong>Regex-based parsing</strong> would miss nested structures, decorators, and complex call chains. It breaks on edge cases.</li><li><strong>LSP (Language Server Protocol)</strong> would require running a language server per language, each with its own setup and memory footprint. Impractical for a plugin that needs to work instantly on any project.</li><li><strong>Tree-sitter</strong> gives fast, correct, incremental parsing with community-maintained grammars for every major language. One dependency covers all 12 languages.</li></ul><h3>Qualified Names as Node Identifiers</h3><p>Every code entity gets a unique qualified name like auth.py::UserService.login. This sounds obvious, but it’s critical for making edges work across files. When routes.py calls UserService.login(), the edge connects routes.py::handle_request to auth.py::UserService.login by matching the qualified name — no guessing, no heuristics.</p><h3>Hooks Over Polling</h3><p>The graph updates via Claude Code hooks (PostEdit, PostGit) instead of filesystem polling. Hooks are event-driven, instant, and consume zero resources when idle. Watch mode (filesystem polling via watchdog) is available as an option but isn’t the default.</p><h3>Getting Started</h3><p>Install as a Claude Code plugin:</p><pre>claude plugin marketplace add tirth8205/code-review-graph<br>claude plugin install code-review-graph@code-review-graph</pre><p>Or via pip:</p><pre>pip install code-review-graph<br>code-review-graph install</pre><p>Restart Claude Code, open your project, and tell Claude:</p><pre>Build the code review graph for this project</pre><p>The initial build takes ~10 seconds for a 500-file project. After that, incremental updates happen automatically on every file edit and git commit.</p><p>Three slash commands give you immediate access:</p><ul><li>/code-review-graph:build-graph — build or rebuild the graph</li><li>/code-review-graph:review-delta — review changes since last commit</li><li>/code-review-graph:review-pr — full PR review with blast-radius analysis</li></ul><p>For semantic search (find code by meaning, not just name), install the optional embeddings:</p><pre>pip install &quot;code-review-graph[embeddings]&quot;</pre><h3>What’s Next</h3><p>Version 2.0 is focused on three areas:</p><ul><li><strong>Surgical edit suggestions</strong> — auto-fix common patterns based on graph structure</li><li><strong>GitHub PR bot</strong> — automated reviews triggered on pull requests, no Claude Code required</li><li><strong>Team sync</strong> — shared graph via git-tracked database, so the graph builds once per repo, not once per developer</li></ul><h3>The Takeaway</h3><p>AI code review tools are powerful, but they’re wasteful. They treat every file as equally likely to be relevant, which burns tokens and dilutes focus. A structural knowledge graph flips this: instead of reading everything and hoping to find what matters, the AI starts with a precise map of what matters and reads only that.</p><p><strong>6.8x fewer tokens. Higher review quality. Scales to 27,000+ file monorepos.</strong></p><p>The code is open source under MIT license.</p><p><strong>GitHub:</strong> github.com/tirth8205/code-review-graph</p><p><strong>PyPI:</strong> pip install code-review-graph</p><p><em>If you’re building Claude Code plugins or working with MCP servers, I’d love to hear how you’re solving the context-efficiency problem. Drop a comment or open an issue on GitHub.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca73ef078981" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Brain-Computer Interface: How I Decoded Speech from Brain Waves Using Deep Learning]]></title>
            <link>https://tirthkanani18.medium.com/building-a-brain-computer-interface-how-i-decoded-speech-from-brain-waves-using-deep-learning-91fb86074cbf?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/91fb86074cbf</guid>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[eeg-speech-decoding]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[cnn-lstm]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 16:14:24 GMT</pubDate>
            <atom:updated>2025-06-16T16:14:24.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Silent Revolution: When Thoughts Become Words</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NntxCFwG0b18LZaBtDHN7Q.jpeg" /></figure><p>Imagine typing an email, sending a text message, or conversing without moving a muscle or speaking a word. What if the electrical activity in your brain could be directly translated into speech? This isn’t science fiction anymore — it’s the rapidly advancing field of brain-computer interfaces (BCIs), and I recently built my own neural speech decoder to explore this fascinating frontier.</p><h3>The Challenge: Reading Minds with Mathematics</h3><p>Brain-computer interfaces represent one of the most ambitious challenges in neuroscience and artificial intelligence. The human brain generates incredibly complex electrical patterns through billions of neurons firing simultaneously, and extracting meaningful information from this neural “noise” requires sophisticated signal processing and machine learning techniques.</p><p>Speech production involves intricate coordination between multiple brain regions, including Broca’s area for speech formation, Wernicke’s area for language comprehension, and the motor cortex for articulation control. When we think about speaking — even silently — these regions activate in measurable patterns that can be captured through electroencephalography (EEG).</p><h3>My Solution: EEGSpeech — A Hybrid Deep Learning Approach</h3><p>After months of research and development, I created <strong>EEGSpeech</strong>, a brain-computer interface that decodes speech phonemes from EEG signals using a hybrid convolutional neural network and long short-term memory (CNN-LSTM) architecture. The system can classify eight different phonemes (/a/, /e/, /i/, /o/, /u/, /p/, /t/, /k/) with over 92% accuracy .</p><h3>Technical Architecture That Works</h3><p>The core of EEGSpeech is a sophisticated neural network that combines the pattern recognition capabilities of CNNs with the temporal processing power of LSTMs. Here’s how it works:</p><ul><li><strong>Convolutional Layers</strong>: Three CNN layers (32→64→128 filters) extract spatial patterns from the 14-channel EEG data, identifying characteristic brain wave signatures associated with different phonemes.</li><li><strong>LSTM Processing:</strong> Two bidirectional LSTM layers with 256 hidden units capture the temporal dynamics of speech-related brain activity.</li><li><strong>Classification Head:</strong> A final classifier network (512→128→8 neurons) maps the processed features to specific phoneme categories.</li></ul><p>The model contains approximately 1.5 million parameters and processes 500 million floating-point operations per inference, making it computationally efficient enough to run on standard laptops.</p><h3>Data: The Foundation of Learning</h3><p>One of the biggest challenges in BCI research is data acquisition — getting clean, labelled EEG recordings is expensive and time-consuming. I solved this by creating a sophisticated synthetic data generator that mimics real EEG patterns:</p><p><strong>Formant Frequencies</strong>: Each vowel phoneme has characteristic formant frequencies embedded in the synthetic brain wave patterns. For example, the vowel /a/ typically has formants around 800Hz and 1200Hz, which I translated into corresponding EEG oscillations.</p><p><strong>Spatial Distribution</strong>: Different phonemes activate different brain regions, so I programmed channel-specific amplitude modulations that reflect realistic neural activation patterns.</p><p><strong>Noise and Variability</strong>: Real brain signals are noisy and variable, so I added Gaussian noise, time warping, and random phase shifts to make the synthetic data more realistic.</p><p>The system also supports real EEG data in EDF format, processed with 1–50Hz band-pass filtering and segmented into 1-second epochs.</p><h3>Making It Interactive: The Streamlit Dashboard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rXu4TeXf1hJIxI4u.png" /><figcaption>EEGSpeech Streamlit Dashboard - Real-time neural signal visualisation with phoneme prediction interface</figcaption></figure><p>Technical achievements mean nothing if they’re not accessible, so I built an interactive web application using Streamlit that makes the complex technology understandable. The dashboard features:</p><p><strong>Real-time Visualization</strong>: Users can upload EEG files or generate synthetic samples and watch as the neural signals are processed in real-time.</p><p><strong>Topographic Brain Maps</strong>: The interface displays colour-coded scalp maps showing which brain regions are most active during different phoneme classifications.</p><p><strong>Model Interpretability</strong>: When making predictions using Gradient-weighted Class Activation Mapping (Grad-CAM), users can see exactly which parts of the EEG signal the model focuses on.</p><p><strong>Performance Metrics</strong>: Comprehensive accuracy, precision, recall, and F1-score displays help users understand the model’s reliability.</p><h3>Results That Speak for Themselves</h3><p>After training with 5-fold cross-validation, EEGSpeech achieved impressive performance metrics :</p><ul><li><strong>Test Accuracy</strong>: 92.67%</li><li><strong>Precision</strong>: 92.95%</li><li><strong>Recall</strong>: 92.67%</li><li><strong>F1-Score</strong>: 92.53%</li></ul><p>These results demonstrate that the hybrid CNN-LSTM architecture effectively captures spatial and temporal patterns in EEG data for phoneme classification. The model generalises well across different synthetic data variations, suggesting it has learned meaningful representations of speech-related brain activity.</p><h3>Engineering for Scale: Docker and CLI</h3><p>Understanding that reproducibility is crucial for scientific applications, I containerized the entire system using Docker. This ensures that EEGSpeech runs consistently across different operating systems and hardware configurations.</p><p>```bash<br># Train with k-fold cross-validation<br>eegspeech train — epochs 50 — batch-size 32 — lr 0.001 — kfold</p><p># Analyze with model interpretability<br>eegspeech analyze — grad-cam</p><p># Make predictions on new data<br>eegspeech predict — input-file brain_signals.edf<br>```</p><h3>The Bigger Picture: Transforming Lives</h3><p>While my project uses synthetic data, the implications for real-world applications are profound. Brain-computer interfaces for speech decoding could revolutionise communication for people with conditions like ALS, stroke, or spinal cord injuries.</p><p>Recent research has shown that invasive BCIs can achieve remarkable results — scientists have successfully decoded attempted speech from paralysed patients with up to 95% accuracy. Non-invasive approaches like EEGSpeech, while currently less accurate, offer the advantage of not requiring surgery and could become viable assistive technologies as the algorithms improve.</p><h3>Lessons Learned and Future Directions</h3><p>Building EEGSpeech taught me several crucial lessons about the intersection of neuroscience and artificial intelligence :</p><p><strong>Data Quality Matters</strong>: Even sophisticated models can’t overcome poor signal quality — preprocessing and noise reduction are critical for EEG applications.</p><p><strong>Architecture Choices</strong>: Combining CNNs and LSTMs proved essential for capturing spatial brain patterns and temporal speech dynamics.</p><p><strong>Interpretability is Key</strong>: Understanding why a model makes specific predictions is as essential as accuracy for medical applications.</p><p>Looking forward, I’m planning several enhancements:</p><ul><li><strong>Real-time Streaming</strong>: Integration with EEG headsets for live speech decoding</li><li><strong>Expanded Vocabulary</strong>: Moving from phonemes to syllables and complete words</li><li><strong>Transfer Learning</strong>: Adapting the model to individual users’ brain patterns</li></ul><h3>Open Source for Open Science</h3><p>EEGSpeech is freely available on GitHub under the MIT license and is complete with documentation, Docker containers, and example datasets. Advancing brain-computer interface technology requires open collaboration and reproducible research.</p><p>The project has already gained attention from the BCI research community, with researchers downloading and adapting the code for their experiments. This is precisely the kind of knowledge sharing that accelerates scientific progress.</p><h3>Conclusion: The Mind-Machine Future</h3><p>Building EEGSpeech has been an incredible journey into the cutting edge of neurotechnology. While we’re still years away from seamless thought-to-speech communication, projects like this demonstrate that the fundamental challenges are solvable with the right combination of neuroscience knowledge, signal processing techniques, and deep learning architectures.</p><p>The future of brain-computer interfaces is bright, and I’m excited to contribute to a field that could transform how humans interact with technology and, more importantly, help restore communication abilities to those who need it most.</p><p>If you’re interested in exploring the intersection of neuroscience and AI, I encourage you to check out the EEGSpeech project and experiment with decoding your synthetic brain signals. The code is designed to be educational and accessible — because the next breakthrough in brain-computer interfaces might come from an unexpected source.</p><p><em>The EEGSpeech project is available at: </em><a href="https://github.com/tirth8205/EEGSpeech"><em>https://github.com/tirth8205/EEGSpeech</em></a></p><p>If you’re interested in brain-computer interfaces, neuroscience, AI, or assistive technology, follow me for more deep dives and project write-ups.</p><p>🔗 Connect with me<br><a href="https://www.linkedin.com/in/tirthkanani/">LinkedIn</a><br><a href="https://github.com/tirth8205">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91fb86074cbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphMinds: Unlocking Transparent, Secure AI with Knowledge Graphs and LLMs]]></title>
            <link>https://tirthkanani18.medium.com/graphminds-unlocking-transparent-secure-ai-with-knowledge-graphs-and-llms-711b9a7c64b8?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/711b9a7c64b8</guid>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Thu, 29 May 2025 12:36:02 GMT</pubDate>
            <atom:updated>2025-05-29T12:36:02.511Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>~ by Tirth Kanani (<a href="https://www.linkedin.com/in/tirthkanani/">LinkedIn</a>)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQpF9Kp7NBWqSebTHv0Okg.png" /><figcaption><em>*Image generated using Adobe Firefly and Photoshop</em></figcaption></figure><p>Artificial Intelligence is transforming how we process and analyse information, especially when dealing with unstructured data and complex relationships. <strong>GraphMinds</strong> is an open-source project that combines the power of knowledge graphs with large language models (LLMs) to deliver transparent, secure, and insightful AI-driven analysis — while keeping your data private and the reasoning process explainable.</p><h3>What Is GraphMinds?</h3><p>GraphMinds is designed to extract meaningful insights from unstructured documents (like PDFs), where relationships between entities are often hidden or indirect. Unlike many AI tools that depend on cloud infrastructure, GraphMinds runs entirely on your local machine, ensuring sensitive data never leaves your environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WK97CrzUeJ7FNF0vagtGcA.png" /><figcaption>Comparison of Knowledge Graphs Created by a Human, GraphMinds, and ChatGPT-4o Based on a Crime Analysis Document from West Yorkshire</figcaption></figure><h3>How Does GraphMinds Work?</h3><p>At its core, GraphMinds transforms unstructured documents into structured knowledge graphs, enabling both direct and indirect relationship discovery. Here’s how:</p><ol><li><strong>Data Ingestion</strong><br> Users provide PDF files, which are securely loaded and parsed locally.</li><li><strong>Chunking</strong><br> The document is segmented into meaningful “chunks” using semantic and spatial cues. Each chunk represents a coherent unit of information.</li><li><strong>Relationship Extraction</strong><br> Entities and their relationships (edges) are identified within and across these chunks, forming the nodes and edges of the knowledge graph.</li><li><strong>Indirect Relationship Discovery</strong><br> GraphMinds doesn’t stop at direct links. It explores multi-hop paths (up to 3 hops) to find indirect connections — surfacing deeper insights that might otherwise remain hidden.</li><li><strong>Embedding and Similarity Matching</strong><br> Using sentence transformers, the system generates embeddings for each relationship and matches user queries to relevant parts of the graph via cosine similarity.</li><li><strong>LLM Integration</strong><br> Advanced language models (like Zephyr and Mistral, accessed via the Ollama API) generate human-readable answers, leveraging both the graph structure and original document context.</li><li><strong>Interactive Exploration</strong><br> Users can query the knowledge graph interactively — either through a notebook interface or a conversational chat mode — receiving context-rich, explainable answers.</li></ol><h3>Discovering Indirect Relationships: Connecting the Dots</h3><p>A standout feature of GraphMinds is its ability to uncover not just direct, but also <em>indirect</em> relationships between entities.</p><h3>How Indirect Relationships Are Found</h3><p>In knowledge graphs, a direct relationship exists when two entities are connected by a single edge. An indirect relationship connects two nodes through one or more intermediaries. For example, if <strong>A</strong> is linked to <strong>B</strong>, and <strong>B</strong> is linked to <strong>C</strong>, then <strong>A</strong> is indirectly linked to <strong>C</strong> via <strong>B</strong>.</p><p>GraphMinds systematically explores these indirect paths by traversing the graph up to three hops. This mirrors how humans reason through chains of association, revealing connections that are not immediately obvious from the raw text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qetuusFEuPHi5nqzjLNZQQ.png" /><figcaption>See direct and indirect links between entities in GraphMinds. Hover over a node to uncover detailed, context-rich information from your documents.</figcaption></figure><h3>The Role of Chunking</h3><p>Before mapping relationships, GraphMinds performs an initial chunking step. This segmentation:</p><ul><li><strong>Ensures Contextual Precision:</strong> Entities and relationships are tied to specific, meaningful sections of the document.</li><li><strong>Enables Meaningful Edge Labeling:</strong> When building an edge between two nodes (even across multiple hops), GraphMinds refers to the chunks associated with the primary node and the last node. This provides a context-rich label for the relationship.</li></ul><h3>Why Indirect Relationships Matter</h3><p>Indirect connections are critical for deep analysis. In many real-world scenarios, the most valuable insights come from patterns that emerge across multiple pieces of information — not just what is stated outright.</p><p><strong>Examples:</strong></p><ul><li>In investigations, linking a suspect to an event via mutual acquaintances.</li><li>In research, connecting two concepts through a chain of related studies.</li></ul><p>By surfacing these multi-hop relationships, GraphMinds allows users to ask sophisticated questions and receive answers that reflect the true complexity of their data.</p><h3>Key Features at a Glance</h3><ul><li><strong>Graph-Based Relationship Mapping:</strong> Extracts and visualizes both direct and indirect connections.</li><li><strong>Local AI Processing:</strong> All computations occur on your machine, ensuring data confidentiality.</li><li><strong>Embeddings &amp; Similarity:</strong> Matches queries to document content using advanced embedding techniques.</li><li><strong>LLM-Powered Answers:</strong> Generates detailed, natural language responses grounded in the extracted relationships.</li><li><strong>Visualisation:</strong> Uses NetworkX and PyVis for intuitive graph exploration.</li></ul><h3>Technologies Behind the Scenes</h3><ul><li><strong>Sentence Transformers:</strong> For semantic similarity and query matching.</li><li><strong>NetworkX &amp; PyVis:</strong> For graph creation and visualization.</li><li><strong>SciPy:</strong> For efficient similarity computations.</li><li><strong>Ollama Client:</strong> To interface with local LLMs.</li><li><strong>Pandas:</strong> For data manipulation and relationship handling.</li></ul><h3>Getting Started</h3><p>Setting up GraphMinds is straightforward for anyone familiar with Python and Jupyter:</p><ol><li><strong>Clone the Repository</strong> and set up the Conda environment.</li><li><strong>Install Ollama</strong> and download the required LLM models.</li><li><strong>Prepare Your Data</strong> by placing PDFs in the designated folder.</li><li><strong>Run the Jupyter Notebook</strong> to extract the knowledge graph and start querying.</li><li><strong>Interact</strong> via notebook cells or a chat interface for dynamic exploration.</li></ol><h3>A New Paradigm for Knowledge-Intensive Tasks</h3><p>GraphMinds exemplifies the next generation of AI systems — where explainability, security, and depth of analysis are foundational. By bridging the gap between unstructured data and structured reasoning, it empowers users to move beyond black-box AI and toward truly transparent, trustworthy insights.</p><p>Whether you’re a researcher, investigator, or data enthusiast, GraphMinds offers a robust toolkit for making sense of complex information — securely, locally, and with unprecedented clarity.</p><p><em>Project developed by Tirth Kanani under the guidance of Prof. Christopher Baber, University of Birmingham. Licensed under MIT.</em></p><p><strong>Ready to explore deeper insights from your data?</strong><br> Check out the <a href="https://github.com/tirth8205/GraphMinds">GraphMinds GitHub repository</a> and get started today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=711b9a7c64b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Rule — Based Algorithms to Agentic AI: How Automation Got Smart]]></title>
            <link>https://tirthkanani18.medium.com/from-rule-based-algorithms-to-agentic-ai-how-automation-got-smart-9b232d839a6e?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b232d839a6e</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Thu, 08 May 2025 20:51:53 GMT</pubDate>
            <atom:updated>2025-05-08T20:51:53.561Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Rule — Based Algorithms to Agentic AI: How Automation Got Smart</h3><p>Picture yourself opening Google Maps to find the fastest way to a new restaurant. You type in the address, and boom — a route shows up on your screen. Nobody at Google is sitting there mapping it out for you. It’s all done by software working behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sStb0p7_3hKhURW7LIJQFA.png" /><figcaption>Rule-Based Automation: The Dawn of Tech Solutions<br> Image generated using AI</figcaption></figure><p>The same thing happens with your email. When a shady “win a free vacation” message lands in your spam folder, it’s not because someone at Gmail caught it. Special programs spot those emails and sort them out.</p><p>For a long time, these kinds of tools ran our digital world. They were good at their jobs — Google Maps got you places, spam filters cleaned your inbox — but they could only do one thing. They couldn’t learn new tricks or handle tasks outside their programming.</p><h3>When AI Learned to Talk</h3><p>Then came a big change. Tools called Large Language Models (LLMs), like GPT-4 or Google’s Gemini, showed up. These weren’t just following strict rules. They learned from billions of words in books, websites, and more.</p><p>What could they do? A lot. They could answer questions, write stories, translate languages, and even help fix code — all by chatting in plain English. Research says the LLM market was worth $7.77 billion in 2025 and growing fast, about 36% every year (<a href="https://www.precedenceresearch.com/large-language-model-market">Precedence Research</a>).</p><p>These tools also made everyday stuff better. For example, they cut down mistakes in email spam filters by 30%, so fewer important messages got lost (<a href="https://ai.googleblog.com/2020/07/ai-powered-spam-detection-in-gmail.html">Google AI Blog</a>).</p><p>But they had limits. They only knew stuff up to a certain point — like GPT-4, which stopped learning after certain date. They couldn’t do things on their own or check for new info without someone helping them connect to the internet.</p><h3>Meet Agentic AI: The Do-It-All Helper</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pc13Ggw70rbOltz7pk16hg.png" /><figcaption>From Automation to Intelligence: Tracing AI’s Evolution<br> Image generated using AI</figcaption></figure><p>Now we’re in the age of Agentic AI. These aren’t just chatty tools — they’re like digital assistants that think, decide, and act without being told what to do every step of the way.</p><p>Imagine an AI that sees traffic slowing down on your way to a meeting. Instead of just warning you, it suggests a better time to leave, books a ride, and even sends a note to your team if you’re running late. Or think of a hospital AI that watches patient data, checks the latest medical studies, and alerts doctors if something’s off — all by itself.</p><p>Agentic AI is changing how industries work. In customer service, these AIs handle up to 70% of questions on their own, giving quick answers and letting human workers focus on trickier problems. In cybersecurity, they spot hackers 40% faster by constantly checking network activity for anything odd. Supply chains are getting smarter too, with AI managing inventory and logistics to save money.</p><p>Beyond these, Agentic AI is making waves in other fields. In healthcare, it’s helping with drug discovery by sifting through huge datasets to find promising compounds and even planning experiments. In manufacturing, it runs entire production lines, from ordering materials to adjusting schedules when something changes. In IT, Agentic AI tackles common issues like password resets or software access, learning from past problems to fix new ones faster (<a href="https://www.techtarget.com/searchenterpriseai/feature/Real-world-agentic-AI-examples-and-use-cases">TechTarget</a>).</p><p>This tech is taking off. Experts say the Agentic AI market will jump from $7.84 billion in 2025 to over $52 billion by 2030 (<a href="https://www.marketsandmarkets.com/Market-Reports/autonomous-agents-market-23800802.html">MarketsandMarkets</a>). In places like India, four out of five companies are already trying it out.</p><h3>How It’s Changing Things</h3><p>Agentic AI is already making a difference in the real world:</p><ul><li><strong>Customer Service:</strong> These AIs handle 70% of customer questions on their own, answering in seconds instead of hours (<a href="https://www.ibm.com/watson/resources/ai-adoption-index">IBM Global AI Adoption Index 2023</a>).</li><li><strong>Cybersecurity:</strong> They spot hackers 40% faster by scanning tons of data for anything suspicious (<a href="https://www.gartner.com/en/information-technology/insights/artificial-intelligence">Gartner</a>).</li><li><strong>Supply Chains:</strong> Businesses save 22% on inventory costs because AI predicts what they’ll need and orders it automatically (<a href="https://www.mckinsey.com/capabilities/operations/our-insights/supply-chain-40--the-next-generation-digital-supply-chain">McKinsey &amp; Company</a>).</li><li><strong>Healthcare:</strong> AI aids drug discovery by analysing data and suggesting new compounds, speeding up research (<a href="https://www.techtarget.com/searchenterpriseai/feature/Real-world-agentic-AI-examples-and-use-cases">TechTarget</a>).</li><li><strong>Manufacturing:</strong> AI manages production from start to finish, adapting to supply issues or demand changes (<a href="https://www.techtarget.com/searchenterpriseai/feature/Real-world-agentic-AI-examples-and-use-cases">TechTarget</a>).</li></ul><h3>What’s Next?</h3><p>Agentic AI isn’t perfect. Some worry it might make mistakes, like being unfair or hard to understand, especially in important areas like hospitals or courts. About one in three companies say they’re concerned about AI acting in weird ways (<a href="https://www2.deloitte.com/us/en/insights/focus/cognitive-technologies/state-of-ai-and-intelligent-automation-in-business-survey.html">Deloitte State of AI in the Enterprise</a>).</p><p>Still, the possibilities are huge. We’re moving from tools that just follow orders to ones that think ahead and act before we even ask.</p><p>Looking further ahead, AI’s evolution won’t stop here. One exciting direction is multi-agent systems, where several AI agents work together or even compete to tackle bigger challenges. Picture a smart city where one AI manages traffic, another handles energy use, and a third oversees public services — all coordinating to make life smoother (<a href="https://www.salesforce.com/blog/the-agentic-ai-era-after-the-dawn-heres-what-to-expect/">Salesforce</a>).</p><p>Beyond that, many experts are aiming for Artificial General Intelligence (AGI) — AI that can do any task a human can, from solving math problems to writing novels. AGI could transform everything, like speeding up medical breakthroughs or rethinking how economies work. But it comes with big questions, like how to make sure it’s safe and fair. Researchers are already working on rules and safety measures to keep AGI in check (<a href="https://deepmind.google/discover/blog/taking-a-responsible-path-to-agi/">Google DeepMind</a>).</p><p>As we head toward these advanced AIs, we’ll need strong plans to make sure they help everyone and don’t cause harm. It’s a big challenge, but also a chance to build a future where AI makes life better for all.</p><h3>Wrapping Up</h3><p>The story from Google Maps to Agentic AI shows how far we’ve come. Early tools were great at one job. LLMs made AI talk and think across many tasks. Now, Agentic AI is like a partner that plans, acts, and learns on its own.</p><p>As this tech grows, it’ll change how we work and live — making things faster, smarter, and a bit more like having a helpful friend who’s always one step ahead.</p><p><strong>References:</strong></p><ul><li><a href="https://www.precedenceresearch.com/large-language-model-market">Precedence Research: Large Language Model Market Size</a></li><li><a href="https://ai.googleblog.com/2020/07/ai-powered-spam-detection-in-gmail.html">Google AI Blog: AI-powered Spam Detection in Gmail</a></li><li><a href="https://www.marketsandmarkets.com/Market-Reports/autonomous-agents-market-23800802.html">MarketsandMarkets: Autonomous Agent Market</a></li><li><a href="https://www.ibm.com/watson/resources/ai-adoption-index">IBM Global AI Adoption Index 2023</a></li><li><a href="https://www.gartner.com/en/information-technology/insights/artificial-intelligence">Gartner: AI in Cybersecurity</a></li><li><a href="https://www.mckinsey.com/capabilities/operations/our-insights/supply-chain-40--the-next-generation-digital-supply-chain">McKinsey: Supply Chain 4.0</a></li><li><a href="https://www2.deloitte.com/us/en/insights/focus/cognitive-technologies/state-of-ai-and-intelligent-automation-in-business-survey.html">Deloitte: State of AI in the Enterprise</a></li><li><a href="https://www.techtarget.com/searchenterpriseai/feature/Real-world-agentic-AI-examples-and-use-cases">TechTarget: Real-world Agentic AI Examples</a></li><li><a href="https://www.salesforce.com/blog/the-agentic-ai-era-after-the-dawn-heres-what-to-expect/">Salesforce: The Agentic AI Era</a></li><li><a href="https://deepmind.google/discover/blog/taking-a-responsible-path-to-agi/">Google DeepMind: Taking a Responsible Path to AGI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b232d839a6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ResearchWebGraph: My Journey Building an AI-Powered Research Tool]]></title>
            <link>https://tirthkanani18.medium.com/researchwebgraph-my-journey-building-an-ai-powered-research-tool-3647b613dfa0?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/3647b613dfa0</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Mon, 05 May 2025 23:20:28 GMT</pubDate>
            <atom:updated>2025-05-05T23:22:53.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hxd7xMC_Ud2XbWqqkNHow.png" /></figure><p><em>By Tirth Kanani | #OpenToWork in AI/ML and Software Development</em></p><h3>Hey There!</h3><p>I’m Tirth, a developer who loves diving into AI and coding projects. One of my latest creations is <strong>ResearchWebGraph</strong>, a tool I built to make exploring academic papers easier and more insightful. If you’ve ever felt lost in the sea of research papers, this project is my attempt to help. It uses AI to search papers, build knowledge graphs, and answer questions — all in one place.</p><p>In this post, I’ll share why I created ResearchWebGraph, how it works, the tech behind it, and what I learned while building it. I’ve included screenshots and a demo video to show it in action. Whether you’re a researcher, a fellow developer, or a recruiter looking for AI/ML talent, I hope you find this interesting!</p><h3>Why I Built ResearchWebGraph</h3><p>As someone who’s spent hours digging through papers for AI and machine learning projects, I know how frustrating it can be. Tools like arXiv or Google Scholar are great for finding papers, but they don’t help you:</p><ul><li><strong>See connections</strong>: How do ideas in one paper relate to another?</li><li><strong>Get quick answers</strong>: What are the key findings without reading 30 pages?</li><li><strong>Visualize ideas</strong>: Can I see a map of concepts like models or datasets?</li></ul><p>I wanted a tool that acts like a research buddy — something that pulls papers, maps out their ideas, and answers my questions. That’s where ResearchWebGraph comes in. I built it to solve these problems and to challenge myself to work with cool tech like AI models, vector search, and web development.</p><p>This project was also personal. I’m passionate about AI and coding, and I wanted to create something that shows what I can do while helping others. Plus, it’s a chance to grow my skills for the AI/ML and Software Development roles I’m currently seeking.</p><h3>What’s ResearchWebGraph?</h3><p>ResearchWebGraph is a web app I created to help you explore and understand academic papers. It’s open-source, so anyone can use or contribute to it. You can find it on GitHub (<a href="https://github.com/tirth8205/ResearchWebGraph">tirth8205/ResearchWebGraph</a>), along with setup instructions and a <a href="https://drive.google.com/file/d/1Wa34el4getUQwoouBCecJbF06ahPOKuO/view?usp=sharing">demo video</a>.</p><p>Here’s what it does:</p><ol><li><strong>Search Papers</strong>: Find papers on arXiv by keywords or filters.</li><li><strong>Upload PDFs</strong>: Add your own papers for analysis.</li><li><strong>Build Knowledge Graphs</strong>: See connections between ideas in a visual graph.</li><li><strong>Ask Questions</strong>: Get clear answers about papers with citations.</li></ol><h3>How It Works: Features and Screenshots</h3><p>Let me walk you through the features and show you what ResearchWebGraph looks like.</p><h3>1. Home Interface</h3><p>When you open the app, you get a simple, welcoming homepage that guides you to search, upload, or explore graphs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zJMPW7fKpAO_h018.png" /></figure><h3>2. Paper Search</h3><p>You can search arXiv for papers using keywords, dates, or categories like Computer Science. I built the backend with FastAPI to make it fast and reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OL7kmEmmiEt-hBVq.png" /></figure><p><em>Example</em>: Type “large language models” and filter for 2025 papers to see what’s new.</p><h3>3. PDF Upload</h3><p>Got a paper that’s not on arXiv? No problem. You can upload PDFs, and the app extracts text using tools like PyPDF2 and PDFMiner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bdKuOi5BIUf_sbHm.png" /></figure><p><em>Why I added this</em>: Researchers often have their own files, and I wanted the tool to be flexible.</p><h3>4. Knowledge Graphs</h3><p>This is my favorite part! The app uses spaCy and NLTK to pull out key ideas (like models or datasets) and their relationships, then shows them in an interactive graph via Streamlit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MKDHrQSIlDg9A3zH.png" /></figure><p><em>Use case</em>: If you’re researching neural networks, you can see how different models and techniques connect across papers. Here are more graph examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2M4XXduyLuOO2QAB.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*936NRMJed9ni3QIr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vjtwKblc2YRWbuxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9hPQZYnL95VPL1vc.png" /></figure><h3>5. Query Assistant</h3><p>Want to know something specific about a paper? Ask the query assistant! It uses the Groq API (with models like llama-3.1-8b-instant) and Qdrant for vector search to give you answers with citations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lXfjutVMSGmwOem1.png" /></figure><p><em>Example</em>: Ask, “What are the main findings of this graph neural network paper?” and get a clear summary.</p><p>Want to see it in action? Check out the <a href="https://drive.google.com/file/d/1Wa34el4getUQwoouBCecJbF06ahPOKuO/view?usp=sharing">demo video</a>!</p><h3>The Tech Behind It</h3><p>I built ResearchWebGraph using a mix of AI and web development tools. Here’s what powers it:</p><h3>Backend</h3><ul><li><strong>FastAPI</strong>: Runs the API for searching, uploading, and querying.</li><li><strong>Qdrant</strong>: Stores text embeddings for fast, semantic search.</li><li><strong>SentenceTransformers</strong>: Turns text into vectors for similarity search.</li><li><strong>PyPDF2 &amp; PDFMiner</strong>: Pulls text and metadata from PDFs.</li><li><strong>spaCy &amp; NLTK</strong>: Handles entity extraction and text processing.</li></ul><h3>Frontend</h3><ul><li><strong>Streamlit</strong>: Makes the app interactive and easy to use.</li><li><strong>streamlit-option-menu</strong>: Adds smooth navigation between features.</li></ul><h3>AI</h3><ul><li><strong>Groq API</strong>: Powers the query assistant with LLMs like llama-3.1-8b-instant.</li></ul><p>This mix of tools shows my love for building full-stack apps with AI, something I’m excited to do in future AI/ML and Software Development roles.</p><h3>My Journey Building It</h3><p>Working on ResearchWebGraph was a wild ride. Here’s what stood out:</p><ol><li><strong>Diving into Vector Search</strong>: I’d never used Qdrant before, so learning to store and search text embeddings was a big win.</li><li><strong>Making Graphs Come Alive</strong>: Figuring out how to extract entities and show them as interactive graphs took a lot of trial and error.</li><li><strong>Using LLMs</strong>: Integrating the Groq API taught me how to craft prompts and handle big chunks of text.</li><li><strong>Improving the UI</strong>: Early versions of the app were rough, but feedback from friends and GitHub users helped me make the Streamlit interface better.</li></ol><p>I hit some bumps, like dealing with huge PDF files (fixed with Git LFS) and speeding up searches. Solving these problems made me a better developer.</p><h3>Why I Made It Open Source</h3><p>I decided to share ResearchWebGraph under the MIT License because I believe in giving back. By making it open source, I hope others will:</p><ul><li>Use it for their research.</li><li>Suggest improvements or add features.</li><li>Learn from the code, like I did while building it.</li></ul><p>You can check out the GitHub repo (<a href="https://github.com/tirth8205/ResearchWebGraph">tirth8205/ResearchWebGraph</a>) and join the <a href="https://github.com/tirth8205/ResearchWebGraph/discussions">Discussions page</a> to share ideas or ask questions.</p><h3>What’s Next?</h3><p>I’m not done with ResearchWebGraph yet! Here’s what I want to add:</p><ul><li><strong>Better Graphs</strong>: Let users filter graphs or dive deeper into connections.</li><li><strong>More Paper Sources</strong>: Pull from PubMed or IEEE, not just arXiv.</li><li><strong>Smarter Queries</strong>: Make the assistant’s answers even more accurate.</li><li><strong>Mobile Version</strong>: Build a frontend that works on phones.</li></ul><p>I’d love to team up with others on this, so if you’re into AI or research tools, let’s talk!</p><h3>#OpenToWork: What Drives Me</h3><p>ResearchWebGraph is a big part of who I am as a developer. I love using AI to solve real problems, and this project shows what I can do:</p><ul><li><strong>AI/ML</strong>: Building NLP, vector search, and LLM features.</li><li><strong>Software Development</strong>: Creating a full-stack app with FastAPI and Streamlit.</li><li><strong>Problem-Solving</strong>: Tackling tricky issues like file management and UI design.</li></ul><p>I’m currently <strong>#OpenToWork</strong> in AI/ML and Software Development roles, where I can keep building cool stuff. If you’re hiring or know of opportunities, hit me up on <a href="https://www.linkedin.com/in/tirthkanani/">LinkedIn</a> or email (<a href="/service/mailto:tirthkanani18@gmail.com">tirthkanani18@gmail.com</a>).</p><h3>Wrapping Up</h3><p>ResearchWebGraph is more than just a project — it’s my way of making research easier and showing what I’m capable of. I had a blast building it, and I hope it helps researchers and developers like you. Please:</p><ul><li>Check out the <a href="https://github.com/tirth8205/ResearchWebGraph">GitHub repo</a>.</li><li>Watch the <a href="https://drive.google.com/file/d/1Wa34el4getUQwoouBCecJbF06ahPOKuO/view?usp=sharing">demo video</a>.</li><li>Join the <a href="https://github.com/tirth8205/ResearchWebGraph/discussions">Discussions page</a>.</li><li>Connect on <a href="https://www.linkedin.com/in/tirthkanani/">LinkedIn</a>.</li></ul><p>Thanks for reading! Let me know what you think about ResearchWebGraph.</p><p><em>Follow me on </em><a href="https://medium.com/@tirthkanani18"><em>Medium</em></a><em> for more posts about AI and coding. If you liked this, give it a clap 👏 or share it!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3647b613dfa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey into AI and Cognitive Research: Chasing the Code of the Human Mind]]></title>
            <link>https://tirthkanani18.medium.com/my-journey-into-ai-and-cognitive-research-chasing-the-code-of-the-human-mind-4b391a9c65c1?source=rss-5b9aafae0030------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b391a9c65c1</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cognitive-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Tirth Kanani]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 17:02:36 GMT</pubDate>
            <atom:updated>2025-04-30T17:02:36.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o25FsSVzXqZFUxQpTSJDOQ.jpeg" /><figcaption>Coding in action!</figcaption></figure><p>Hey there, I’m Tirth Kanani, an AI/ML engineer and researcher who’s obsessed with figuring out how our minds tick through code. I spend my days diving into artificial intelligence, natural language processing (NLP), and cognitive research, trying to bridge the gap between tech and human thought. I’m kicking off my Medium journey to share my experiences, ideas, and passion for this field. Let’s get started with why I’m so hooked on AI and where this adventure began.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8e2quvCn-PImVqKTt3SZDg.jpeg" /></figure><p>Growing up in India, I was always curious about how things worked — especially the human brain. That curiosity turned into a full-blown passion during my Bachelor’s in Computer Science at Ahmedabad University. Classes like Machine Learning and NLP opened my eyes to how code could mimic language or unravel thought patterns. I’d stay up late, piecing together Python scripts, amazed that a few lines could start to “understand” human behavior. That thrill pushed me to pursue a Master’s in Computer Science at the University of Birmingham, UK, where I graduated with distinction in 2024, diving deep into Human-Computer Interaction.</p><p>One moment that stands out is my first time grappling with a neural network. It was messy, but seeing it learn even a tiny bit felt like cracking a code to the mind. That’s when I knew I wanted to use AI to explore how we think, communicate, and learn.</p><h3>Why AI and Cognitive Research Light Me Up?</h3><p>I’m fascinated by AI’s power to reveal what makes us human. It’s not just about building smart systems — it’s about asking big questions, like how we process language or make decisions. My work, whether tinkering with Python or wrestling with frameworks like PyTorch, is all about creating tools that help us understand cognition better. I also care about making AI ethical and approachable, so it doesn’t just sit in a lab but actually helps people, from researchers to everyday users.</p><p>Birmingham sharpened this passion. Working as a Research Associate there, I saw firsthand how AI could tackle real-world challenges, blending tech with human insight. It’s why I’m committed to building systems that are both powerful and fair, sparking curiosity along the way.</p><h3>Bouncing Back from Challenges</h3><p>Learning AI wasn’t always easy. I’d often run into problems with my code — like nonstop errors in PyTorch or models that wouldn’t work. One night, I spent hours trying to fix something, only to figure out I’d messed up a basic data step. What a frustrating moment! Another time, I struggled with TensorFlow while trying to train a model during my Master’s at Birmingham. I kept getting memory errors because I didn’t understand how to manage large datasets back then. I’d sit there, staring at my screen, feeling stuck. But those mistakes taught me to keep trying, test better, and stick with it. I learned to break problems into smaller pieces and search for answers online — like finding the right way to batch my data. Every error showed me something new, and they’ve made me a stronger coder and a more eager learner.</p><h3>What’s Next on Medium</h3><p>This is just the beginning. Down the road, I’ll share stories from my work, tips for coding AI, and thoughts on where this field’s headed. Whether you’re a tech geek or just curious about the brain, I hope you’ll find something here that clicks. Expect posts on everything from NLP tricks to keeping AI human-centered.</p><p>Drop by my <a href="https://github.com/tirth8205">GitHub</a> to see what I’m coding or hit me up on <a href="https://www.linkedin.com/in/tirthkanani/">LinkedIn</a> to chat about AI and cognition. I’m stoked to connect.</p><h3>Let’s Swap Ideas</h3><p>What’s got you curious about AI or the mind? Got a question about blending tech with human behaviour? Toss a comment below — I’d love to hear from you. Here’s to chasing the code behind how we think, one post at a time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b391a9c65c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>