Cursor Rules: Embedding Flavor
Defines embedding generation, validation, and troubleshooting workflows for a Neo4j vector database in a DUX object model.
What this file does
Defines embedding generation, validation, and troubleshooting workflows for a Neo4j vector database in a DUX object model.
When to use it
- Building semantic search over structured objects with vector embeddings
- Setting up hybrid search combining vector similarity and graph relationships
- Implementing batch or real-time embedding pipelines for object models
- Monitoring and optimizing vector index health and search performance
Assumes this stack
Cursor Rules: Embedding Flavor
Embedding generation, validation, and troubleshooting workflows
include: .cursorrules.base
Embedding Architecture
- Vector Storage: Neo4j vector database for DUX object embeddings
- Multi-Modal: Support for text, structured data, and metadata embeddings
- Real-Time: Generate embeddings on-demand for new objects
- Batch Processing: Efficient bulk embedding generation
Embedding Models
- Text Embeddings: Semantic search for DUX object content
- Structured Embeddings: Vector representations of JSON schemas
- Metadata Embeddings: Embed tags, relationships, and context
- Hybrid Search: Combine vector similarity with graph relationships
Vector Index Management
- Index Creation: Automatic index creation for new object types
- Index Optimization: Tune parameters for search performance
- Index Maintenance: Regular reindexing and cleanup
- Index Monitoring: Track index health and performance
Embedding Generation Workflow
- Object Validation: Ensure DUX objects pass schema validation
- Text Extraction: Extract searchable text from object fields
- Embedding Creation: Generate vector representations
- Index Storage: Store embeddings in Neo4j vector indices
- Metadata Linking: Link embeddings to original objects
Search Patterns
- Semantic Search: Find similar DUX objects by meaning
- Evidence Search: Find objects with similar evidence patterns
- Relationship Search: Find objects connected by common themes
- Temporal Search: Find objects by creation or update time
Quality Assurance
- Embedding Validation: Verify embedding quality and consistency
- Search Accuracy: Test search results against known relationships
- Performance Testing: Measure search speed and accuracy
- A/B Testing: Compare different embedding strategies
Troubleshooting Workflows
- Index Corruption: Detect and repair corrupted vector indices
- Embedding Drift: Monitor for embedding quality degradation
- Search Failures: Debug and fix search query issues
- Performance Issues: Optimize slow search operations
Optimization Strategies
- Dimensionality Reduction: Optimize embedding dimensions for performance
- Batch Processing: Efficient bulk embedding operations
- Caching: Cache frequently accessed embeddings
- Compression: Compress embeddings for storage efficiency
Monitoring & Analytics
- Search Metrics: Track search performance and accuracy
- Embedding Quality: Monitor embedding consistency and relevance
- Index Health: Monitor vector index performance
- Usage Patterns: Analyze search behavior and patterns
Integration Patterns
- API Integration: Embedding generation via REST APIs
- Event-Driven: Generate embeddings on object creation/update
- Scheduled Jobs: Batch embedding generation for large datasets
- Real-Time Updates: Immediate embedding updates for critical objects
Security & Privacy
- Data Sanitization: Remove PII before embedding generation
- Access Control: Secure access to embedding generation APIs
- Audit Trail: Track embedding generation and usage
- Encryption: Encrypt embeddings in transit and at rest
Performance Tuning
- Index Parameters: Optimize Neo4j vector index settings
- Query Optimization: Efficient search query patterns
- Resource Allocation: Optimize CPU and memory usage
- Scaling: Horizontal scaling for high-volume embedding operations
What's inside
14 sections covering architecture, models, index management, workflows, search, QA, troubleshooting, optimization, monitoring, integration, security, and tuning.
Change this for your project
- Replace
DUXwith your own object model name throughout - Replace
Neo4jwith your vector database if different - Replace
dux-object-model-corewith your repository name
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separate embedding quality monitoring from search performance monitoring
- Include data sanitization and access control in embedding pipelines
Related Documents
dbt Core
Defines a complete dbt project setup with layered architecture, SQL style, Jinja best practices, and CI/CD workflow guidance.
HarmonyOS 主题与样式 - Cursor Rules
Defines HarmonyOS theming rules for dark/light mode, page brightness, and screen-on control with code examples.
Cursor Development Environment
Documents a Docker-based dev container setup with test commands and OpenClaw agent configuration for the ClawDrive project.
Journey from Concept to Code: Transforming Cursor into a Devin-like AI Assistant
Documents the creation of aicode.cursorrules, a set of rules that turns Cursor/Windsurf into a Devin-like AI assistant with automated planning and self-evolution.