# Technical Specification - Vector Store

**Version**: v1.0.0 | **Status**: Active | **Last Updated**: February 2026

**Module**: `codomyrmex.vector_store`  
**Last Updated**: February 2026

## 1. Purpose

Embeddings storage with pluggable backends for similarity search, supporting multiple distance metrics and namespace isolation.

## 2. Architecture

```
vector_store/
├── __init__.py          # Core implementation
├── README.md            # Documentation
├── AGENTS.md            # Agent guidelines
├── SPEC.md              # This file
└── PAI.md               # Personal AI context
```

## 3. Public API

```python
from codomyrmex.vector_store import (
    VectorStore,           # ABC for all backends
    InMemoryVectorStore,   # In-memory implementation
    NamespacedVectorStore, # Namespace-aware wrapper
    VectorEntry,           # Single vector entry
    SearchResult,          # Search result with score
    DistanceMetric,        # Static distance functions
    create_vector_store,   # Factory function
    normalize_embedding,   # Utility
)
```

## 4. Distance Metrics

| Metric | Range | Interpretation |
|--------|-------|----------------|
| `cosine` | 0-1 | Higher = more similar |
| `euclidean` | 0-∞ | Lower = more similar |
| `dot_product` | -∞ to ∞ | Higher = more similar |

## 5. Testing

```bash
pytest tests/unit/test_vector_store.py -v
```

## 6. Future Considerations

- Chroma integration
- Pinecone client
- FAISS backend for large-scale
- Persistent SQLite storage

## Dependencies

See `src/codomyrmex/vector_store/__init__.py` for import dependencies.

## Navigation

- **Self**: `SPEC.md`
- **Parent**: [../README.md](../README.md)
- **Readme**: [README.md](README.md)
- **Agents**: [AGENTS.md](AGENTS.md)
- **Repository Root**: [README.md](../../../README.md)
