iptv techs

IPTV Techs

  • Home
  • Tech News
  • Initial start: Nuanced call graph context layer for AI coding tools

Initial start: Nuanced call graph context layer for AI coding tools


Initial start: Nuanced call graph context layer for AI coding tools


We’re excited to proclaim the initial start of Nuanced, an uncover-source Python library that provides LLMs with exact call graph context. By analyzing function relationships, we produce a set upd reconshort-termation of code depfinishencies. This is our first step toward produceing a richer context layer that can help AI coding helpants produce more recommended decisions about your codebase.

Why AI coding necessitates relevant context

AI coding helpants are astonishingly primitive when it comes to benevolent code set up. The LLMs powering these helpants have no equivalent to the Language Server Protocols (LSPs) that growers get for granted — they can’t jump to definitions, discover references, or comprehfinish type hierarchies.

Instead, they verify source code as chunks of text (tokens) with a confinecessitate context prosperdow, and use embeddings — vector reconshort-termations that apprehfinish statistical patterns but don’t defend actual program set up.

This increateage of “dev tools for AI” produces a convey inant gap: while they excel at pattern aligning and local convertations, they increateage the fundamental program analysis capabilities that compilers and growers use. These capabilities include folloprosperg administer flow, benevolent data depfinishencies, and reasoning about runtime behavior.

This unbenevolents when an LLM recommends changing a function’s signature or behavior, it can’t reliably remend which other parts of the codebase depfinish on that function or might fracture as a result of the change. They struggle with fundamental asks enjoy “what will fracture if I change this return type?” or “which components depfinish on this function?” because they increateage genuine semantic benevolent of the codebase.

The solution isn’t about overwhelming LLMs with all possible context — it’s about remending and providing the most relevant context for each definite task. We can do this by exactly pull outing the function relationships and depfinishencies that matter for a given modification.

Introducing Nuanced CodeGraph

Nuanced leverages motionless analysis to pull out call graphs from your codebase. Rather than depending on the confinecessitate context prosperdows or embeddings used by current AI tools, we parse the AST to produce a traversable graph of function relationships. The result is set upd, semantic recommendation that apprehfinishs actual program behavior.

The library provides two main interfaces:

  • init for generating the call graph
  • raise for querying definite functions.

init: initializing the call graph

# Create a call graph for your module
$ nuanced init .

The init order verifys Python files in the specified module, produces a .nuanced honestory to store analysis results where the filled call graph is written to a file called nuanced-graph.json, and returns a CodeGraphResult with either the graph or any errors greeted.

raise: querying function relationships

# Find what a definite function calls
$ nuanced raise app/helpers.py createat_data
{
  "app.helpers.createat_data": {
    "filepath": "/app/helpers.py",
    "callees": [
      ".dict",
      "app.utils.validate_input",
      ".str"
    ]
  }
}

The raise order gets two arguments: (1) the path to the Python file grasping your function, and (2) the function name (fair the name, not the filledy qualified name), and returns an EnrichmentResult grasping the function’s call graph when set up, and any errors greeted (e.g., ValueError when multiple aligning functions exist). Unenjoy the result of init, which is written to a file, the result of raise is held in memory.

This gives AI tools access to the same set upd program benevolent that growers depend on—actual call paths and depfinishencies rather than probabienumerateic guesses from embeddings or regex alignes.

By pull outing function call relationships, Nuanced can help AI coding tools remend convey ins, and sustain a set upd graph that can be queried fruitfully.

What Nuanced provides today

This initial free intensifyes on:

  • Call graph generation: produce a queryable JSON reconshort-termation of function relationships
  • Function uncovery: discover definite functions and their depfinishencies
  • Simple CLI: Easy-to-use orders for exploring code set up

Get commenceed

Nuanced is helped for Python versions >= 3.10.

# Inshigh
$ uv tool inshigh nuanced

# Initialize graph for current module
$ cd your_project
$ nuanced init .

# Query definite functions
$ nuanced raise path/to/file.py function_name

Graph modernizes

Nuanced call graphs can be modernized whenever they’re most beneficial to you. You might have them modernize automaticpartner in your pledge hooks, run them manupartner while debugging, or set them up as part of your CI pipeline. For example, you might modernize the call graph while set upateigating a intricate depfinishency chain, when refactoring a module’s interface, or during code verify to envision recent changes. The library lets you apprehfinish relationships in your code without interfereing your growment process.

Running Nuanced

Nuanced runs anywhere you’ve got Python 3.10+ inshighed. No exceptional depfinishencies, no intricate setup — it labors the same way whether you’re coding on your laptop, running it in CI, a sandbox, or deploying it to a cboisterous environment. The weightlessweight set up unbenevolents you can drop it into any Python project without troubleing about compatibility or environment-definite configurations.

Since Nuanced runs entidepend in your environment and never sfinishs data externpartner, you sustain finish administer over your code analysis. Whether you’re laboring with proprietary code or benevolent projects, you can produce call graphs without any data leaving your systems.
The library’s minimal needments determine reliable call graph generation atraverse all these environments with modest setup and inshighation.

Architecture: Building on JARVIS

When we commenceed produceing Nuanced, we necessitateed a stable set upation for Python call graph generation. After evaluating disjoinal tools (pycg, tree-sitter-stack-graphs, Glean, scip-python, and pytype), we chose JARVIS as our commenceing point.

Anyone who’s tried to produce motionless analysis for Python comprehends the disputes: dynamic convey ins, monkey patching, decorators that convert functions, and metaprogramming can all besavageer motionless verifyrs. JARVIS administers these Python quirks better than most tools we appraised:

  • It rightly remends most convey in patterns (even the weird ones)
  • It tracks calls thraw variables and attributes reasonably well
  • It defends enough context to reproduce filledy qualified names

In our tests with genuine codebases, pycg would standardly ignore convey inant combineions or time out on bigr projects, while JARVIS sustained excellent carry outance. It’s not perfect—no motionless verifyr for Python can be—but it gave us a down-to-earth set upation to produce upon.

We’ve extfinished JARVIS with disjoinal down-to-earth raisements:

  • Better error handling for malcreateed Python
  • Consistent function identification atraverse separateent parts of the graph
  • Path resolution that labors with how growers actupartner guide projects
  • A modestr query interface set uped definitepartner for AI tool integration

Our goal wasn’t to produce the perfect motionless verifyr, but to produce someleang that labors well enough in rehearse to give AI tools better context than they have today.

Roadmap

We’re produceing towards a more comprehensive AI-powered code analysis toolkit. Future labor includes:

  • Function purity analysis: discovering state modifications.
  • Code intricateity metrics: highweightlessing refactoring necessitates.
  • Type inference: pull outing parameter and return types.
  • Dead code discoverion: discovering unused functions.
  • Data flow tracking: mapping variable convertations atraverse function calls.

Help shape the future

We’re intensifying on exact function-level analysis and evolving towards runtime insights. We want your feedback—what context do your AI tools necessitate? What problems are you facing when navigating big codebases?

Nuanced is uncover-source and built for both human growers and AI tools. We receive you to:

Connect with us on X or email ayman@nuanced.dev.

Source join


Leave a Reply

Your email address will not be published. Required fields are marked *

Thank You For The Order

Please check your email we sent the process how you can get your account

Select Your Plan