Your personal AI memory. One database, one button, every AI you use.
Second Brain is a personal knowledge system backed by Azure Cosmos DB with vector search. Capture thoughts from Microsoft Teams, search them by meaning from GitHub Copilot, VS Code, or any MCP-compatible AI. One brain. All of them.
- Click the button above → Azure Portal opens
- Select your Subscription and Resource Group (create new:
secondbrain-rg) - Pick a Region (East US is fine)
- Click Review + Create → Create
- Wait 3–5 minutes ☕
That's it for infrastructure. No terminal. No API keys. No environment variables. Everything is provisioned automatically with managed identity.
- When deployment completes, click "Outputs" in the Azure Portal
- Find the teamsAuthLink — click it
- Click "Authorize" → sign in with your Microsoft account → click "Allow"
This lets the Logic App read and post messages in Teams. One OAuth click — legally required, can't be automated.
From the deployment outputs, copy the copilotMcpConfig value.
Create a file called .vscode/mcp.json in any workspace:
{
"servers": {
"secondbrain": {
"type": "http",
"url": "https://YOUR-FUNCTION-APP.azurewebsites.net/api/mcp",
"headers": {
"X-MCP-Access-Key": "YOUR-ACCESS-KEY"
}
}
}
}Replace the URL and key with your deployment output values. GitHub Copilot Chat will automatically discover the MCP server.
Open VS Code Settings (JSON) and add:
{
"github.copilot.chat.mcp.servers": {
"secondbrain": {
"type": "http",
"url": "https://YOUR-FUNCTION-APP.azurewebsites.net/api/mcp",
"headers": {
"X-MCP-Access-Key": "YOUR-ACCESS-KEY"
}
}
}
}Open GitHub Copilot Chat and ask a question — you'll see "secondbrain" in the available tools. Done.
Teams (#brain message)
→ Logic App (trigger)
→ Azure Function (embed + classify)
→ Cosmos DB (store with vector)
GitHub Copilot / VS Code / Any MCP Client
→ MCP Server (search by meaning)
→ Cosmos DB (vector search)
Type #brain followed by your thought in any Teams channel. The Logic App picks it up, the Function embeds it with Azure OpenAI, extracts metadata (type, topics, people, action items), and stores everything in Cosmos DB. You get a confirmation reply in the thread.
Your MCP server exposes 4 tools:
- search_thoughts — Semantic search by meaning
- browse_recent — Browse latest thoughts
- brain_stats — See your brain's statistics
- capture_thought — Capture directly from AI conversations
| Resource | Purpose | Monthly Cost |
|---|---|---|
| Azure Cosmos DB (serverless) | Vector database | ~$2.00 |
| Azure OpenAI (text-embedding-3-small + gpt-4o-mini) | Embeddings + metadata | ~$0.02 |
| Azure Functions (consumption) | Capture + MCP server | ~$0.00 |
| Logic App (consumption) | Teams → Function bridge | ~$0.01 |
| Application Insights | Monitoring | ~$0.00 |
| Storage Account | Function runtime | ~$0.10 |
| Total | ~$2.13/month |
Fits easily in a free-tier or pay-as-you-go Azure subscription.
Go to any channel and type:
#brain This is my first thought captured by Second Brain!
You should see a ✅ confirmation reply within a few seconds.
In VS Code, open Copilot Chat and ask: "Search my brain for recent thoughts" — it will use the search_thoughts tool automatically.
curl -X POST "YOUR_MCP_ENDPOINT" \
-H "Content-Type: application/json" \
-H "X-MCP-Access-Key: YOUR_KEY" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'(Replace with values from your deployment outputs)
- Go to Azure Portal → Subscriptions → Resource Providers
- Search for
Microsoft.CognitiveServices→ click Register - Re-deploy
- Check the Logic App is enabled: Azure Portal → Logic App → Overview → should say "Enabled"
- Verify the Teams connection is authorized: Logic App → API connections → should show "Connected"
- Check Function logs: Application Insights → Live Metrics → watch for incoming requests
- Verify the URL in your VS Code MCP config matches the deployment output
- Check the access key is correct
- Test with the curl command from deployment outputs
If Azure OpenAI isn't available in your subscription, you can use GitHub Models API (free with your GitHub Copilot license):
- Go to github.com/settings/tokens → Generate new token → select
models:read - In Azure Portal, go to your Function App → Configuration → Application Settings
- Add:
AI_PROVIDER=githubandGITHUB_PAT= your token - Save and restart the Function App
See docs/architecture.md for the full technical architecture, including database schema, API specifications, and design decisions.
MIT