If Content is King, Then Context is God
History and Relevance of Context
Because context is so important, it's equally important to keep it relevant. It's not just the responsibility of the AI assistant to do so, but also the user's. For example, if you are working on a Python project and you have a JavaScript file open in your editor, Copilot may not be able to provide relevant suggestions for your Python code. In this case, it's better to close the JavaScript file and focus on the Python one. In reality, Copilot is pretty good at ignoring noise, so opening files is not a problem, but without a doubt, the more effort you put into keeping your context relevant, the better results you will get, especially when working on complex projects.
The history of the chat is another important factor to consider. If you have a long history of interactions with Copilot, it may be difficult for the model to keep track of the context and provide relevant suggestions. A lengthy history could lead to some confusion, especially when it's mixed with different topics. The best way to keep the context relevant is to start a new chat when you change the topic. Keep every chat focused on a specific topic or task. For example:
- Chat 1: Working on the authentication module.
- Chat 2: Working on the payment module.
- Chat 3: Working on the message queue.
- Chat 4: Everything related to Git.
- Chat 5: Anything related to Docker and Kubernetes.
To switch between chats, you can use the "Show chats" button at the top of the chat panel. To make this process easier, I recommend renaming your chats based on the topic you are working on. Copilot automatically names your chats based on the first message you send, but you need to rename them manually for better organization.
Always remember that LLMs have limits on the number of tokens they can process.
Total Tokens = Prompt Tokens + Context Tokens + Completion Tokens
Prompt Tokensare the tokens in your prompt (the text you type).Context Tokensare the tokens in the context provided by Copilot (chat history, open files, tool outputs, etc.).Completion Tokens
Building with GitHub Copilot
From Autocomplete to Autonomous AgentsEnroll now to unlock all content and receive all future updates for free.
