Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ce55ddb
docs: update specifications for Phase 2 completion
francescoscalzo Mar 14, 2026
8609ce9
chore: bump version to 0.2.0 and update CHANGELOG
francescoscalzo Mar 14, 2026
00a6a21
fix(admin): prevent namespace override via query param in write requests
francescoscalzo Mar 14, 2026
ad1f015
fix(index): correct SQLAlchemy text().columns() usage in sparse search
francescoscalzo Mar 14, 2026
cb55c0e
fix(index): skip compensating delete on Qdrant upsert timeout
francescoscalzo Mar 14, 2026
612a84f
chore: add migration 0006 for deletion_reason CHECK and fix __version__
francescoscalzo Mar 14, 2026
e783596
fix(index): handle race condition in Qdrant collection creation
francescoscalzo Mar 14, 2026
8062396
fix(core): make conversation persistence best-effort
francescoscalzo Mar 14, 2026
e2654a3
fix(admin): only cache successful key verifications
francescoscalzo Mar 14, 2026
4515721
fix(core): fail closed on safeguard misconfiguration
francescoscalzo Mar 14, 2026
35bc42e
fix(admin): guard against non-object JSON in RLS namespace resolution
francescoscalzo Mar 14, 2026
a6a79dd
fix(core): recheck no_relevant_context after post_retrieval safeguard
francescoscalzo Mar 14, 2026
a900dcd
fix(admin): authenticate logout, handle duplicate namespace, fix audi…
francescoscalzo Mar 14, 2026
8d4f2a0
fix(scripts): include .md files in batch-ingest supported formats
francescoscalzo Mar 14, 2026
10f645b
chore: fix remaining __version__ and Makefile reindex description
francescoscalzo Mar 14, 2026
7b51fce
fix(index): detect qdrant-client timeout exceptions correctly
francescoscalzo Mar 14, 2026
d1c0234
style(admin): update cache comment to match only-True caching behavior
francescoscalzo Mar 14, 2026
729c758
fix(admin): add microsecond precision to audit pagination cursor
francescoscalzo Mar 14, 2026
f89e27c
docs(backlog): add 5 debt items from PR #38 review, mark 3 completed
francescoscalzo Mar 14, 2026
5a93a1a
Merge pull request #38 from vektralabs/release/v0.2.0
francescoscalzo Mar 15, 2026
fa03257
chore: sync main into develop to resolve diverged history
fvadicamo Mar 21, 2026
9b503ac
fix(core): restore graceful safeguard fallback lost in main merge
fvadicamo Mar 21, 2026
5298a03
fix: resolve 3 critical issues from PR #45 review
fvadicamo Mar 21, 2026
29f830e
fix(core): add post_retrieval recheck in streaming path
fvadicamo Mar 21, 2026
ceb8957
style: address PR #45 nitpick review comments
fvadicamo Mar 21, 2026
077b349
fix(admin): use helper tail as audit verb to distinguish actions
fvadicamo Mar 22, 2026
ed14094
docs(arch): fix version history chronological order
fvadicamo Mar 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .s2s/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Split criteria defined in [ADR-0002](decisions/ADR-0002-repo-split-criteria.md).
## Cross-Cutting Concerns

<!-- Populated by /s2s:design -->
- **Authentication**: API key authentication with argon2id hashing, scoped permissions (admin/ingest/query per REQ-031, multiple scopes per key). Single trust boundary at vektra-core gateway. Rate limiting slot in middleware (Phase 2 enforcement). See [ADR-0010](decisions/ADR-0010-authentication-gateway.md).
- **Authentication**: API key authentication with argon2id hashing, scoped permissions (admin/ingest/query per REQ-031, multiple scopes per key). Single trust boundary at vektra-core gateway. Rate limiting enforced via per-key RPM in middleware. See [ADR-0010](decisions/ADR-0010-authentication-gateway.md).
- **Authorization**: Namespace isolation via PostgreSQL RLS policies. Application-level filtering for Phase 1, RLS binding via feature flag for multi-tenant activation. Namespace as first-class entity with metadata (ARCH-047). See [ADR-0009](decisions/ADR-0009-namespace-isolation-rls.md).
- **Logging**: structlog with JSON output, PII redaction processors. Correlation ID propagation across sync calls and arq jobs. OpenTelemetry spans at module boundaries. QueryTrace (ARCH-041) for RAG-specific observability, separate from audit log.
- **Monitoring**: Prometheus metrics on /metrics via starlette-prometheus. Hierarchical health endpoints (GET /health, GET /health/{component}). Memory observability via GET /health/memory.
Expand All @@ -60,18 +60,18 @@ Split criteria defined in [ADR-0002](decisions/ADR-0002-repo-split-criteria.md).

| Component | Role | Phase |
|-----------|------|-------|
| vektra-core | RAG engine, LLM abstraction, conversation management, safeguards | 1 |
| vektra-ingest | Document processing pipeline (PDF, OCR, PPT, Word) | 1 |
| vektra-index | Vector store abstraction, embedding, semantic search | 1 |
| vektra-analytics | Metrics aggregation, reporting API, alerting | 2 |
| vektra-learn | E-learning vertical backend (LMS-agnostic) | 2 |
| vektra-admin | System administration interface | 1 (minimal), 2 (full) |
| vektra-core | RAG engine, LLM abstraction, conversation management, safeguards, advanced pipeline | 1, 2 |
| vektra-ingest | Document processing pipeline (PDF, OCR, PPT, Word), versioning, batch ops | 1, 2 |
| vektra-index | Vector store abstraction, embedding, hybrid search (dense+sparse) | 1, 2 |
| vektra-analytics | QueryTrace storage, metrics aggregation, reporting API | 2 (completed) |
| vektra-learn | E-learning vertical backend (LMS-agnostic), chatbot widget | 2 (completed) |
| vektra-admin | System administration interface (HTMX + Jinja2 dashboard) | 1 (minimal), 2 (full) |

### Separate repositories

| Component | Role | Reason | Phase |
|-----------|------|--------|-------|
| vektra-moodle | Moodle LMS adapter (PHP plugin) | PHP, Moodle Plugin Directory, different lifecycle | 2 |
| vektra-moodle | Moodle LMS adapter (PHP plugin) | PHP, Moodle Plugin Directory, different lifecycle | 2 (not started) |
| vektra-sdk-py | Python SDK | Published to PyPI, independent versioning | 3 |
| vektra-sdk-js | JavaScript/TypeScript SDK | Published to npm, independent versioning | 3 |

Expand Down Expand Up @@ -103,12 +103,12 @@ vektra-moodle ──────────────── (integrates learn

See [requirements.md](requirements.md) for the complete Software Requirements Specification.

**Key Phase 1 deliverables**:
**Key deliverables**:
- 60 approved functional requirements (REQ-001 to REQ-065, some IDs unused)
- 5 business rules
- 13 non-functional requirements (8 HARD, 5 TARGET)
- 14 explicit exclusions (Phase 2/3 deferrals)
- 7 open questions (1 resolved, remainder deferred to design or Phase 2)
- 14 explicit exclusions (7 resolved in Phase 2, 7 remaining for Phase 3+)
- 7 open questions (4 resolved)

**Primary user persona**: Platform Operator (DevOps/platform teams)
**MVP exit criterion**: 30 minutes from git clone to successful query
Expand All @@ -119,28 +119,28 @@ See [architecture.md](architecture.md) for complete architecture documentation.

**Architectural style**: Modular monolith for Phase 1. Single deployable container with internal package boundaries. See [ADR-0003](decisions/ADR-0003-modular-monolith-phase1.md).

**Deployment**: Docker Compose stack: vektra + postgres (always), ollama (profile: local-llm), qdrant (profile: qdrant, Phase 2). See [ADR-0004](decisions/ADR-0004-minimal-docker-compose-stack.md), [ADR-0012](decisions/ADR-0012-docker-compose-spec.md).
**Deployment**: Docker Compose stack: vektra + postgres (always), ollama (profile: local-llm), qdrant (profile: qdrant). See [ADR-0004](decisions/ADR-0004-minimal-docker-compose-stack.md), [ADR-0012](decisions/ADR-0012-docker-compose-spec.md).

**Key technology choices**:
- Web framework: FastAPI 0.115+ with Pydantic v2
- LLM abstraction: litellm (~5MB footprint)
- Embeddings: sentence-transformers (all-MiniLM-L6-v2) via EmbeddingProvider Protocol
- Vector store: pgvector (PostgreSQL extension) via VectorStoreProvider Protocol
- Background tasks: arq with PostgreSQL job persistence
- PDF extraction: pdfplumber (Phase 1), Unstructured (Phase 2) via DocumentExtractor Protocol
- PDF extraction: pdfplumber (default), Unstructured (optional, INSTALL_UNSTRUCTURED=true) via DocumentExtractor Protocol
- Content type detection: python-magic (magic bytes)
- ORM: SQLAlchemy 2.0 async with asyncpg (ORM models internal to modules, Pydantic models as public API)

**Protocol interfaces** (9 defined in vektra_shared):
- LLMProvider: multi-provider LLM abstraction with graceful degradation
- EmbeddingProvider: shared embedding generation with asymmetric model support
- SparseEmbeddingProvider: sparse vector generation for hybrid search (ARCH-053). Phase 1: not registered. Phase 2: BM25 or SPLADE via fastembed
- VectorStoreProvider: pluggable vector store with SearchMode, metadata filtering, index versioning, raw_filters escape hatch, full-store contract (ARCH-051), provider-specific atomicity (ARCH-052). Phase 2 candidate: Qdrant
- DocumentExtractor: PDF, Word, PowerPoint extraction with extended element classification (10 ElementType values)
- ChunkingStrategy: pluggable chunking (fixed-size Phase 1, dual-strategy Phase 2)
- QueryPipeline: RAG pipeline abstraction returning QueryResponse + QueryTrace. Phase 2: AdvancedQueryPipeline with query rewriting (ARCH-061), reranking, hybrid search
- SparseEmbeddingProvider: sparse vector generation for hybrid search (ARCH-053). Phase 1: not registered. Phase 2: FastEmbedBM25Provider via fastembed
- VectorStoreProvider: pluggable vector store with SearchMode, metadata filtering, index versioning, raw_filters escape hatch, full-store contract (ARCH-051), provider-specific atomicity (ARCH-052). Phase 2: QdrantVectorStoreProvider with native DENSE/SPARSE/HYBRID
- DocumentExtractor: PDF, Word, PowerPoint extraction with extended element classification (10 ElementType values). Phase 2: UnstructuredExtractor with OCR support
- ChunkingStrategy: pluggable chunking. FixedSizeChunking (Phase 1), DualStrategyChunking with semantic splitting (Phase 2)
- QueryPipeline: RAG pipeline abstraction returning QueryResponse + QueryTrace. Phase 2: AdvancedQueryPipeline with query rewriting (ARCH-061), reranking, hybrid search (implemented)
- SafeguardHook: pre/post query safeguards (3 trust boundary points) with content modification support (ARCH-049)
- EventEmitter: internal event hooks (NoOp Phase 1, webhooks Phase 2)
- EventEmitter: internal event hooks. NoOpEventEmitter (Phase 1), LogEventEmitter (Phase 2)

**Key decisions** (64 total, 25 ADRs):
- [ADR-0003](decisions/ADR-0003-modular-monolith-phase1.md): Modular monolith for Phase 1
Expand Down Expand Up @@ -173,4 +173,4 @@ See [architecture.md](architecture.md) for complete architecture documentation.

---

*Last updated: 2026-03-01*
*Last updated: 2026-03-14*
Loading
Loading