@aurite-ai/kai 0.2.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +190 -0
  2. package/dist/kai-mcp.cjs +1652 -0
  3. package/dist/kai-mcp.cjs.map +7 -0
  4. package/dist/templates/copilot-configs/claude-code/.claude/CLAUDE.md +272 -0
  5. package/dist/templates/copilot-configs/claude-code/.claude/agents/architect.md +133 -0
  6. package/dist/templates/copilot-configs/claude-code/.claude/agents/implementer.md +88 -0
  7. package/dist/templates/copilot-configs/claude-code/.claude/settings.json +87 -0
  8. package/dist/templates/copilot-configs/claude-code/.claude/skills/documentation/SKILL.md +54 -0
  9. package/dist/templates/copilot-configs/claude-code/.claude/skills/verification/SKILL.md +125 -0
  10. package/dist/templates/frameworks/langgraph/README.md +118 -0
  11. package/dist/templates/frameworks/langgraph/main.py +97 -0
  12. package/dist/templates/frameworks/langgraph/pyproject.toml +29 -0
  13. package/dist/templates/frameworks/langgraph/src/agent/__init__.py +31 -0
  14. package/dist/templates/frameworks/langgraph/src/agent/graph.py +257 -0
  15. package/dist/templates/frameworks/langgraph/src/agent/state.py +65 -0
  16. package/dist/templates/frameworks/langgraph/src/agent/tools.py +30 -0
  17. package/dist/templates/frameworks/openai/README.md +131 -0
  18. package/dist/templates/frameworks/openai/main.py +80 -0
  19. package/dist/templates/frameworks/openai/pyproject.toml +28 -0
  20. package/dist/templates/frameworks/openai/src/agent/__init__.py +18 -0
  21. package/dist/templates/frameworks/openai/src/agent/agents.py +122 -0
  22. package/dist/templates/frameworks/openai/src/agent/tools.py +100 -0
  23. package/dist/templates/index.d.ts +85 -0
  24. package/dist/templates/index.d.ts.map +1 -0
  25. package/dist/templates/index.js +270 -0
  26. package/dist/templates/index.js.map +1 -0
  27. package/dist/templates/knowledge-base/langgraph-best-practices.mdc +277 -0
  28. package/dist/templates/knowledge-base/openai-agents-overview.mdc +602 -0
  29. package/dist/templates/project-env +7 -0
  30. package/dist/templates/project-gitignore +26 -0
  31. package/package.json +66 -0
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # @aurite-ai/kai
2
+
3
+ **Kai is your AI copilot's memory.**
4
+
5
+ Without Kai, your AI copilot starts fresh every conversation. With Kai, it remembers what it's learned, finds relevant context for each task, and works more effectively across your projects.
6
+
7
+ ---
8
+
9
+ ## Quick Start (Claude Code)
10
+
11
+ ### Step 1: Add Kai
12
+
13
+ ```bash
14
+ claude mcp add kai -s user -e ANTHROPIC_API_KEY="your-anthropic-api-key" -- npx @aurite-ai/kai
15
+ ```
16
+
17
+ > **Scope options:**
18
+ > - `-s project` — Config stored for current project only
19
+ > - `-s user` — Config stored globally (available across all projects)
20
+
21
+ ### Step 2: Set Up Kai
22
+
23
+ In each new project, restart Claude Code and say:
24
+
25
+ > **"Set up Kai"**
26
+
27
+ This deploys copilot rules to your project and runs first-time onboarding. The copilot will ask a few questions to understand your organization and project context—this only happens once, then Kai remembers.
28
+
29
+ ### Step 3: Teach Kai Your Context
30
+
31
+ Share files from anywhere on your system:
32
+
33
+ > **"learn ~/Downloads/business-policies.pdf"**
34
+
35
+ Or share entire folders:
36
+
37
+ > **"learn the docs/ folder"**
38
+
39
+ Kai classifies and stores everything in its knowledge base. This context persists across sessions and projects.
40
+
41
+ ### Step 4: Start Building
42
+
43
+ When you start a task, Kai automatically surfaces relevant context:
44
+
45
+ > **"build a customer support agent"**
46
+
47
+ Kai finds the relevant policies, examples, and patterns you've taught it.
48
+
49
+ Use `/mcp` in Claude Code to verify the server is connected.
50
+
51
+ ---
52
+
53
+ ## Tool Reference
54
+
55
+ | Tool | What It Does | Example |
56
+ | ----------------------------- | -------------------------------------- | ------------------------------- |
57
+ | `kai_initialize` | Deploys copilot rules, runs onboarding | "Set up Kai" |
58
+ | `kai_learn` | Adds files to knowledge base | "Learn the docs/ folder" |
59
+ | `kai_prepare_context` | Surfaces relevant knowledge for a task | "Build a search feature" |
60
+ | `kai_ask` | Quick Q&A against the knowledge base | "What's our API format?" |
61
+ | `kai_delete` | Removes files from knowledge base | "Remove the outdated API doc" |
62
+ | `kai_usage` | Shows token usage and costs | "Show my Kai usage" |
63
+ | `kai_discover_integration` | Detects services in your files | (auto-detected during learn) |
64
+ | `kai_use_integration` | Calls discovered integrations | "Query the PostgreSQL database" |
65
+
66
+ <details>
67
+ <summary>🔌 Integration Workflow</summary>
68
+
69
+ When you `learn` files containing API keys or service configs, Kai automatically:
70
+
71
+ 1. Detects integrations (databases, APIs, etc.)
72
+ 2. Stores credentials securely in vault
73
+ 3. Makes integrations available for your agent to use
74
+
75
+ Example: After learning a file with PostgreSQL connection strings, you can say:
76
+
77
+ > "Query the users table"
78
+
79
+ </details>
80
+
81
+ **Additional tools:** `kai_provide_context`, `kai_verify_integration`, `kai_list_integrations`, `kai_update_connector`, `health_check`. See [Advanced Documentation](https://github.com/Aurite-ai/kai/blob/main/apps/mcp/docs/ADVANCED.md) for complete reference.
82
+
83
+ ---
84
+
85
+ ## Other Installation Methods
86
+
87
+ ### npm (Global Install)
88
+
89
+ ```bash
90
+ npm install -g @aurite-ai/kai
91
+ ```
92
+
93
+ Configure your MCP client to use `kai-mcp` as the command.
94
+
95
+ ### npx (No Install)
96
+
97
+ ```bash
98
+ npx @aurite-ai/kai
99
+ ```
100
+
101
+ ### Docker
102
+
103
+ ```bash
104
+ docker pull kai/mcp
105
+ docker run -i kai/mcp
106
+ ```
107
+
108
+ ### From Source
109
+
110
+ ```bash
111
+ git clone https://github.com/Aurite-ai/kai.git
112
+ cd kai
113
+ pnpm install
114
+ pnpm --filter @aurite-ai/kai build
115
+ pnpm --filter @aurite-ai/kai bundle
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Configuration
121
+
122
+ ### API Key
123
+
124
+ Kai requires an `ANTHROPIC_API_KEY` for AI-powered tools. Set it in your MCP config:
125
+
126
+ ```json
127
+ {
128
+ "mcpServers": {
129
+ "kai": {
130
+ "command": "npx",
131
+ "args": ["@aurite-ai/kai"],
132
+ "env": {
133
+ "ANTHROPIC_API_KEY": "sk-ant-..."
134
+ }
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ **Config file locations:**
141
+
142
+ - Claude Code (project): `.mcp.json`
143
+ - Claude Code (global): `~/.claude/settings.json`
144
+
145
+ ### Environment Variables
146
+
147
+ ```bash
148
+ # Required for AI-powered tools
149
+ ANTHROPIC_API_KEY=sk-ant-...
150
+
151
+ # Optional: Custom knowledge base location
152
+ KAI_KNOWLEDGE_DIR=/path/to/custom/knowledge
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Troubleshooting
158
+
159
+ ### "Missing ANTHROPIC_API_KEY" Error
160
+
161
+ 1. Check your MCP config has the `env` block with `ANTHROPIC_API_KEY`
162
+ 2. Verify the key starts with `sk-ant-`
163
+ 3. Restart Claude Code after config changes
164
+
165
+ ### Tools Not Appearing
166
+
167
+ 1. Check `/mcp` in Claude Code to verify connection
168
+ 2. Try `npx @aurite-ai/kai --version` to confirm package access
169
+ 3. Check config JSON syntax
170
+
171
+ ### "Organization Context Required"
172
+
173
+ Run onboarding: say **"Set up Kai"** to your copilot.
174
+
175
+ ---
176
+
177
+ ## Development
178
+
179
+ ```bash
180
+ pnpm --filter @aurite-ai/kai dev # Watch mode
181
+ pnpm --filter @aurite-ai/kai test # Run tests
182
+ pnpm --filter @aurite-ai/kai typecheck # Type-check
183
+ pnpm --filter @aurite-ai/kai bundle # Production bundle
184
+ ```
185
+
186
+ ---
187
+
188
+ ## License
189
+
190
+ MIT