Calcola documenti ed interroga i vettori con openai/text-embedding-3-large
Recupera Top-K da un archivio vettoriale (FAISS / Milvus / pgvector)
Riclassifica con cohere/rerank-english-v3
Unisci i pezzi Top-N nel prompt e lascia cohere/command-r-plus oppure Claude genera la risposta finale
Incorporamento
python
resp = client.embeddings.create(
model="openai/text-embedding-3-large",
input=[chunk.text for chunk in chunks],
)
vectors = [d.embedding for d in resp.data]
Modello di richiesta
text
You are an expert assistant. Answer based ONLY on context.
If the answer is not in the context, say "I don't know".
[Context]
{retrieved_chunks}
[Question]
{user_question}