{"id":"6b08c24d38c84264c2027482","slug":"embeddings-vector-db","title":"Embeddingi i bazy wektorowe: wyszukiwanie po znaczeniu","summary":"Czym jest embedding, jak liczyć podobieństwo kosinusowe, który model wybrać i jak przechowywać miliony wektorów w pgvector, Qdrant lub Chroma – z kodem w Pythonie, TypeScript, C#, Javie i Go.","servedLang":"pl","availableLangs":["pl","en"],"topics":["embeddings-vector-db","rag","llm-fundamentals"],"techs":["python","typescript","dotnet","java","go"],"tags":["embeddings","vector-database","cosine-similarity","pgvector","qdrant","chroma","hnsw","semantic-search"],"level":"beginner","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":20,"stats":{"views":1,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:35:41.309Z","updatedAt":"2026-11-27T10:04:38.491Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"rose","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Embeddingi dla programistów: wektory znaczeń, podobieństwo kosinusowe, iloczyn skalarny, L2, modele Voyage, OpenAI i open source, indeksy HNSW i IVF, pgvector, Qdrant i Chroma w praktyce.","wordCount":3934,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Klient pierogarni wpisuje w wyszukiwarkę „coś bez mięsa dla dziecka”, a dostaje zero wyników – bo w karcie nie ma słów „bez mięsa”, jest za to „wegetariańskie” i „łagodne”. "},{"type":"text","text":"Embeddingi","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"embeddings","marks":[{"type":"italic"}]},{"type":"text","text":") rozwiązują ten problem: zamieniają tekst na wektor liczb tak, że teksty o podobnym znaczeniu leżą blisko siebie. "},{"type":"text","text":"Bazy wektorowe","marks":[{"type":"bold"}]},{"type":"text","text":" potrafią w milisekundach znaleźć najbliższych sąsiadów wśród milionów takich wektorów. Razem są fundamentem wyszukiwania semantycznego i "},{"type":"text","text":"RAG","marks":[{"type":"link","attrs":{"href":"/pl/topics/rag"}}]},{"type":"text","text":"."}]},{"type":"stats","attrs":{"items":[{"value":"1024","label":"wymiary wektora","hint":"domyślnie w modelach Voyage 4 i multilingual-e5-large"},{"value":"6,1 GB","label":"milion wektorów 1536-wym.","hint":"w float32, bez indeksu i metadanych"},{"value":"~4","label":"trafienia z 40 kandydatów","hint":"HNSW w pgvector przy filtrze pasującym do 10% wierszy"}]}},{"type":"callout","attrs":{"variant":"info","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Embedding","marks":[{"type":"bold"}]},{"type":"text","text":" to wektor (zwykle 384–3072 liczb) opisujący znaczenie tekstu. Podobne znaczenia = bliskie wektory, niezależnie od użytych słów."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Podobieństwo mierzy się zwykle "},{"type":"text","text":"cosinusem kąta","marks":[{"type":"bold"}]},{"type":"text","text":" między wektorami; dla wektorów znormalizowanych to po prostu iloczyn skalarny."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Baza wektorowa","marks":[{"type":"bold"}]},{"type":"text","text":" (pgvector, Qdrant, Chroma…) przechowuje wektory z metadanymi i szuka najbliższych sąsiadów przybliżonym indeksem, np. HNSW – szybko, ale nie zawsze idealnie."}]}]}]}]},{"type":"heading","attrs":{"level":2,"id":"problem-wyszukiwarka-ktora-nie-rozumie-pytan"},"content":[{"type":"text","text":"Problem: wyszukiwarka, która nie rozumie pytań"}]},{"type":"paragraph","content":[{"type":"text","text":"Pierwsza wersja wyszukiwarki na platformie Pierogarni Haliny to zapytanie "},{"type":"text","text":"WHERE name ILIKE '%' || :q || '%'","marks":[{"type":"code"}]},{"type":"text","text":". Działa dla „ruskie”, ale zawodzi przy wszystkim, co klient opisuje własnymi słowami:"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Klient wpisuje"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"W karcie jest"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Wynik "},{"type":"text","text":"ILIKE","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„coś bez mięsa”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„wegetariańskie”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"brak"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„na słodko”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„z jagodami i śmietaną”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"brak"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„czy macie coś z orzechami?”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„sos z orzechów włoskich”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"brak (inna forma słowa)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„pierogi ruskie”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"„Pierogi ruskie”"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"trafienie"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Pełnotekstowe wyszukiwanie z odmianą (np. "},{"type":"text","text":"tsvector","marks":[{"type":"code"}]},{"type":"text","text":" w PostgreSQL albo BM25 w Elasticsearch) pomaga przy formach wyrazów, ale nadal dopasowuje "},{"type":"text","text":"słowa","marks":[{"type":"bold"}]},{"type":"text","text":", a nie "},{"type":"text","text":"znaczenie","marks":[{"type":"bold"}]},{"type":"text","text":". Potrzebujemy reprezentacji, w której „bez mięsa” i „wegetariańskie” są blisko siebie."}]},{"type":"heading","attrs":{"level":2,"id":"intuicja-mapa-znaczen"},"content":[{"type":"text","text":"Intuicja: mapa znaczeń"}]},{"type":"paragraph","content":[{"type":"text","text":"Wyobraź sobie mapę, na której każde danie ma współrzędne. Gdyby osie znaczyły „warzywne/serowe”, „mięsne” i „słodkie”, pierogi ruskie miałyby współrzędne mniej więcej "},{"type":"text","text":"[0.8, 0.1, 0.2]","marks":[{"type":"code"}]},{"type":"text","text":", a pierogi z jagodami "},{"type":"text","text":"[0.4, 0.0, 0.9]","marks":[{"type":"code"}]},{"type":"text","text":". Pytanie „coś bez mięsa, może być na słodko” to punkt "},{"type":"text","text":"[0.9, 0.0, 0.3]","marks":[{"type":"code"}]},{"type":"text","text":". Wyszukiwanie sprowadza się do pytania: "},{"type":"text","text":"które punkty leżą najbliżej punktu pytania?","marks":[{"type":"bold"}]}]},{"type":"paragraph","content":[{"type":"text","text":"Prawdziwy model embeddingów robi to samo, tylko w setkach lub tysiącach wymiarów, a osie nie mają ludzkich nazw – kierunki w tej przestrzeni wyłaniają się podczas treningu. Policzmy nasz zabawkowy przykład ręcznie. Podobieństwo kosinusowe pytania "},{"type":"text","text":"q","marks":[{"type":"italic"}]},{"type":"text","text":" do pierogów ruskich "},{"type":"text","text":"r","marks":[{"type":"italic"}]},{"type":"text","text":":"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"iloczyn skalarny: 0,9·0,8 + 0,0·0,1 + 0,3·0,2 = "},{"type":"text","text":"0,78","marks":[{"type":"bold"}]}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"długości wektorów: |q| = √(0,81 + 0 + 0,09) ≈ 0,949, |r| = √(0,64 + 0,01 + 0,04) ≈ 0,831"}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"cosinus: 0,78 / (0,949 · 0,831) ≈ "},{"type":"text","text":"0,99","marks":[{"type":"bold"}]},{"type":"text","text":" – prawie ten sam kierunek."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Dla pierogów z mięsem wychodzi 0,14, a dla pierogów z jagodami 0,67. Ranking jest dokładnie taki, jakiego oczekiwałby człowiek."}]},{"type":"codeGroup","attrs":{"title":"Podobieństwo kosinusowe od zera"},"content":[{"type":"codeBlock","attrs":{"language":"python","filename":"similarity.py"},"content":[{"type":"text","text":"import math\n\n# Toy 3-D \"embeddings\": (vegetable/cheese, meat, sweet). Real ones have 384-3072 dims.\nQUERY = [0.9, 0.0, 0.3]  # \"something without meat, sweet is fine\"\nDISHES = {\n    \"ruskie pierogi\": [0.8, 0.1, 0.2],\n    \"meat pierogi\": [0.1, 0.9, 0.1],\n    \"blueberry pierogi\": [0.4, 0.0, 0.9],\n}\n\ndef dot(a: list[float], b: list[float]) -> float:\n    return sum(x * y for x, y in zip(a, b))\n\ndef norm(a: list[float]) -> float:\n    return math.sqrt(dot(a, a))\n\ndef cosine(a: list[float], b: list[float]) -> float:\n    # Angle between vectors: 1 = same direction, 0 = unrelated, -1 = opposite.\n    return dot(a, b) / (norm(a) * norm(b))\n\ndef l2(a: list[float], b: list[float]) -> float:\n    return math.sqrt(sum((x - y) ** 2 for x, y in zip(a, b)))\n\nranked = sorted(DISHES.items(), key=lambda kv: cosine(QUERY, kv[1]), reverse=True)\nfor name, vec in ranked:\n    print(f\"{name:18} cos={cosine(QUERY, vec):.3f} dot={dot(QUERY, vec):.3f} l2={l2(QUERY, vec):.3f}\")\n# ruskie pierogi     cos=0.990 dot=0.780 l2=0.173\n# blueberry pierogi  cos=0.674 dot=0.630 l2=0.781\n# meat pierogi       cos=0.139 dot=0.120 l2=1.221"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"similarity.ts"},"content":[{"type":"text","text":"// Toy 3-D \"embeddings\": (vegetable/cheese, meat, sweet). Real ones have 384-3072 dims.\nconst query = [0.9, 0.0, 0.3];\nconst dishes: Record<string, number[]> = {\n  \"ruskie pierogi\": [0.8, 0.1, 0.2],\n  \"meat pierogi\": [0.1, 0.9, 0.1],\n  \"blueberry pierogi\": [0.4, 0.0, 0.9],\n};\n\nconst dot = (a: number[], b: number[]) => a.reduce((sum, x, i) => sum + x * b[i], 0);\nconst norm = (a: number[]) => Math.sqrt(dot(a, a));\nconst cosine = (a: number[], b: number[]) => dot(a, b) / (norm(a) * norm(b));\n\n// Normalize once at write time - then cosine == dot product (cheaper at query time).\nconst normalize = (a: number[]) => {\n  const n = norm(a);\n  return a.map((x) => x / n);\n};\n\nconst q = normalize(query);\nconst ranked = Object.entries(dishes)\n  .map(([name, vec]) => ({ name, cos: cosine(query, vec), dotOfUnit: dot(q, normalize(vec)) }))\n  .sort((a, b) => b.cos - a.cos);\n\nfor (const r of ranked) {\n  console.log(`${r.name.padEnd(18)} cos=${r.cos.toFixed(3)} dot(unit)=${r.dotOfUnit.toFixed(3)}`);\n}"}]},{"type":"codeBlock","attrs":{"language":"csharp","filename":"Similarity.cs"},"content":[{"type":"text","text":"using System.Numerics.Tensors;\n\n// Toy 3-D \"embeddings\": (vegetable/cheese, meat, sweet). Real ones have 384-3072 dims.\nfloat[] query = [0.9f, 0.0f, 0.3f];\nvar dishes = new Dictionary<string, float[]>\n{\n    [\"ruskie pierogi\"] = [0.8f, 0.1f, 0.2f],\n    [\"meat pierogi\"] = [0.1f, 0.9f, 0.1f],\n    [\"blueberry pierogi\"] = [0.4f, 0.0f, 0.9f],\n};\n\nforeach (var (name, vec) in dishes.OrderByDescending(d => Cosine(query, d.Value)))\n{\n    // TensorPrimitives uses SIMD - use it in production instead of a hand-written loop.\n    float fast = TensorPrimitives.CosineSimilarity(query, vec);\n    Console.WriteLine($\"{name,-18} cos={Cosine(query, vec):F3} simd={fast:F3}\");\n}\n\nstatic float Cosine(float[] a, float[] b)\n{\n    float dot = 0, na = 0, nb = 0;\n    for (int i = 0; i < a.Length; i++)\n    {\n        dot += a[i] * b[i];\n        na += a[i] * a[i];\n        nb += b[i] * b[i];\n    }\n    return dot / (MathF.Sqrt(na) * MathF.Sqrt(nb));\n}"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"Similarity.java"},"content":[{"type":"text","text":"import java.util.Comparator;\nimport java.util.Map;\n\npublic class Similarity {\n    static double dot(double[] a, double[] b) {\n        double sum = 0;\n        for (int i = 0; i < a.length; i++) sum += a[i] * b[i];\n        return sum;\n    }\n\n    static double cosine(double[] a, double[] b) {\n        return dot(a, b) / (Math.sqrt(dot(a, a)) * Math.sqrt(dot(b, b)));\n    }\n\n    public static void main(String[] args) {\n        // Toy 3-D \"embeddings\": (vegetable/cheese, meat, sweet).\n        double[] query = {0.9, 0.0, 0.3};\n        Map<String, double[]> dishes = Map.of(\n                \"ruskie pierogi\", new double[]{0.8, 0.1, 0.2},\n                \"meat pierogi\", new double[]{0.1, 0.9, 0.1},\n                \"blueberry pierogi\", new double[]{0.4, 0.0, 0.9});\n\n        dishes.entrySet().stream()\n                .sorted(Comparator.comparingDouble(\n                        (Map.Entry<String, double[]> e) -> cosine(query, e.getValue())).reversed())\n                .forEach(e -> System.out.printf(\"%-18s cos=%.3f%n\", e.getKey(), cosine(query, e.getValue())));\n    }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"similarity.go"},"content":[{"type":"text","text":"package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc dot(a, b []float64) float64 {\n\tvar s float64\n\tfor i := range a {\n\t\ts += a[i] * b[i]\n\t}\n\treturn s\n}\n\nfunc cosine(a, b []float64) float64 {\n\treturn dot(a, b) / (math.Sqrt(dot(a, a)) * math.Sqrt(dot(b, b)))\n}\n\nfunc main() {\n\t// Toy 3-D \"embeddings\": (vegetable/cheese, meat, sweet).\n\tquery := []float64{0.9, 0.0, 0.3}\n\tdishes := map[string][]float64{\n\t\t\"ruskie pierogi\":    {0.8, 0.1, 0.2},\n\t\t\"meat pierogi\":      {0.1, 0.9, 0.1},\n\t\t\"blueberry pierogi\": {0.4, 0.0, 0.9},\n\t}\n\tnames := make([]string, 0, len(dishes))\n\tfor n := range dishes {\n\t\tnames = append(names, n)\n\t}\n\tsort.Slice(names, func(i, j int) bool {\n\t\treturn cosine(query, dishes[names[i]]) > cosine(query, dishes[names[j]])\n\t})\n\tfor _, n := range names {\n\t\tfmt.Printf(\"%-18s cos=%.3f\\n\", n, cosine(query, dishes[n]))\n\t}\n}"}]}]},{"type":"heading","attrs":{"level":2,"id":"trzy-miary-odleglosci"},"content":[{"type":"text","text":"Trzy miary odległości"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Miara"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Wzór (intuicja)"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Kiedy"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Podobieństwo kosinusowe"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"kąt między wektorami, od −1 do 1"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"domyślny wybór dla tekstu – ignoruje długość wektora"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Iloczyn skalarny ("},{"type":"text","text":"dot product","marks":[{"type":"italic"}]},{"type":"text","text":")"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"suma iloczynów współrzędnych"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"gdy wektory są znormalizowane do długości 1 – daje ten sam ranking co cosinus, a jest tańszy"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Odległość euklidesowa (L2)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"długość odcinka między punktami"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"gdy model był trenowany pod L2; dla wektorów znormalizowanych ranking jak przy cosinusie"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Kluczowe zdanie: "},{"type":"text","text":"dla wektorów o długości 1 wszystkie trzy miary dają ten sam ranking.","marks":[{"type":"bold"}]},{"type":"text","text":" Modele OpenAI i Voyage zwracają już znormalizowane wektory; przy modelach otwartych normalizację włączasz sam (np. "},{"type":"text","text":"normalize_embeddings=True","marks":[{"type":"code"}]},{"type":"text","text":" w sentence-transformers). W pgvector odpowiadają im operatory "},{"type":"text","text":"<=>","marks":[{"type":"code"}]},{"type":"text","text":" (odległość kosinusowa, czyli 1 − podobieństwo), "},{"type":"text","text":"<#>","marks":[{"type":"code"}]},{"type":"text","text":" (ujemny iloczyn skalarny) i "},{"type":"text","text":"<->","marks":[{"type":"code"}]},{"type":"text","text":" (L2)."}]},{"type":"heading","attrs":{"level":2,"id":"skad-model-wie-co-jest-podobne"},"content":[{"type":"text","text":"Skąd model wie, co jest podobne"}]},{"type":"paragraph","content":[{"type":"text","text":"Model embeddingów to zwykle transformer typu "},{"type":"text","text":"encoder","marks":[{"type":"italic"}]},{"type":"text","text":": czyta cały tekst, a wektory jego tokenów uśrednia (lub bierze wektor specjalnego tokenu) do jednego wektora. O jakości decyduje trening "},{"type":"text","text":"kontrastowy","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"contrastive learning","marks":[{"type":"italic"}]},{"type":"text","text":"): model dostaje miliony par „pytanie – pasujący fragment” i uczy się przyciągać ich wektory do siebie, a odpychać od fragmentów niepasujących, często specjalnie dobranych „trudnych negatywów”."}]}]},"toc":[{"id":"problem-wyszukiwarka-ktora-nie-rozumie-pytan","text":"Problem: wyszukiwarka, która nie rozumie pytań","level":2,"locked":false},{"id":"intuicja-mapa-znaczen","text":"Intuicja: mapa znaczeń","level":2,"locked":false},{"id":"trzy-miary-odleglosci","text":"Trzy miary odległości","level":2,"locked":false},{"id":"skad-model-wie-co-jest-podobne","text":"Skąd model wie, co jest podobne","level":2,"locked":false},{"id":"ktory-model-embeddingow-wybrac","text":"Który model embeddingów wybrać","level":2,"locked":true},{"id":"najblizsi-sasiedzi-dokladnie-czy-szybko","text":"Najbliżsi sąsiedzi: dokładnie czy szybko","level":2,"locked":true},{"id":"bazy-wektorowe-w-praktyce","text":"Bazy wektorowe w praktyce","level":2,"locked":true},{"id":"wymiary-pamiec-i-koszt","text":"Wymiary, pamięć i koszt","level":2,"locked":true},{"id":"krotka-historia-wektorow-znaczen","text":"Krótka historia wektorów znaczeń","level":2,"locked":true},{"id":"kiedy-wyszukiwanie-wektorowe-a-kiedy-slowa-kluczowe","text":"Kiedy wyszukiwanie wektorowe, a kiedy słowa kluczowe","level":2,"locked":true},{"id":"lista-kontrolna-przed-produkcja","text":"Lista kontrolna przed produkcją","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true},{"id":"co-dalej","text":"Co dalej","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":59,"visibleBlocks":18,"resources":[{"id":"6b0857b33c96f2d34d0b37f6","type":"article","provider":"web","url":"https://simonwillison.net/2023/Oct/23/embeddings","embedUrl":null,"title":"Embeddings: What they are and why they matter","description":"Embeddings are a really neat trick that often come wrapped in a pile of intimidating jargon. If you can make it through that jargon, they unlock powerful and exciting techniques …","author":"Simon Willison","thumbnailUrl":"https://static.simonwillison.net/static/2023/embeddings/embeddings.003.jpeg","durationSec":null,"lang":"en","topics":["embeddings-vector-db"],"techs":["general"],"tags":["ai","hacker-news"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"hn","publishedAt":"2023-10-23T13:42:12.000Z","popularity":81,"verifiedAt":"2026-11-26T11:18:21.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.221Z","updatedAt":"2026-11-26T16:00:51.221Z"},{"id":"6b0857b43c96f2d34d0b3850","type":"article","provider":"web","url":"https://huggingface.co/spaces/hesamation/primer-llm-embedding","embedUrl":null,"title":"LLM Embeddings Explained: A Visual and Intuitive Guide","description":"How Language Models Turn Text into Meaning, From Traditional","author":"huggingface.co","thumbnailUrl":"https://cdn-uploads.huggingface.co/production/uploads/647f805de9c81260ff8881ee/8v52lNo2sFtNySUlVnXF4.png","durationSec":null,"lang":"en","topics":["embeddings-vector-db"],"techs":["general"],"tags":["llm","ai","hacker-news"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"hn","publishedAt":"2025-07-28T07:02:14.000Z","popularity":76,"verifiedAt":"2026-11-26T11:18:21.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.221Z","updatedAt":"2026-11-26T16:00:51.221Z"},{"id":"6b0857c23c96f2d34d0b458c","type":"article","provider":"web","url":"https://qdrant.tech/articles/what-is-a-vector-database","embedUrl":null,"title":"What is a Vector Database? - Qdrant","description":"Discover how vector databases power semantic search by understanding the meaning behind your data. This guide breaks down how they work and why they've become the backbone of modern AI search.","author":"Qdrant","thumbnailUrl":"https://qdrant.tech/articles_data/what-is-a-vector-database/preview/social_preview.png","durationSec":null,"lang":"en","topics":["rag","embeddings-vector-db"],"techs":["general"],"tags":["databases","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":50,"verifiedAt":"2026-11-26T11:26:44.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857b23c96f2d34d0b342b","type":"repo","provider":"github","url":"https://github.com/pgvector/pgvector","embedUrl":null,"title":"pgvector/pgvector","description":"Open-source vector similarity search for Postgres","author":"pgvector","thumbnailUrl":"https://opengraph.githubassets.com/1/pgvector/pgvector","durationSec":null,"lang":"en","topics":["embeddings-vector-db"],"techs":["general"],"tags":["nearest-neighbor-search","approximate-nearest-neighbor-search","databases","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2021-04-20T21:13:52.000Z","popularity":85,"verifiedAt":"2026-11-26T10:56:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"},{"id":"6b0857c23c96f2d34d0b457c","type":"article","provider":"web","url":"https://milanjovanovic.tech/blog/getting-started-with-pgvector-in-dotnet-for-simple-vector-search","embedUrl":null,"title":"Vector Search in .NET With pgvector and PostgreSQL","description":"Vector search doesn't require a dedicated vector database. PostgreSQL with pgvector gives you similarity search right next to your relational data.","author":"Milan Jovanović","thumbnailUrl":"https://milanjovanovic.tech/blog-covers/mnw_187.png","durationSec":null,"lang":"en","topics":["embeddings-vector-db","ai-in-dotnet"],"techs":["dotnet"],"tags":["databases","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2026-03-28T00:00:00.000Z","popularity":50,"verifiedAt":"2026-11-26T11:28:57.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857c13c96f2d34d0b449f","type":"article","provider":"web","url":"https://lilianweng.github.io/posts/2017-10-15-word-embedding","embedUrl":null,"title":"Learning Word Embedding","description":"Human vocabulary comes in free text. In order to make a machine learning model understand and process the natural language, we need to transform the free-text words into numeric values. One of the simplest transformation approaches is to do a one-hot encoding in which each distinct word stands for…","author":"Lilian Weng","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["embeddings-vector-db"],"techs":["general"],"tags":["machine-learning","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2017-10-15T00:00:00.000Z","popularity":50,"verifiedAt":"2026-11-26T11:30:23.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"}],"challenges":[],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"ai-path","title":"AI dla programisty","items":[{"slug":"llm-fundamentals","title":"Podstawy LLM: tokeny, okno kontekstu i przewidywanie następnego słowa","current":false},{"slug":"prompt-engineering","title":"Prompt engineering: jak pisać instrukcje, które model naprawdę wykona","current":false},{"slug":"embeddings-vector-db","title":"Embeddingi i bazy wektorowe: wyszukiwanie po znaczeniu","current":true},{"slug":"rag","title":"RAG: odpowiedzi na podstawie własnych dokumentów","current":false},{"slug":"tool-use","title":"Tool use: jak model językowy wywołuje funkcje Twojej aplikacji","current":false},{"slug":"ai-agents","title":"Agenci AI: model w pętli z narzędziami – i kiedy wystarczy zwykły workflow","current":false},{"slug":"mcp","title":"MCP (Model Context Protocol): jeden standard łączenia AI z narzędziami i danymi","current":false},{"slug":"evals","title":"Ewaluacja aplikacji LLM (evals): testy dla systemów, które nie są deterministyczne","current":false},{"slug":"llm-ops","title":"LLMOps: bramka do modeli, cache, limity, obserwowalność i koszty w produkcji","current":false},{"slug":"ai-guardrails","title":"Guardrails i bezpieczeństwo aplikacji LLM: prompt injection, wycieki danych i uprawnienia narzędzi","current":false},{"slug":"local-llms","title":"Lokalne modele językowe: Ollama, llama.cpp, vLLM, kwantyzacja i realne kompromisy","current":false},{"slug":"fine-tuning","title":"Fine-tuning modeli językowych: kiedy się opłaca, LoRA i QLoRA w praktyce","current":false},{"slug":"ai-coding-assistants","title":"Asystenci programowania AI: od podpowiedzi w edytorze do agenta, który otwiera pull requesty","current":false}]}],"prev":{"slug":"prompt-engineering","title":"Prompt engineering: jak pisać instrukcje, które model naprawdę wykona"},"next":{"slug":"rag","title":"RAG: odpowiedzi na podstawie własnych dokumentów"},"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":38}]}}