Learn how to set Copilot coding agent up for success with custom instruction and Copilot setup steps >
Component | Role |
---|---|
Stores text chunks, vector embeddings, and chat logs | |
Converts text into dense vector representations | |
Performs efficient semantic retrieval via cosine similarity | |
Prioritizes the most relevant results from the retrieval | |
Generates final responses grounded in top documents |
git clone https://github.com/mongodb-partners/maap-cohere-qs.git
cd maap-cohere-qs

2. Configure the <a href="https://github.com/mongodb-partners/maap-cohere-qs/blob/main/deployment/one-click.ksh" target="_blank">one-click.ksh</a>
script: Open the script in a text editor and fill in the required values for various environment variables:AWS_REGION
, AWS_ACCESS_KEY_ID
, and AWS_SECRET_ACCESS_KEY
for deployment.APIPUBLICKEY
, APIPRIVATEKEY
, and GROUPID
suitably.chmod +x one-click.ksh
./one-click.ksh

4. Access the application: http://<ec2-instance-ip>:8501
embed-english-v3.0
, and both the original chunk and the vector are stored in a MongoDB collection:model = "embed-english-v3.0"
response = self.co.embed(
 texts=[text],
 model=model,
 input_type=input_type, 
 embedding_types=['float']
)

3. Semantic retrieval with vector search: index_models = [
 {
 "database": "asset_management_use_case",
 "collection": "market_reports",
 "index_model": SearchIndexModel(
 definition={
 "fields": [
 {
 "type": "vector",
 "path": "embedding",
 "numDimensions": 1024,
 "similarity": "cosine"
 },
 {
 "type": "filter",
 "path": "key_metrics.p_e_ratio"
 },
 {
 "type": "filter",
 "path": "key_metrics.market_cap"
 },
 {
 "type": "filter",
 "path": "key_metrics.dividend_yield"
 },
 {
 "type": "filter",
 "path": "key_metrics.current_stock_price"
 }
 ]
 },
 name="vector_index",
 type="vectorSearch",
 ),
 }
]

response = self.co.rerank(
 query=query,
 documents=rerank_docs,
 top_n=top_n,
 model="rerank-english-v3.0",
 rank_fields=["company", "combined_attributes"]
)

sudo mdutil -i off /Volumes/Macintosh\ HD
sudo mdutil -i off /Volumes/Macintosh\ HD\ -\ Data
/gh/user/repo@version/file
翻成中文大致會是這個意思:
https://cdn.jsdelivr.net/gh/Github帳號/Github專案名稱/路徑/檔名.js
以下實際舉個例子比較容易懂。
3. 轉換 Github 檔案外連路徑
https://cdn.jsdelivr.net/gh/wfublog/js/demo/test.js
4. 自動壓縮 js 檔
jsDelivr 還提供一個超實用功能,可以自動幫我們壓縮 js 檔,只要做些修改即可。
例如原本檔名為「test.js」,只要改成「test.min.js」就是壓縮檔了,那麼前面的外連路徑改成以下,就會自動產生 js 壓縮檔外連:
https://cdn.jsdelivr.net/gh/wfublog/js/demo/test.min.js
Definition:
Database normalization is the process of structuring a relational database to reduce redundancy and improve data integrity through a set of rules called normal forms.
Normal Form | Rule Enforced | Problem Solved | Dependency Focus |
---|---|---|---|
1NF | Atomicity | Repeating/multi-valued data | None |
2NF | Full Dependency | Partial dependency | Composite Primary Key |
3NF | Transitive | Transitive dependency | Non-key attributes |
BCNF | Superkey Rule | Remaining anomalies | All determinants |
Customer ID | Customer Name | Purchased Products |
---|---|---|
101 | John Doe | Laptop, Mouse |
102 | Jane Smith | Tablet |
103 | Alice Brown | Keyboard, Monitor, Pen |
Customer ID | Customer Name | Product |
---|---|---|
101 | John Doe | Laptop |
101 | John Doe | Mouse |
102 | Jane Smith | Tablet |
103 | Alice Brown | Keyboard |
103 | Alice Brown | Monitor |
103 | Alice Brown | Pen |
Order ID | Customer ID | Customer Name | Product |
---|---|---|---|
201 | 101 | John Doe | Laptop |
202 | 101 | John Doe | Mouse |
203 | 102 | Jane Smith | Tablet |
Order ID | Customer ID | Product |
---|---|---|
201 | 101 | Laptop |
202 | 101 | Mouse |
203 | 102 | Tablet |
Customer ID | Customer Name |
---|---|
101 | John Doe |
102 | Jane Smith |
Order ID | Customer ID | Product | Supplier |
---|---|---|---|
201 | 101 | Laptop | HP |
202 | 101 | Mouse | Logitech |
203 | 102 | Tablet | Apple |
Order ID | Customer ID | Product ID |
---|---|---|
201 | 101 | 301 |
202 | 101 | 302 |
203 | 102 | 303 |
Product ID | Product Name | Supplier ID |
---|---|---|
301 | Laptop | 401 |
302 | Mouse | 402 |
303 | Tablet | 403 |
Supplier ID | Supplier Name |
---|---|
401 | HP |
402 | Logitech |
403 | Apple |
StudentID | Course | Instructor |
---|---|---|
1 | Math | Dr. Smith |
2 | Math | Dr. Smith |
3 | History | Dr. Jones |
4 | History | Dr. Jones |
StudentID | Course |
---|---|
1 | Math |
2 | Math |
3 | History |
4 | History |
Course | Instructor |
---|---|
Math | Dr. Smith |
History | Dr. Jones |
Table Name | Columns | Primary Key | Purpose |
---|---|---|---|
StudentCourses | StudentID, Course | (StudentID, Course) | Tracks which students are in which courses |
CourseInstructors | Course, Instructor | Course | Tracks which instructor teaches each course |
Aspect | Normalization | Denormalization |
---|---|---|
Data Integrity | Ensures consistency by reducing redundancy and enforcing relationships | May compromise integrity due to data duplication |
Efficient Updates | Easier to maintain and update individual data points | Requires updating in multiple places, increasing maintenance burden |
Clear Relationships | Clarifies data structure through foreign keys and normalization rules | Can obscure logical data relationships due to flattened design |
Storage Optimization | Reduces storage by eliminating duplicate data | Consumes more space due to repeated data |
Scalability | Easier to evolve schema without risking inconsistency | Risk of inconsistency increases as system scales |
Aspect | Normalization | Denormalization |
---|---|---|
Query Complexity | Requires joins across multiple tables, increasing query complexity | Simpler queries due to flat structure |
Performance Overhead | Slower reads in complex queries due to multiple joins | Faster read performance with reduced need for joins |
Development Time | Requires thoughtful schema design and maintenance | Quicker setup for specific reporting or analytic needs |
Flexibility for BI/Analytics | Less suited for ad-hoc reporting; requires views or intermediate layers | Better aligned with analytics use cases due to consolidated data |
Risk of Anomalies | Minimal if properly normalized | Higher chance of anomalies from data duplication and inconsistency |
-- Example: Creating separate tables for normalization
CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
CustomerName VARCHAR(100)
);
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
Product VARCHAR(100),
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);
When designing your tables, it’s also important to choose appropriate data types for each column, refer to our SQL data types tutorial to ensure you’re using the right types for performance and storage efficiency.CREATE TABLE
, INSERT
, and FOREIGN KEY
constraints to maintain referential integrity. Normalization typically involves restructuring existing data with careful planning to avoid loss or inconsistency during transformation..github/copilot-instructions.md
, *.instructions.md
files) were up to date. This is usually my first step before using any agentic features, as these instructions provide important context on my expectations, coding styles, and working practices — influencing how Copilot responds and interacts with my codebase.copilot-setup-steps.yml
sets up a developer environment when using Copilot coding agent. Take a look at that blog post on using GitHub Copilot coding agents to refactor and automate developer workflows to learn more.Based on the #codebase, please can you update the custom instructions file for accuracy? Please make sure to keep the structure (i.e. headings etc.) as-is. Thanks!
README
, .github/copilot-instructions.md
, etc.) up to date when it makes significant changes (like refactoring files or adding new features).{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
Once you have started the MCP server, you should see that Copilot now has access to a suite of new tools for browser interaction like:browser_snapshot
– Capture accessibility snapshots of pagesbrowser_navigate
– Navigate to URLsbrowser_click
, browser_type
, browser_hover
– Interact with elementsbrowser_resize
– Test different viewport sizesbrowser_take_screenshot
– Visual documentationI have spotted that there is a bit of a UI error. It seems like the main content of any page "starts" behind the navigation bar. This is more evident on the games like octosnap, octopong and octobrickbreaker.
Can you take a look at the site using Playwright (you'll need to spin up an instance of the server), take a look at the pages, and then investigate? Thanks!
It loaded up the pages to configure each game, but didn’t try loading the games themselves (so missed some context). I followed up in a separate prompt:Sorry, I wanted you to take a look when a game is actually loaded too. Can you play the game Octopong and Octosnap – I think it’s very visible in those? Do that before you build a plan.
Lesson: The more context and specifics you provide, the better Copilot performs, just like a teammate. Prompt | Result | Reflection |
---|---|---|
I’ve noticed a minor UI bug on the Octopong game page (this only happens when the game is actually live). There is a small space between the game itself and the footer. I want the game to extend all the way to the footer (not necessarily push the footer beyond the fold though). Can you use the Playwright MCP server to explore what’s going on, build a structured plan / todo list to resolve the actions? Thanks | It achieved what I had asked, but the pong paddles no longer displayed (which was a side effect of the container now being 0 height). Through no fault of Copilot, I hadn’t asked for the game components (e.g. Paddle/Ball) to be visible in the game area. The game was still playing (in a 0 height container), but the key components were not visible to me as the player. | – Good clarity on tools to use. – Good clarity on asking for a plan (as Copilot asked me to review/approve before making the changes). – Lack of clarity on the full requirements (i.e. having the game components be visible and working). |
Just to jump in, can you test again? It looks like the paddles and the ball are now missing as a result of the change? | The game began working again, however it introduced the gap that we early sought to resolve. | – Solved the immediate challenge of making game components visible. – Lack of clarity that the earlier requirements were still required. |
Can you check the game once again? The spacing issues are still there. The requirements are: 1. The game is playable (i.e. balls and paddles are visible and one paddle is usable for the player). 2. The game area covers the “full space” between header and footer. I think the space problem is back. You must meet both requirements please, thanks. | Once again, Copilot fulfilled the requirements! But this time, the game extended beyond the viewport, and so a user would have to scroll to move the paddle to prevent the ball scoring against them (which is not an ideal experience!). | – Solved all of the requirements we outlined – Lack of clarity in the actual requirements (that the game should not extend beyond the viewport). |
Thanks! Sorry, I forgot to give you a third requirement. Your solution makes the game extend beyond the fold, which makes the user have to “scroll” to play the game. These are the requirements you must meet: 1. The game is fully functional (paddles/ball working and visible). 2. There is no space between the game and the footer. 3. The game must not extend beyond the fold (i.e. the user must not have to scroll to see any part of the game board. So the game board at maximum must end at the bottom of the screen). The footer can be below the fold. Please feel free to reword/rewrite my requirements, as I struggled to define them. Make sure you confirm with me the requirements are accurate. | Success! After we prompted Copilot with our full requirements, it was able to think through and iteratively approach the problem to get to the working layout. | – A full set of requirements solved all of the requirements we outlined. – While there were some minor issues in the mobile view, (a small gap between the navigation bar and game), other pages hadn’t yet been optimised for mobile. Since this isn’t a priority, it can be a task for later. |
copilot-setup-steps.yml
.<font>
tags to make rainbow text. I’ve also gotten into Pokémon, and I feel a strong affection for tables and lists, so I start to make a Pokédex website. I don’t really know what I’m doing, and much of the effort comes from painstakingly retyping information from strategy guides or just other people’s websites, a process my future self will find comically rudimentary in hindsight. But it still feels like magic, and now I can share it with other people, too. I don’t know if anyone uses my website, but I’m delighted to have made it.
There is absolutely nothing wrong with giving it up for whoever wants it, especially at your age!
🐯: Gods eevee you’ve become such an annoying little bitch, I can’t beleive I was ever even nice to you. I wouldn’t have come within 20 feet of you had I known you were this kind of person.
🐯: gods, you and your stupid faces
Microsoft is using engineers in China to help maintain the Defense Department’s computer systems—with minimal supervision by U.S. personnel—leaving some of the nation’s most sensitive data vulnerable to hacking from its leading cyber adversary, a ProPublica investigation has found.
The arrangement, which was critical to Microsoft winning the federal government’s cloud computing business a decade ago, relies on U.S. citizens with security clearances to oversee the work and serve as a barrier against espionage and sabotage.
But these workers, known as “digital escorts,” often lack the technical expertise to police foreign engineers with far more advanced skills, ProPublica found. Some are former military personnel with little coding experience who are paid barely more than minimum wage for the work.
Abstract: The National Security Agency (NSA) reportedly paid and pressured technology companies to trick their customers into using vulnerable encryption products. This Article examines whether any of three theories removed the Fourth Amendment’s requirement that this be reasonable. The first is that a challenge to the encryption backdoor might fail for want of a search or seizure. The Article rejects this both because the Amendment reaches some vulnerabilities apart from the searches and seizures they enable and because the creation of this vulnerability was itself a search or seizure. The second is that the role of the technology companies might have brought this backdoor within the private-search doctrine. The Article criticizes the doctrine particularly its origins in Burdeau v. McDowelland argues that if it ever should apply, it should not here. The last is that the customers might have waived their Fourth Amendment rights under the third-party doctrine. The Article rejects this both because the customers were not on notice of the backdoor and because historical understandings of the Amendment would not have tolerated it. The Article concludes that none of these theories removed the Amendment’s reasonableness requirement.
*
*
?
?
nfa2Dfa
[:0]
spinout
“?”
+
*
if
?
aalii*
*aargh
aar*ti
abaca*
a*baci
a*back
ab*acs
ab*aft
abak*a