算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
rag-architect【设计与创意】Design or diagnose RAG ingestion, retrieval, permissions, reranking, citations, and evaluation when answers must be grounded in a specialized corpus.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Design from measured retrieval failures, not from a fashionable vector database or chunk size.
Define:
Do not build RAG when direct context, structured queries, a conventional search index, or a deterministic API is simpler and more reliable.
Create a versioned dataset before tuning:
{
"id": "policy-017",
"query": "Can a contractor export customer data?",
"expected_source_ids": ["policy-access-4.2"],
"required_facts": ["contractors cannot export", "exception requires DPO approval"],
"forbidden_claims": ["contractors always have export access"],
"user_acl": ["policy:employee"],
"as_of": "2026-07-01",
"answerable": true
}
Include:
Keep a held-out set. Do not tune and report on the same examples.
Evaluate retrieval separately from generation.
Always inspect failures by slice. One aggregate score can hide catastrophic permission or freshness failures.
Preserve provenance:
source_id
document_version
canonical_uri
content_hash
effective_at
expires_at
acl
parser_version
chunker_version
indexed_at
Make ingestion idempotent. Support updates and deletions. A deleted or permission-revoked document must stop appearing without rebuilding unrelated content.
Reject or quarantine parser failures instead of silently indexing empty or garbled text.
Select chunking from document structure and evaluation results:
Do not choose a universal token count or overlap percentage without evidence. Record the chunker version so retrieval regressions are reproducible.
Start with the simplest baseline:
Apply authorization before returning content to the model. Post-filtering an over-retrieved unauthorized result set is not a sufficient security boundary.
Use query rewriting only when it measurably helps specific query classes. Preserve the original query for audit and fallback.
Route structured questions to databases or APIs rather than embedding every row. When combining structured and unstructured evidence:
Require the answerer to:
Do not treat a fluent answer as evidence of retrieval quality.
Classify every failed example:
| Failure | Typical evidence | Fix layer |
|---|---|---|
| Missing content | source absent from index | ingestion |
| Wrong boundary | fact split or table lost | parsing/chunking |
| Low recall | expected source below k | retrieval |
| Bad ordering | source found but ranked low | fusion/reranking |
| Permission leak | unauthorized source returned | filtering/security |
| Unsupported answer | source present, claim absent | generation |
| Wrong citation | answer true, citation unrelated | citation mapping |
| Stale answer | old version outranks current | freshness/versioning |
Change one layer at a time and rerun the same evaluation slices.
Track:
Log query, retrieved source identifiers, scores, pipeline versions, and final citations subject to privacy policy. Avoid storing sensitive raw content when identifiers and hashes are sufficient.
Use shadow evaluation or canaries for index, embedding, chunker, or reranker changes. Keep the previous index addressable until rollback is proven.
Block rollout when:
Return:
Prefer a measured baseline over an elaborate untested architecture.