Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
f3f79ef
chore: bump version to 0.4.0-dev and close Sprint 1 items
fvadicamo Mar 22, 2026
56e2e20
Merge pull request #49 from vektralabs/chore/post-v030-sprint2-prep
fvadicamo Mar 22, 2026
fb495dc
feat(widget): add API connectivity check and error feedback (FEAT-006)
fvadicamo Mar 22, 2026
0269f05
feat(learn): enable SSE streaming in learn query endpoint (FEAT-010)
fvadicamo Mar 22, 2026
aeee296
feat(widget): add markdown rendering for assistant messages (FEAT-007)
fvadicamo Mar 22, 2026
afc5d53
feat(widget): add token auto-refresh on expiry (FEAT-009)
fvadicamo Mar 22, 2026
2994bc2
fix(widget): address self-review issues
fvadicamo Mar 22, 2026
5c1afe8
fix(widget): fix streaming token newlines and formatting
fvadicamo Mar 22, 2026
1ce5db7
fix(widget): prevent <p> wrapping inside code blocks
fvadicamo Mar 22, 2026
633444f
fix(learn): send conversation_id in SSE stream done event
fvadicamo Mar 22, 2026
f70cba9
fix(widget): address PR review findings (security, UX, robustness)
fvadicamo Mar 23, 2026
2fa0ad1
style(widget): fix documentation and add noreferrer to links
fvadicamo Mar 23, 2026
05d90c0
fix(widget): centralize input disabled state from sending and connect…
fvadicamo Mar 23, 2026
21ce58c
Merge pull request #50 from vektralabs/feat/widget-production-ready
fvadicamo Mar 23, 2026
0d31f67
fix(core): restructure RAG prompt to prevent chunk/user message confu…
fvadicamo Mar 23, 2026
43f7700
fix(core): instruct LLM to not expose RAG internals to end users
fvadicamo Mar 23, 2026
72961f7
chore(backlog): add observability entries (BUG-013, DEBT-009, INFRA-0…
fvadicamo Mar 23, 2026
e35cc7f
Merge pull request #51 from vektralabs/fix/rag-prompt-structure
fvadicamo Mar 24, 2026
0449005
fix(core): register conversation store in provider registry
fvadicamo Mar 24, 2026
8d13600
chore(backlog): add BUG-014 conversation persistence gap
fvadicamo Mar 24, 2026
fb8b500
docs(claude): add API interaction directive
fvadicamo Mar 24, 2026
d965db5
fix(core): create conversation row before first turn (BUG-014)
fvadicamo Mar 24, 2026
2b82c70
fix(core): prevent LLM from exposing RAG internals in any language
fvadicamo Mar 24, 2026
a367668
fix(core): tighten system prompt against implicit RAG exposure
fvadicamo Mar 24, 2026
d06dba6
fix(core): simplify system prompt to improve LLM compliance
fvadicamo Mar 24, 2026
86bae67
fix(core): rewrite system prompt following RAG best practices research
fvadicamo Mar 24, 2026
e212146
fix(core): wire VEKTRA_LLM_API_KEY to litellm and add extra_body support
fvadicamo Mar 24, 2026
a34a551
refactor(learn): clean up conversation persistence code
fvadicamo Mar 24, 2026
d717714
chore(backlog): add BUG-015, BUG-016, TECH-002, DEBT-010 for retrieva…
fvadicamo Mar 24, 2026
2fbec58
fix(build): harden supply chain - eliminate uv pip install outside lo…
fvadicamo Mar 24, 2026
838b40e
fix(core): propagate reranker scores to SearchResult (BUG-015)
fvadicamo Mar 24, 2026
861eae8
feat(core): switch to multilingual reranker and lower threshold (BUG-…
fvadicamo Mar 24, 2026
3484d00
feat(eval): add retrieval and e2e evaluation harness (TECH-002)
fvadicamo Mar 24, 2026
54ee412
fix(eval): add --use-query flag to eval_retrieval for reranker evalua…
fvadicamo Mar 24, 2026
08ccf95
feat(eval): curate 55-question bilingual dataset for retrieval evalua…
fvadicamo Mar 25, 2026
d95c31b
chore(backlog): add BUG-017, mark BUG-015/016/TECH-002/DEBT-010 compl…
fvadicamo Mar 25, 2026
372e56c
chore(backlog): add DEBT-011 conversation and query trace observabili…
fvadicamo Mar 25, 2026
5d95486
docs(claude): add DB investigation and search vs query pipeline guidance
fvadicamo Mar 25, 2026
ffbc9b2
fix(core): add VEKTRA_LLM_CONTEXT_WINDOW and warn on fallback (BUG-017)
fvadicamo Mar 25, 2026
6685f7f
chore(backlog): mark BUG-017 completed
fvadicamo Mar 25, 2026
f31b588
fix(config): forward VEKTRA_LLM_CONTEXT_WINDOW through VektraSettings
fvadicamo Mar 25, 2026
8018987
fix(eval): exclude keyword-less entries from retrieval metrics
fvadicamo Mar 25, 2026
ba56947
test(core): assert first warning emitted in warn-once tests
fvadicamo Mar 25, 2026
777b4db
fix(eval): do not mark transport errors as no_relevant_context
fvadicamo Mar 25, 2026
fe910a4
docs(config): add VEKTRA_LLM_EXTRA_BODY to LLM reference table
fvadicamo Mar 25, 2026
bca0e6a
docs(claude): remove hardcoded Qdrant port, clarify search vs query
fvadicamo Mar 25, 2026
1a8eb14
fix(build): avoid redundant uv sync when INSTALL_UNSTRUCTURED=true
fvadicamo Mar 25, 2026
026b870
chore(backlog): add BUG-018 SSE conversation_id not returned to client
fvadicamo Mar 25, 2026
35cfb57
fix(ci): reduce perf measurement queries from 100 to 20
fvadicamo Mar 25, 2026
a483f1e
fix(ci): skip latency measurement on PR, run only post-merge
fvadicamo Mar 25, 2026
4f2fa6a
style(eval): minor fixes from review round 2
fvadicamo Mar 25, 2026
e9d7bd0
Merge pull request #52 from vektralabs/fix/conversation-persistence
fvadicamo Mar 25, 2026
4a71be0
chore(backlog): mark BUG-012 and BUG-014 completed, update date
fvadicamo Mar 28, 2026
d031d4d
feat(observability): persist QueryTrace and add admin conversation tu…
fvadicamo Mar 28, 2026
759ae3b
chore(backlog): add observability and RAG quality entries from analys…
fvadicamo Mar 28, 2026
b7fee00
chore(backlog): review fixes - update statuses, refine FEAT-020 prompt
fvadicamo Mar 28, 2026
3d29027
chore(backlog): add DEBT-016 for unused conversation.j2 cleanup
fvadicamo Mar 28, 2026
3794e79
chore(backlog): add per-namespace grounding mode to FEAT-020
fvadicamo Mar 28, 2026
75266b6
chore(backlog): add FEAT-021 optional source citations per namespace
fvadicamo Mar 28, 2026
b6262cd
fix(observability): address PR review comments
fvadicamo Mar 31, 2026
300af6a
Merge pull request #53 from vektralabs/fix/query-trace-observability
fvadicamo Apr 3, 2026
a2d940d
feat(prompt): add configurable grounding mode strict/hybrid (FEAT-020…
fvadicamo Apr 3, 2026
6536eb5
fix(config): add grounding_mode validator to VektraSettings
fvadicamo Apr 3, 2026
8568f52
style(prompt): trim template whitespace and add hybrid pipeline tests
fvadicamo Apr 3, 2026
b55e50c
style(review): address PR #54 review comments
fvadicamo Apr 3, 2026
0979003
docs(plans): archive implementation plans for recent work
fvadicamo Apr 4, 2026
a691778
Merge pull request #54 from vektralabs/feat/prompt-grounding-mode
fvadicamo Apr 7, 2026
0b21331
feat(observability): add reranker scores, fix streaming model name, e…
fvadicamo Apr 7, 2026
00aaed8
test(observability): add eval_mode gating tests and fix os shadowing
fvadicamo Apr 7, 2026
cf7162a
style(review): address PR #55 review comments
fvadicamo Apr 7, 2026
0e4460c
fix(observability): stabilize eval_mode metadata across all rewrite p…
fvadicamo Apr 8, 2026
8ef3c76
test(observability): add eval_mode gating tests for skip and error re…
fvadicamo Apr 9, 2026
09f14cb
docs(backlog): update status for items completed in PRs #53-#55
fvadicamo Apr 9, 2026
bf92d1a
Merge pull request #55 from vektralabs/feat/pipeline-observability
fvadicamo Apr 9, 2026
6210cbc
fix(core): address release review findings for v0.4.0
fvadicamo Apr 9, 2026
1d2b26e
fix(core): resolve mypy type errors in safeguard and history changes
fvadicamo Apr 9, 2026
b9f8c0c
fix(core): distinguish safeguard block from no-context in response
fvadicamo Apr 9, 2026
14f0dd2
fix(eval): improve eval harness accuracy and correctness
fvadicamo Apr 9, 2026
f2be47d
fix(admin): add audit logging for conversation turns endpoint
fvadicamo Apr 9, 2026
8c9a5db
style(review): add namespace to audit metadata and test audit assertion
fvadicamo Apr 9, 2026
67f2c3d
fix(eval): strip apostrophes in keyword normalization, fix docstring
fvadicamo Apr 9, 2026
5b10825
Merge pull request #57 from vektralabs/fix/release-review-v040
fvadicamo Apr 10, 2026
b2c0821
ci(integration): remove query latency step that requires LLM
fvadicamo Apr 11, 2026
94437a3
Merge pull request #58 from vektralabs/ci/remove-latency-step
fvadicamo Apr 11, 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
32 changes: 32 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

@../.s2s/CONTEXT.md

## API interaction

Before making **any** API call (curl, httpie, scripts), consult `docs/reference/api.md` or the live OpenAPI spec at `/openapi.json` to verify:
- Authentication method and header format
- Parameter names, types, and whether they are query, path, or body params
- Request body field names (e.g. `question` vs `query`)
- Correct endpoint for the task (e.g. `/api/v1/query` for RAG, `/api/v1/search` for raw vector search)

Do not construct API calls from memory or guesswork.

## Database investigation

When querying Postgres directly (psql, DB inspection):
- **Always run `\d table_name` first** to check column names and types. Common pitfalls: `namespace_id` (not `namespace`), `bytea` columns that need decryption, columns that don't exist.
- **Conversation turns are encrypted**: `question` and `answer` are `pgp_sym_encrypt()`'d. To read them: `SELECT pgp_sym_decrypt(question, '<key>') FROM conversation_turns WHERE ...` using `VEKTRA_CONVERSATION_KEY` from `.env`.
- **Postgres holds metadata/text, Qdrant holds vectors**: chunk text is in `document_chunks` (Postgres), but vector search runs against Qdrant (check `VEKTRA_QDRANT_URL` and `VEKTRA_QDRANT_COLLECTION` in config for host/port/collection). To inspect vectors or search results, query Qdrant REST API directly. The Qdrant payload uses `namespace_id` as the namespace filter field.
Comment thread
fvadicamo marked this conversation as resolved.

## Query pipeline vs search endpoint

These are fundamentally different:

| | `/api/v1/search` | `/api/v1/query` |
|--|--|--|
| What it does | Raw vector search (Qdrant only) | Full RAG pipeline |
| Reranker | No | Yes |
| Threshold filter | No | Yes |
| LLM call | No | Yes |
| Field for question | `query` | `question` |
| Response field | `results[].text_snippet` | `sources[].snippet` |

When investigating **end-to-end answer quality** (retrieval + reranking + LLM), use `/api/v1/query`. When investigating **raw retrieval quality** (vector similarity only, no reranker), use `/api/v1/search`.

## Spec2Ship Commands

- `/s2s:specs` - Define requirements via roundtable
Expand Down
13 changes: 10 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
# --------------------------------------------------------------------------

# VEKTRA_QUERY_PIPELINE=advanced
# VEKTRA_MIN_RELEVANCE_SCORE=0.3
# VEKTRA_MIN_RELEVANCE_SCORE=0.15
# VEKTRA_CHUNK_DEDUP_ENABLED=true
# VEKTRA_RESPONSE_TOKEN_RESERVE=2048
# VEKTRA_CONTEXT_CHUNK_RATIO=0.6
Expand All @@ -89,8 +89,8 @@

# Reranking
# VEKTRA_RERANK_ENABLED=true
# VEKTRA_RERANK_PROVIDER=flashrank
# VEKTRA_RERANK_MODEL=
# VEKTRA_RERANK_PROVIDER=cross-encoder
# VEKTRA_RERANK_MODEL=BAAI/bge-reranker-v2-m3
# VEKTRA_RERANK_TOP_K=5

# --------------------------------------------------------------------------
Expand All @@ -112,6 +112,13 @@
# Fallback model when primary times out.
# VEKTRA_LLM_FALLBACK_MODEL=
# VEKTRA_LLM_FALLBACK_TIMEOUT_MS=60000
# VEKTRA_LLM_CONTEXT_WINDOW= # Required for models not in litellm registry (e.g. local vLLM).
# Set to the model's actual context length. Check your provider:
# vLLM: curl /v1/models → max_model_len
# Ollama: ollama show <model> → context_length
# If unset, litellm tries to look it up; for unknown models it falls back
# to 4096, which causes most retrieved chunks to be discarded (BUG-017).
# Examples: Qwen 3.5 27B → 262144, Llama 3 8B → 8192, GPT-4o → 128000
# VEKTRA_LLM_CONTEXT_ONLY_ENABLED=true

# --------------------------------------------------------------------------
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
integration:
name: Integration tests + NFR gates
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 30

steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -72,15 +72,9 @@ jobs:
VEKTRA_BOOTSTRAP_KEY: ci-bootstrap-key
STARTUP_MS: ${{ steps.startup.outputs.startup_ms }}

- name: Query latency measurement (warn only)
if: always() && !cancelled()
continue-on-error: true
run: |
uv run pytest tests/nfr/test_performance.py \
-v --tb=short --junitxml=test-results/performance.xml
env:
VEKTRA_API_URL: http://localhost:8000
VEKTRA_BOOTSTRAP_KEY: ci-bootstrap-key
# Query latency measurement removed from CI: requires a live LLM
# which is not available in GitHub Actions. Run manually on Kalypso:
# uv run pytest tests/nfr/test_performance.py -v

- name: Dump container logs on failure
if: failure()
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ vektra-learn/static/
coverage/
.nyc_output/

# Evaluation results (generated by eval harness)
tests/eval/results_*.jsonl

# Temporary files
tmp/
temp/
Expand Down
Loading
Loading