Python/AI Flashcards

(4 cards)

1
Q

pytorch

A
  • it’s a machie learning library
  • It offers dynamic computational graphs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

RAG

A

Retrieval-Augmented Generation

Here’s how RAG works to generate text based on a prompt:

  1. Retrieval (R): The system searches for relevant information from external sources like databases or the web.
  2. Augmentation (A): The retrieved information is passed to the generative model as context.
  3. Generation (G): The model uses both the prompt and the retrieved context to generate a final, accurate response.

This combines retrieval and generation seamlessly!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Vector Database

A

A vector database stores unstructured data (like images) by converting them into vector embeddings (PyTorch). Traditional databases like Postgres can’t handle similarity search well.

Vector DBs use special indexes (like HNSW or IVF) to quickly find similar vectors based on distance metrics like cosine similarity.

examples
Pinecone, chroma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Vector DB vs Graph DB

A

Vector DB | Graph DB
Stores vectors (numeric arrays) | Stores nodes and edges (relationships)
Focus: Similarity search (e.g., “find close vectors”) | Focus: Relationship search (e.g., “who is connected to who”)
*Uses * vector math (cosine, Euclidean distance) | Uses graph traversal (paths, neighbors)
Examples: Pinecone, FAISS, Milvus | Examples: Neo4j, ArangoDB
Used for: Image search, recommendation systems | Used for: Social networks, fraud detection

**Simple example:
**
Vector DB: “Find 3 cats most similar to this cat.”
Graph DB: “Find cats that are friends with other cats.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly