@techwavedev/agi-agent-kit 1.1.7 → 1.2.7

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 (56) hide show
  1. package/CHANGELOG.md +142 -1
  2. package/README.md +195 -15
  3. package/bin/init.js +154 -5
  4. package/package.json +6 -3
  5. package/templates/base/AGENTS.md +54 -23
  6. package/templates/base/README.md +327 -0
  7. package/templates/base/directives/memory_integration.md +95 -0
  8. package/templates/base/execution/memory_manager.py +309 -0
  9. package/templates/base/execution/session_boot.py +218 -0
  10. package/templates/base/execution/session_init.py +320 -0
  11. package/templates/base/requirements.txt +45 -6
  12. package/templates/base/skill-creator/SKILL_skillcreator.md +3 -3
  13. package/templates/skills/knowledge/design-md/README.md +0 -0
  14. package/templates/skills/knowledge/design-md/SKILL.md +0 -0
  15. package/templates/skills/knowledge/design-md/examples/DESIGN.md +0 -0
  16. package/templates/skills/knowledge/intelligent-routing/SKILL.md +237 -164
  17. package/templates/skills/knowledge/notebooklm-rag/SKILL.md +216 -0
  18. package/templates/skills/knowledge/notebooklm-rag/requirements.txt +9 -0
  19. package/templates/skills/knowledge/notebooklm-rag/scripts/ask_question.py +237 -0
  20. package/templates/skills/knowledge/notebooklm-rag/scripts/auth_manager.py +307 -0
  21. package/templates/skills/knowledge/notebooklm-rag/scripts/browser_utils.py +101 -0
  22. package/templates/skills/knowledge/notebooklm-rag/scripts/cleanup_manager.py +87 -0
  23. package/templates/skills/knowledge/notebooklm-rag/scripts/config.py +45 -0
  24. package/templates/skills/knowledge/notebooklm-rag/scripts/notebook_manager.py +334 -0
  25. package/templates/skills/knowledge/notebooklm-rag/scripts/run.py +92 -0
  26. package/templates/skills/knowledge/notebooklm-rag/scripts/setup_environment.py +68 -0
  27. package/templates/skills/knowledge/parallel-agents/SKILL.md +345 -73
  28. package/templates/skills/knowledge/plugin-discovery/SKILL.md +581 -0
  29. package/templates/skills/knowledge/plugin-discovery/scripts/platform_setup.py +1083 -0
  30. package/templates/skills/knowledge/react-components/README.md +0 -0
  31. package/templates/skills/knowledge/react-components/SKILL.md +0 -0
  32. package/templates/skills/knowledge/react-components/examples/gold-standard-card.tsx +0 -0
  33. package/templates/skills/knowledge/react-components/package-lock.json +0 -0
  34. package/templates/skills/knowledge/react-components/package.json +0 -0
  35. package/templates/skills/knowledge/react-components/resources/architecture-checklist.md +0 -0
  36. package/templates/skills/knowledge/react-components/resources/component-template.tsx +0 -0
  37. package/templates/skills/knowledge/react-components/resources/stitch-api-reference.md +0 -0
  38. package/templates/skills/knowledge/react-components/resources/style-guide.json +0 -0
  39. package/templates/skills/knowledge/react-components/scripts/validate.js +0 -0
  40. package/templates/skills/knowledge/self-update/SKILL.md +0 -0
  41. package/templates/skills/knowledge/self-update/scripts/update_kit.py +0 -0
  42. package/templates/skills/knowledge/stitch-loop/README.md +0 -0
  43. package/templates/skills/knowledge/stitch-loop/SKILL.md +3 -3
  44. package/templates/skills/knowledge/stitch-loop/examples/SITE.md +0 -0
  45. package/templates/skills/knowledge/stitch-loop/examples/next-prompt.md +0 -0
  46. package/templates/skills/knowledge/stitch-loop/resources/baton-schema.md +0 -0
  47. package/templates/skills/knowledge/stitch-loop/resources/site-template.md +0 -0
  48. package/templates/skills/stitch-loop/SKILL.md +3 -3
  49. package/templates/skills/core/qdrant-memory/scripts/__pycache__/embedding_utils.cpython-314.pyc +0 -0
  50. package/templates/skills/core/qdrant-memory/scripts/__pycache__/init_collection.cpython-314.pyc +0 -0
  51. package/templates/skills/knowledge/SKILLS_CATALOG.md +0 -796
  52. package/templates/skills/knowledge/jira/scripts/__pycache__/jira_client.cpython-314.pyc +0 -0
  53. package/templates/skills/knowledge/notebooklm-mcp/SKILL.md +0 -71
  54. package/templates/skills/knowledge/notebooklm-mcp/assets/example_asset.txt +0 -24
  55. package/templates/skills/knowledge/notebooklm-mcp/references/api_reference.md +0 -34
  56. package/templates/skills/knowledge/notebooklm-mcp/scripts/example.py +0 -19
@@ -0,0 +1,320 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Script: session_init.py
4
+ Purpose: Bootstrap script for AI agent sessions. Checks prerequisites and
5
+ initializes Qdrant collections with correct dimensions for the
6
+ configured embedding provider (defaults to Ollama/768d).
7
+
8
+ Usage:
9
+ # Full initialization (check + create collections)
10
+ python3 execution/session_init.py
11
+
12
+ # Check only (no collection creation)
13
+ python3 execution/session_init.py --check-only
14
+
15
+ # Force re-initialization
16
+ python3 execution/session_init.py --force
17
+
18
+ Environment Variables:
19
+ EMBEDDING_PROVIDER - "ollama" (default), "openai", or "bedrock"
20
+ OLLAMA_URL - Ollama server URL (default: http://localhost:11434)
21
+ QDRANT_URL - Qdrant server URL (default: http://localhost:6333)
22
+
23
+ Exit Codes:
24
+ 0 - Success (all systems ready)
25
+ 1 - Partial success (some checks failed but non-critical)
26
+ 2 - Critical failure (Qdrant or embeddings not available)
27
+ """
28
+
29
+ import argparse
30
+ import json
31
+ import os
32
+ import sys
33
+ from urllib.request import Request, urlopen
34
+ from urllib.error import URLError, HTTPError
35
+
36
+ # Resolve path to qdrant-memory scripts
37
+ SKILL_SCRIPTS_DIR = os.path.join(
38
+ os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
39
+ "skills",
40
+ "qdrant-memory",
41
+ "scripts",
42
+ )
43
+ sys.path.insert(0, SKILL_SCRIPTS_DIR)
44
+
45
+ from embedding_utils import (
46
+ check_embedding_service,
47
+ get_embedding_dimension,
48
+ EMBEDDING_PROVIDER,
49
+ EMBEDDING_MODEL,
50
+ )
51
+ from init_collection import create_collection, create_payload_index
52
+
53
+ # Configuration
54
+ QDRANT_URL = os.environ.get("QDRANT_URL", "http://localhost:6333")
55
+ COLLECTIONS = ["agent_memory", "semantic_cache"]
56
+
57
+
58
+ def check_qdrant() -> dict:
59
+ """Check if Qdrant is running and accessible."""
60
+ try:
61
+ req = Request(f"{QDRANT_URL}/collections", method="GET")
62
+ with urlopen(req, timeout=10) as response:
63
+ data = json.loads(response.read().decode())
64
+ existing = [
65
+ c["name"] for c in data.get("result", {}).get("collections", [])
66
+ ]
67
+ return {"status": "ok", "url": QDRANT_URL, "existing_collections": existing}
68
+ except URLError as e:
69
+ return {
70
+ "status": "error",
71
+ "url": QDRANT_URL,
72
+ "message": str(e),
73
+ "fix": "docker run -d -p 6333:6333 -p 6334:6334 -v qdrant_storage:/qdrant/storage qdrant/qdrant",
74
+ }
75
+
76
+
77
+ def check_ollama() -> dict:
78
+ """Check if Ollama is running and has the embedding model."""
79
+ embed_status = check_embedding_service()
80
+
81
+ if embed_status.get("status") == "ok":
82
+ return embed_status
83
+
84
+ if embed_status.get("status") == "missing_model":
85
+ embed_status["fix"] = f"ollama pull {EMBEDDING_MODEL}"
86
+ return embed_status
87
+
88
+ if embed_status.get("status") == "connection_error":
89
+ embed_status["fix"] = "Install and start Ollama: https://ollama.ai"
90
+ return embed_status
91
+
92
+ return embed_status
93
+
94
+
95
+ def init_collections(force: bool = False) -> list:
96
+ """Initialize required Qdrant collections with correct dimensions."""
97
+ dimension = get_embedding_dimension()
98
+ results = []
99
+
100
+ for collection_name in COLLECTIONS:
101
+ # Check if collection already exists
102
+ try:
103
+ req = Request(f"{QDRANT_URL}/collections/{collection_name}", method="GET")
104
+ with urlopen(req, timeout=10) as response:
105
+ data = json.loads(response.read().decode())
106
+ existing_dim = (
107
+ data.get("result", {})
108
+ .get("config", {})
109
+ .get("params", {})
110
+ .get("vectors", {})
111
+ .get("size")
112
+ )
113
+
114
+ if existing_dim and existing_dim != dimension and force:
115
+ # Delete and recreate with correct dimensions
116
+ del_req = Request(
117
+ f"{QDRANT_URL}/collections/{collection_name}", method="DELETE"
118
+ )
119
+ urlopen(del_req, timeout=10)
120
+ print(
121
+ f" Deleted {collection_name} (was {existing_dim}d, need {dimension}d)"
122
+ )
123
+ elif existing_dim == dimension:
124
+ results.append(
125
+ {
126
+ "collection": collection_name,
127
+ "status": "exists",
128
+ "dimension": existing_dim,
129
+ }
130
+ )
131
+ continue
132
+ elif existing_dim and existing_dim != dimension and not force:
133
+ results.append(
134
+ {
135
+ "collection": collection_name,
136
+ "status": "dimension_mismatch",
137
+ "current": existing_dim,
138
+ "expected": dimension,
139
+ "fix": f"Run with --force to recreate with {dimension}d",
140
+ }
141
+ )
142
+ continue
143
+ except HTTPError as e:
144
+ if e.code != 404:
145
+ results.append(
146
+ {
147
+ "collection": collection_name,
148
+ "status": "error",
149
+ "message": str(e),
150
+ }
151
+ )
152
+ continue
153
+ except URLError:
154
+ results.append(
155
+ {
156
+ "collection": collection_name,
157
+ "status": "error",
158
+ "message": "Cannot connect to Qdrant",
159
+ }
160
+ )
161
+ continue
162
+
163
+ # Create collection
164
+ try:
165
+ create_result = create_collection(
166
+ QDRANT_URL, collection_name, dimension, "cosine"
167
+ )
168
+
169
+ # Create standard payload indexes
170
+ indexes = [
171
+ ("type", "keyword"),
172
+ ("project", "keyword"),
173
+ ("timestamp", "datetime"),
174
+ ("tags", "keyword"),
175
+ ("model", "keyword"),
176
+ ("token_count", "integer"),
177
+ ]
178
+
179
+ for field, field_type in indexes:
180
+ create_payload_index(QDRANT_URL, collection_name, field, field_type)
181
+
182
+ results.append(
183
+ {
184
+ "collection": collection_name,
185
+ "status": "created",
186
+ "dimension": dimension,
187
+ "indexes": len(indexes),
188
+ }
189
+ )
190
+ except Exception as e:
191
+ results.append(
192
+ {"collection": collection_name, "status": "error", "message": str(e)}
193
+ )
194
+
195
+ return results
196
+
197
+
198
+ def main():
199
+ parser = argparse.ArgumentParser(
200
+ description="Initialize AI agent session (Qdrant + Ollama check + collection setup)"
201
+ )
202
+ parser.add_argument(
203
+ "--check-only",
204
+ action="store_true",
205
+ help="Only check prerequisites, don't create collections",
206
+ )
207
+ parser.add_argument(
208
+ "--force",
209
+ action="store_true",
210
+ help="Force re-initialization (recreate collections)",
211
+ )
212
+ parser.add_argument(
213
+ "--json",
214
+ action="store_true",
215
+ help="Output as JSON only (no human-readable messages)",
216
+ )
217
+ args = parser.parse_args()
218
+
219
+ report = {
220
+ "provider": EMBEDDING_PROVIDER,
221
+ "model": EMBEDDING_MODEL,
222
+ "dimension": get_embedding_dimension(),
223
+ "qdrant": {},
224
+ "embeddings": {},
225
+ "collections": [],
226
+ "ready": False,
227
+ }
228
+
229
+ # Step 1: Check Qdrant
230
+ if not args.json:
231
+ print(f"Checking Qdrant at {QDRANT_URL}...")
232
+ qdrant_status = check_qdrant()
233
+ report["qdrant"] = qdrant_status
234
+
235
+ if qdrant_status["status"] != "ok":
236
+ if not args.json:
237
+ print(f" FAILED: {qdrant_status.get('message', 'Unknown error')}")
238
+ print(f" FIX: {qdrant_status.get('fix', 'Check Qdrant installation')}")
239
+ if args.json:
240
+ print(json.dumps(report, indent=2))
241
+ sys.exit(2)
242
+ else:
243
+ if not args.json:
244
+ print(f" OK. Collections: {qdrant_status.get('existing_collections', [])}")
245
+
246
+ # Step 2: Check embedding service
247
+ if not args.json:
248
+ print(f"Checking embedding service ({EMBEDDING_PROVIDER}/{EMBEDDING_MODEL})...")
249
+ embed_status = check_ollama()
250
+ report["embeddings"] = embed_status
251
+
252
+ if embed_status.get("status") != "ok":
253
+ if not args.json:
254
+ print(f" FAILED: {embed_status.get('message', 'Unknown error')}")
255
+ if embed_status.get("fix"):
256
+ print(f" FIX: {embed_status['fix']}")
257
+ if args.json:
258
+ print(json.dumps(report, indent=2))
259
+ sys.exit(2)
260
+ else:
261
+ if not args.json:
262
+ print(f" OK. Model: {EMBEDDING_MODEL} ({get_embedding_dimension()}d)")
263
+
264
+ # Step 3: Initialize collections
265
+ if not args.check_only:
266
+ if not args.json:
267
+ print(
268
+ f"Initializing collections (dimension={get_embedding_dimension()})..."
269
+ )
270
+ collection_results = init_collections(force=args.force)
271
+ report["collections"] = collection_results
272
+
273
+ for cr in collection_results:
274
+ if not args.json:
275
+ status = cr["status"]
276
+ name = cr["collection"]
277
+ if status == "created":
278
+ print(
279
+ f" CREATED: {name} ({cr['dimension']}d, {cr['indexes']} indexes)"
280
+ )
281
+ elif status == "exists":
282
+ print(f" EXISTS: {name} ({cr['dimension']}d)")
283
+ elif status == "dimension_mismatch":
284
+ print(
285
+ f" MISMATCH: {name} (current={cr['current']}d, expected={cr['expected']}d)"
286
+ )
287
+ print(f" FIX: {cr.get('fix', '')}")
288
+ else:
289
+ print(f" ERROR: {name} - {cr.get('message', '')}")
290
+ else:
291
+ if not args.json:
292
+ print("Skipping collection initialization (--check-only)")
293
+
294
+ # Final status
295
+ all_ok = qdrant_status["status"] == "ok" and embed_status.get("status") == "ok"
296
+
297
+ if not args.check_only:
298
+ all_ok = all_ok and all(
299
+ cr["status"] in ("created", "exists")
300
+ for cr in report.get("collections", [])
301
+ )
302
+
303
+ report["ready"] = all_ok
304
+
305
+ if not args.json:
306
+ if all_ok:
307
+ print(f"\nSession initialized. Memory system ready.")
308
+ print(f" Provider: {EMBEDDING_PROVIDER} ({EMBEDDING_MODEL})")
309
+ print(f" Dimension: {get_embedding_dimension()}")
310
+ print(f" Qdrant: {QDRANT_URL}")
311
+ else:
312
+ print(f"\nSession initialization incomplete. See errors above.")
313
+ else:
314
+ print(json.dumps(report, indent=2))
315
+
316
+ sys.exit(0 if all_ok else 1)
317
+
318
+
319
+ if __name__ == "__main__":
320
+ main()
@@ -1,6 +1,45 @@
1
- requests
2
- beautifulsoup4
3
- html2text
4
- lxml
5
- qdrant-client
6
- boto3 # for bedrock/aws skills
1
+ # =============================================================================
2
+ # AGI Agent Kit — Python Dependencies
3
+ # =============================================================================
4
+ # Install all: pip install -r requirements.txt
5
+ # Install core: pip install -r requirements.txt (same — optional deps won't break if missing)
6
+ #
7
+ # The framework gracefully degrades when optional packages are missing.
8
+ # Core scripts will work with just the [Core] section.
9
+ # =============================================================================
10
+
11
+ # ---------------------
12
+ # Core (Required)
13
+ # ---------------------
14
+ requests # HTTP client — used by most scripts
15
+ beautifulsoup4 # HTML parsing — webcrawler, scraping
16
+ html2text # HTML to Markdown conversion
17
+ lxml # Fast XML/HTML parser for beautifulsoup4
18
+ pyyaml # YAML parsing — system_checkup.py, SKILL.md frontmatter
19
+
20
+ # ---------------------
21
+ # Memory System
22
+ # ---------------------
23
+ qdrant-client # Vector database client — semantic cache & long-term memory
24
+
25
+ # ---------------------
26
+ # Embeddings (for memory system)
27
+ # ---------------------
28
+ ollama # Local embedding model interface (nomic-embed-text)
29
+ sentence-transformers # Alternative embedding provider (HuggingFace models)
30
+
31
+ # ---------------------
32
+ # Cloud & Infrastructure
33
+ # ---------------------
34
+ boto3 # AWS SDK — Bedrock, S3, EKS, Lambda, etc.
35
+
36
+ # ---------------------
37
+ # Documentation & Quality
38
+ # ---------------------
39
+ gitpython # Git integration — change detection, changelog generation
40
+
41
+ # ---------------------
42
+ # Testing & Auditing
43
+ # ---------------------
44
+ playwright # Browser automation — E2E testing, Lighthouse audits
45
+ pyright # Python type checker — static analysis & diagnostics
@@ -84,8 +84,8 @@ Executable code (Python/Bash/etc.) for tasks that require deterministic reliabil
84
84
  Documentation and reference material intended to be loaded as needed into context to inform the agent's process and thinking.
85
85
 
86
86
  - **When to include**: For documentation that the agent should reference while working
87
- - **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
88
- - **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
87
+ - **Examples**: `references/finance.md` for financial schemas, `references/api_docs.md` for API specifications, `references/style_guide.md` for coding standards
88
+ - **Use cases**: Database schemas, API documentation, domain knowledge, style guides, detailed workflow guides
89
89
  - **Benefits**: Keeps SKILL.md lean, loaded only when the agent determines it's needed
90
90
  - **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
91
91
  - **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
@@ -293,7 +293,7 @@ When editing the (newly-generated or existing) skill, remember that the skill is
293
293
 
294
294
  #### Learn Proven Design Patterns
295
295
 
296
- Consult these helpful guides based on your skill's needs:
296
+ Review these helpful guides based on your skill's needs:
297
297
 
298
298
  - **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic
299
299
  - **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns
File without changes
File without changes