Improving ChatGPT for Large Projects

Improving ChatGPT for Large Projects:

Hi Everyone,

I love using ChatGPT, but I’ve noticed that when working on large projects—especially with programming—ChatGPT often forgets earlier parts of the code during long conversations. This means I have to keep copying and pasting code and re-explaining the project, which is frustrating.

The Problem: ChatGPT struggles with large projects because it can’t hold onto big amounts of information like project structures, multiple files, and lots of code. This is a specific challenge for developers but could help others managing large projects too.

Solution:

  • A temporary memory workspace where we can upload project folders, files, and code. ChatGPT could reference these throughout the session, keeping the context intact.
  • Memory Issues: In long chats, ChatGPT forgets earlier details. Expanding the context window or using a system like Redis to store and retrieve relevant parts of the conversation could solve this.

This feature could be available in the paid version and would make ChatGPT way more useful for big projects.

what do you guys think ?

If you are not working with a specific function/method then try just using the signature/prototype of that function/method. This often vastly reduces the amount of information that the model needs to hold.

The idea of using function or method signatures isn’t just about code; it’s also about managing the information related to an entire project. When dealing with a large project, especially when debugging or addressing issues realted to the code or performing unit testing, the conversation with ChatGPT can become long and complex. As the conversation continues, ChatGPT may start to forget earlier details, whether it’s about the code or even important context like project structure, dependencies, or previous decisions.

Have you tried to use OpenAI canvas?

Yes it is in beta and has many issues/wrinkles but some of us are giving it a try and learning how to be more effective with it when coding.

I have experienced a similar problem when I try to use GPT 4o to write code. It forgets important details about the project and misconstrues variable types in Python. It’s almost useless, but by correcting it I am learning how to code. Here is an example of some code it wrote:(demokit-env) gross@Glendons-Mac-mini modules % cat gui_tkinter.py
import tkinter as tk
from tkinter import ttk, messagebox, simpledialog
import tkinter.scrolledtext as scrolledtext

class DemoKitGUI(tk.Tk):
def init(self, processor):
super().init()
self.title(“Engelbart Demo Kit”)
self.geometry(“1000x600”)
self.processor = processor
self.docs =
self.current_doc_id = None

    self._create_widgets()
    self._create_menu()
    self._refresh_sidebar()

def _create_widgets(self):
    self.sidebar = ttk.Treeview(self)
    self.sidebar.heading('#0', text='Documents')
    self.sidebar.bind("<<TreeviewSelect>>", self._on_select)
    self.sidebar.pack(side="left", fill="y")

    self.text = scrolledtext.ScrolledText(self, wrap=tk.WORD, undo=True)
    self.text.pack(expand=True, fill="both")

    self.text.bind("<Button-3>", self._show_context_menu)
    self.context_menu = tk.Menu(self, tearoff=0)
    self.context_menu.add_command(label="Ask", command=self.ask_ai_text)
    self.context_menu.add_command(label="Link", command=self.link_ai_context)

def _create_menu(self):
    menubar = tk.Menu(self)
    self.config(menu=menubar)
    settings_menu = tk.Menu(menubar, tearoff=0)
    menubar.add_cascade(label="Settings", menu=settings_menu)
    settings_menu.add_command(label="Set API Key", command=self.set_api_key)

def set_api_key(self):
    key = simpledialog.askstring("API Key", "Enter your OpenAI API key:", show='*')
    if key:
        self.processor.set_api_key(key)
        messagebox.showinfo("API Key Set", "Your OpenAI API key was saved!")

def _refresh_sidebar(self):
    for item in self.sidebar.get_children():
        self.sidebar.delete(item)

    self.docs = self.processor.doc_store.list_documents()
    for doc_id, title in self.docs:
        self.sidebar.insert('', 'end', iid=doc_id, text=title)

def _on_select(self, event):
    selected = self.sidebar.selection()
    if selected:
        doc_id = selected[0]
        content = self.processor.doc_store.get_document_body(int(doc_id))
        self.text.delete("1.0", tk.END)
        self.text.insert(tk.END, content)
        self.current_doc_id = int(doc_id)
        self._refresh_links(content)

def _show_context_menu(self, event):
    try:
        self.context_menu.tk_popup(event.x_root, event.y_root)
    finally:
        self.context_menu.grab_release()

def ask_ai_text(self):
    if not self.processor.has_api_key():
        messagebox.showwarning("API Key Not Set", "Please set your OpenAI API key first (Settings → Set API Key).")
        return
    try:
        selected_text = self.text.selection_get()
        if selected_text:
            response = self.processor.ask(selected_text)
            if response:
                new_id = self.processor.doc_store.new_document("AI Response", body=response)
                start = self.text.index(tk.SEL_FIRST)
                end = self.text.index(tk.SEL_LAST)
                link_text = f"[AI→Doc {new_id}]"
                self.text.delete(start, end)
                self.text.insert(start, link_text)
                self.text.tag_add(f"link_{new_id}", start, f"{start} + {len(link_text)}c")
                self.text.tag_config(f"link_{new_id}", foreground="blue", underline=1)
                self.text.tag_bind(f"link_{new_id}", "<Button-1>", lambda e, doc_id=new_id: self._open_linked_doc(doc_id))
                self._refresh_sidebar()
                messagebox.showinfo("AI Response", f"[AI Response]: {response}")
    except tk.TclError:
        messagebox.showinfo("Selection Error", "Please select text to query.")

def _open_linked_doc(self, doc_id):
    content = self.processor.doc_store.get_document_body(int(doc_id))
    self.text.delete("1.0", tk.END)
    self.text.insert(tk.END, content)
    self.current_doc_id = int(doc_id)
    self._refresh_links(content)

def _refresh_links(self, content=None):
    if content is None:
        content = self.text.get("1.0", tk.END)
    self.text.tag_remove("link", "1.0", tk.END)
    idx = "1.0"
    while True:
        idx = self.text.search(r"\[AI→Doc (\d+)\]", idx, tk.END, regexp=True)
        if not idx:
            break
        end_idx = f"{idx}+13c"  # [AI→Doc NNNN] is always 13 chars if doc_id is 4 digits, so may want to adjust
        tag_text = self.text.get(idx, f"{idx}+13c")
        import re
        match = re.match(r"\[AI→Doc (\d+)\]", tag_text)
        if match:
            doc_id = int(match.group(1))
            self.text.tag_add(f"link_{doc_id}", idx, f"{idx}+{len(match.group(0))}c")
            self.text.tag_config(f"link_{doc_id}", foreground="blue", underline=1)
            self.text.tag_bind(f"link_{doc_id}", "<Button-1>", lambda e, doc_id=doc_id: self._open_linked_doc(doc_id))
        idx = f"{idx}+1c"

def link_ai_context(self):
    # Placeholder for additional linking functionality
    try:
        selected_text = self.text.selection_get()
        context = self.text.get("1.0", tk.END)
        linked = self.processor.link(selected_text.strip(), context)
        if linked:
            messagebox.showinfo("Linked", f"Linked text '{selected_text.strip()}' to context.")
    except tk.TclError:
        messagebox.showinfo("Selection Error", "Please select text to link.")

(demokit-env) gross@Glendons-Mac-mini modules %

Olá, equipe do ChatGPT!

Gostaria de deixar uma sugestão para tornar o app ainda mais completo e útil no dia a dia:
a possibilidade de gerar áudios com pronúncia.

Por exemplo, ao pedir algo como “Quero o alfabeto grego com pronúncia”, o conteúdo é apresentado de forma escrita — o que já é ótimo —, mas a ausência de áudio dificulta para quem precisa aprender ouvindo.

Acredito que incluir esse recurso deixaria a experiência mais rica, principalmente para quem estuda, ensina ou apenas quer treinar a fala.

Desde já, agradeço pela atenção e pelo excelente trabalho. :blush:

Atenciosamente,
Anthony