Goal
Implement client-side vector database for semantic ability selection, with automated testing framework for NLP input validation.
Part 1: Vector Database Implementation
Architecture
- Embeddings model: all-MiniLM-L6-v2 via transformers.js (~80MB)
- Vector store: hnswlib-wasm OR simple cosine similarity (if only 12 abilities)
- Flow:
- User input → embedding
- Similarity search → top 3-4 relevant abilities
- Pass only those to ReAct loop (not all 12)
Embedding Data
For each ability, embed:
- Name + description
- Example trigger phrases
- Keywords
- Expected outcomes
Benefits
- Reduced context: Small model sees 3-4 abilities instead of 12
- Better accuracy: More relevant tool suggestions
- Privacy-first: All embeddings computed client-side
- Semantic matching: "site is slow" matches cache-flush + db-optimize, not error-log-read
Part 2: NLP Testing Framework
Goal
Unit-test-style validation for vector DB quality. Essential for hackathon team iteration.
Test Structure
const nlpTests = [
{
input: "my site is slow",
expectedAbilities: ["cache-flush", "db-optimize", "site-health"],
notExpected: ["error-log-read", "plugin-activate"]
},
{
input: "500 error on homepage",
expectedAbilities: ["error-log-read", "plugin-list", "site-health"],
notExpected: ["cache-flush", "revision-cleanup"]
},
{
input: "need to clean up database",
expectedAbilities: ["db-optimize", "revision-cleanup", "transient-flush"],
notExpected: ["plugin-activate", "rewrite-flush"]
}
];
Test Runner
- Run similarity search for each test input
- Verify top-K results match expected abilities
- Flag mismatches
- Output: Pass/Fail with similarity scores
- CI-friendly (can run in GitHub Actions)
Iteration Workflow (for hackathon team)
- Tester adds new NLP input example
- Runs test suite
- If fails, adjusts ability embeddings (description, keywords)
- Re-runs tests
- Repeat until all pass
Test Output Example
✅ "my site is slow" → cache-flush (0.89), db-optimize (0.85), site-health (0.78)
❌ "500 error" → Expected error-log-read (0.92) ✅, plugin-list (0.65) ✅, but got cache-flush (0.71) ❌
Implementation Files
src/
├── services/
│ ├── embeddings.js # transformers.js wrapper
│ ├── vector-store.js # similarity search
│ └── ability-matcher.js # top-K retrieval
└── __tests__/
├── nlp-ability-matching.test.js # main test suite
└── fixtures/
└── test-cases.json # test inputs + expectations
Success Criteria
Priority
High - critical for vector DB quality validation
Deadline
Target: March 8 (1 week before CloudFest for team iteration)
Resources
Goal
Implement client-side vector database for semantic ability selection, with automated testing framework for NLP input validation.
Part 1: Vector Database Implementation
Architecture
Embedding Data
For each ability, embed:
Benefits
Part 2: NLP Testing Framework
Goal
Unit-test-style validation for vector DB quality. Essential for hackathon team iteration.
Test Structure
Test Runner
Iteration Workflow (for hackathon team)
Test Output Example
Implementation Files
Success Criteria
Priority
High - critical for vector DB quality validation
Deadline
Target: March 8 (1 week before CloudFest for team iteration)
Resources