1 line
2.8 KiB
JSON
1 line
2.8 KiB
JSON
{"repo": "aakash456/incident-copilot", "files": {"README.md": {"23a481042e066917544d418f75bc9fee4b2a5cc2": {"t": 1785674438.5586894, "n": 2601, "h": "02da7d3fdd3bc9e6", "c": "# Incident Copilot (TiDB Serverless + Agentic RAG)\n\nAn agentic incident assistant that ingests runbooks and logs into **TiDB Serverless** with vector embeddings. When an incident or question arises, it performs **hybrid retrieval** (vector + keyword + recency), summarizes the root cause, classifies severity, and **executes actions** (like posting to Slack or creating a GitHub issue).\n\n-----\n\n## Quick Start\n\n### Prerequisites\n\n - JDK 21+\n - Maven 3.9+\n - TiDB Serverless credentials\n - OpenAI API key (or compatible API)\n - **Optional:** Slack and GitHub tokens for action execution\n\n### Setup\n\n1. **Create a TiDB Serverless cluster.**\n\n - Note the host, user, and password.\n - Create a database named `incident_copilot`.\n\n2. **Configure environment variables.**\n\n - Copy `.env.example` to `.env` and fill in your credentials, or export them directly in your shell.\n\n <!-- end list -->\n\n ```bash\n export TIDB_JDBC_URL='jdbc:mysql://<host>:4000/incident_copilot?sslMode=VERIFY_IDENTITY'\n export TIDB_USER='xxx'\n export TIDB_PASS='xxx'\n export OPENAI_API_KEY='sk-...'\n export OPENAI_BASE='https://api.openai.com/v1'\n export EMBEDDINGS_MODEL='text-embedding-3-large'\n export CHAT_MODEL='gpt-4o-mini'\n\n # Optional actions\n export SLACK_BOT_TOKEN='xoxb-...'\n export SLACK_CHANNEL_ID='C12345678'\n export GITHUB_TOKEN='ghp_...'\n export GITHUB_REPO='you/incident-copilot'\n ```\n\n3. **Build and Run the application.**\n\n ```bash\n mvn -q -DskipTests spring-boot:run\n ```\n\n4. **Access the OpenAPI UI.**\n\n - Open your browser and navigate to `http://localhost:8080/swagger-ui/index.html` to interact with the API.\n\n-----\n\n### Sample CURL Commands\n\nYou can use these `curl` commands to interact with the running application.\n\n#### Ingest a URL\n\nIngest a document from a URL to be processed and stored.\n\n```bash\ncurl -s -X POST http://localhost:8080/ingest/docs \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://raw.githubusercontent.com/pingcap/tidb/master/README.md\",\"tags\":[\"db\",\"runbook\"]}'\n```\n\n#### Ask a Question\n\nAsk a question and receive a root cause summary.\n\n```bash\ncurl -s -X POST http://localhost:8080/ask \\\n -H \"Content-Type: application/json\" \\\n -d '{\"question\":\"p95 latency spiked in prod for payments-api\",\"context\":{\"service\":\"payments-api\",\"env\":\"prod\"}}' | jq .\n```\n\n#### Apply Actions\n\nExecute actions like posting to Slack or creating a GitHub issue.\n\n```bash\ncurl -s -X POST http://localhost:8080/actions/apply \\\n -H \"Content-Type: application/json\" \\\n -d @sample-actions.json | jq .\n```\n"}}}} |