Link code to conversations. Get full context for any symbol or ticket.
CasperAI connects your team discussions (Slack), code repositories (GitHub), and project tickets (Linear) to give you complete context about any piece of code. Ask "What's the story behind this function?" and get back discussions, commits, PRs, and tickets—all in one structured response.
// Get everything related to a function
const context = await getContext('handlePayment');
// Returns:
{
"symbol": "handlePayment",
"codeLocations": [{ filePath: "src/payments.ts", line: 127 }],
"discussions": [{ platform: "slack", text: "Let's add retry logic...", author: "john" }],
"pullRequests": [{ number: 456, title: "Add payment retry logic" }],
"commits": [{ sha: "a1b2c3", message: "Implement payment retry" }],
"tickets": [{ id: "LIN-123", title: "Payment failures on retry" }]
}Problem: Code has a story, but it's scattered across Slack threads, GitHub PRs, and Linear tickets. Finding context means searching multiple tools.
Solution: CasperAI indexes everything once, links it to your code, and gives you instant access via simple APIs.
getContext(symbol)- Get all discussions, commits, PRs, and tickets for any function/class- Batch queries - Query multiple symbols at once
- Smart search - Semantic search + full-text search (FTS5)
enrichTicket(ticketId)- Auto-populate ticket descriptions with relevant code context- Saves time - No more manually linking code references in tickets
- Webhooks - Slack, GitHub, Linear events processed automatically
- Smart deduplication - No duplicate indexing
- Polling fallback - Catches any missed webhook events
- Signature verification - HMAC-SHA256 validation for security
- 100% local - All data in SQLite on your machine
- No tracking - Zero telemetry, no phone-home behavior
- Your API keys stay local - Never transmitted to external servers
- Open source - MIT License, inspect every line
- REST API -
/api/context,/api/search,/api/index/*,/health - npm SDK -
getContext(),enrichTicket(),search(),indexSlack(),indexGithub(),indexLinear() - MCP Server - Claude Desktop integration
git clone https://github.com/chose166/CasperAI.git
cd CasperAI
npm install
npm run buildcp .env.example .env
# Edit .env with your tokens:
# - SLACK_API_TOKEN (required)
# - GITHUB_TOKEN (optional)
# - LINEAR_API_KEY (optional)# Start the server
npm start
# In another terminal, index your data
curl -X POST http://localhost:3000/api/index/slack \
-H "Content-Type: application/json" \
-H "X-API-Key: your-super-brain-key" \
-d '{"channel": "C12345"}'# Get context for a symbol
curl -X POST http://localhost:3000/api/context \
-H "Content-Type: application/json" \
-H "X-API-Key: your-super-brain-key" \
-d '{"symbol": "handlePayment"}'
# Search your knowledge base
curl -X POST http://localhost:3000/api/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your-super-brain-key" \
-d '{"query": "authentication bug", "type": "keyword"}'| Endpoint | Method | Description |
|---|---|---|
/api/context |
POST | Get context for a single symbol |
/api/context/batch |
POST | Get context for multiple symbols |
/api/context/enrich |
POST | Enrich a ticket with code context |
/api/search |
POST | Search indexed content |
/api/index/slack |
POST | Index a Slack channel |
/api/index/github |
POST | Index a GitHub repository |
/api/index/linear |
POST | Index a Linear team |
/health |
GET | Health check |
npm install casperaiimport { CasperAI } from 'casperai';
const casper = new CasperAI({
apiUrl: 'http://localhost:3000',
apiKey: 'your-super-brain-key'
});
// Get context
const context = await casper.getContext('handlePayment');
// Batch query
const contexts = await casper.getContextBatch(['handlePayment', 'processRefund']);
// Enrich ticket
const enriched = await casper.enrichTicket('LIN-123');
// Search
const results = await casper.search({ query: 'authentication', type: 'semantic' });
// Index
await casper.indexSlack({ channel: 'C12345' });
await casper.indexGithub({ repository: 'myorg/myrepo' });
await casper.indexLinear({ teamId: 'TEAM-123' });Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"casperai": {
"command": "node",
"args": ["/path/to/CasperAI/dist/index.js"],
"env": {
"SLACK_API_TOKEN": "xoxb-your-token",
"SUPER_BRAIN_KEY": "your-key"
}
}
}
}Then use in Claude:
- "Search CasperAI for discussions about authentication"
- "Get context for the handlePayment function"
- "Index our #engineering Slack channel"
| Platform | Indexing | Webhooks | What's Indexed |
|---|---|---|---|
| Slack | ✅ | ✅ | Messages, threads, code references |
| GitHub | ✅ | ✅ | Issues, PRs, commits, discussions |
| Linear | ✅ | ✅ | Issues, comments, project updates |
┌─────────────┐
│ Slack │──┐
│ GitHub │──┼─→ Webhooks ─→ Queue ─→ Indexer ─→ SQLite + FTS5
│ Linear │──┘ ↓
└─────────────┘ Code Mapper
↓
┌─────────────┐ ┌──────────────────┐
│ Your Code │←─────────── Links ───────────│ Context Graph │
└─────────────┘ └──────────────────┘
↓
┌──────────────────┐
│ getContext() │
│ enrichTicket() │
│ search() │
└──────────────────┘
- Webhook events from Slack/GitHub/Linear arrive at CasperAI
- Queue system deduplicates and processes events
- Code mapper extracts code references (functions, files, classes)
- Indexer stores everything in SQLite with FTS5 for fast search
- Graph builder creates relationships between code, discussions, and tickets
- Query APIs retrieve comprehensive context in milliseconds
# Required
SLACK_API_TOKEN=xoxb-your-slack-token
SUPER_BRAIN_KEY=your-secure-api-key
# Optional Platform Integrations
GITHUB_TOKEN=ghp_your-github-token
LINEAR_API_KEY=lin_api_your-linear-key
# Optional AI Features (for semantic search)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
# Optional Webhook Secrets (for signature verification)
ENABLE_WEBHOOK_RECEIVERS=true
SLACK_SIGNING_SECRET=your_slack_secret
GITHUB_WEBHOOK_SECRET=your_github_secret
LINEAR_WEBHOOK_SECRET=your_linear_secret
# Server Configuration
PORT=3000
DATABASE_PATH=./data/knowledge-brain.db
ENABLE_PII_REDACTION=trueEnable real-time ingestion by configuring webhooks in each platform:
Slack: App Settings → Event Subscriptions → https://your-server/webhooks/slack
GitHub: Repo Settings → Webhooks → https://your-server/webhooks/github
Linear: Settings → Webhooks → https://your-server/webhooks/linear
See docs/WEBHOOK_SETUP.md for detailed instructions.
CasperAI is 100% open-source (MIT License) with zero phone-home behavior.
All data stays in local SQLite. No telemetry, no tracking, no external servers. Developers who care can audit every line of code.
Currently Shipping (v1.0):
- ✅ Slack, GitHub, Linear integration
- ✅
getContext()andenrichTicket()APIs - ✅ Webhook ingestion with dedup
- ✅ Semantic search + FTS5
- ✅ npm SDK and MCP server
Planned (future versions):
- 🔄 More platforms (GitLab, Jira, Notion, Sentry, Datadog)
- 🔄 Background workers for auto-indexing
- 🔄 CI/CD integration (GitHub Actions, GitLab CI)
- 🔄 IDE extensions (VS Code, JetBrains)
- 🔄 Git hooks integration
- 🔄 GraphQL API
- 🔄 Expertise tracking ("who knows what")
- 🔄 Temporal awareness (code evolution timeline)
- 🔄 Staleness detection (outdated docs)
- 🔄 Impact analysis (dependency tracking)
See ROADMAP.md for detailed plans.
Enrich a bug ticket automatically:
const ticket = await enrichTicket('LIN-456');
// Auto-populates the ticket with:
// - Functions mentioned in related Slack threads
// - PRs that touched the same code
// - Recent commits to affected files
// - Similar past issues and their resolutionsNo more manually searching Slack, GitHub, and Linear to add context to tickets. CasperAI does it instantly.
- Quick Start Guide - Installation and setup
- API Reference - Complete API docs
- Webhook Setup - Configure real-time ingestion
- Architecture - How CasperAI works
- Roadmap - Future plans
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
MIT License - see LICENSE for details.