Tech Tip #40: Give your AI assistant structure, not raw files

Pasting whole files into an AI wastes tokens and accuracy.

Video created by explainapaper.com

The problem

Assistants fed whole files or text-chunk search spend tokens reading code that is irrelevant and still miss how the parts connect.

The fix you can use today

  • Retrieve only the functions and files relevant to the task.
  • Use structure-aware retrieval (call graphs, symbols) rather than plain text chunks.
  • Keep prompts and context as short as the task allows.

GreenCode researchers found that a map of the code helped AI find the right parts better than plain text search.

Tools that help

  • GreenCode Constitution skill (GreenCode researchers): open-source energy principles and a catalogue of 37 energy anti-patterns that an AI coding agent can follow to find and fix waste like this

How GreenCode helps

GreenCode helps tackle this by giving its own AI only the code a task needs, retrieved from a searchable map of every interface in the codebase. Its models are small and fine-tuned, and each request goes to the smallest capable component. More on this.

Tags

#llm#ai-assistants#legacy

Sources

All GreenCode Tech Tips

  • Tip #40
  • For Developers
  • Category AI and machine learning
  • Format short video
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch