You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Query → Embedding Service → Vector Search → Similar Documents
Similar Documents → Format as Context → LLM Pipeline
LLM Pipeline uses context in system message to generate informed response
You'd use it like:
# First, store documents
curl -X POST "http://localhost:8080/documents" \
-d '{ "content": "Dubai was founded in 1833...", "source": "history.txt"}'# Then query
curl -X POST "http://localhost:8080/rag" \
-d '{ "query": "When was Dubai founded?"}'
The LLM would receive messages like:
{
"messages": [
{
"role": "system",
"content": "Use the following information to answer the question:\n\nSource [history.txt]: Dubai was founded in 1833..."
},
{
"role": "user",
"content": "When was Dubai founded?"
}
]
}
The text was updated successfully, but these errors were encountered:
Example implementation (minus endpoint)
Let me clarify the workflow of how embeddings and LLMs work together in a RAG system:
a. Generate embedding for the query
b. Find similar documents
c. Format them into context for the LLM
Example usage:
So the flow is:
You'd use it like:
The LLM would receive messages like:
The text was updated successfully, but these errors were encountered: