Skip to content

agentic-rag: migrate to Elasticsearch + Mistral - #50

Merged
sohanmaheshwar merged 4 commits into
mainfrom
elasticsearch
Oct 6, 2026
Merged

sohanmaheshwar merged 4 commits into
mainfrom
elasticsearch

Conversation

@sohanmaheshwar

Copy link
Copy Markdown
Contributor

What

Migrates the agentic-rag-authorization example from Milvus + OpenAI to Elasticsearch + Mistral, and promotes it as the canonical version on main.

Changes

Vector store → Elasticsearch

  • New elasticsearch_client.py singleton; milvus_client.py removed
  • retrieval_node runs kNN search over an Elasticsearch dense_vector field (cosine)
  • setup_environment.py creates the documents index and bulk-indexes the 50 docs

LLM + embeddings → Mistral

  • mistral-embed embeddings (1024-dim) and mistral-small-latest LLM via langchain-mistralai
  • Documents are embedded in a single batched embed_documents call (far fewer requests, avoids rate-limit failures mid-setup)

Docs & config

  • README rewritten for the Elasticsearch + Mistral stack: Milvus/Weaviate references removed, consolidated to a single web-UI flow, Project Structure / Testing / Sample Scenarios sections dropped, and the state-flow diagrams are now Mermaid with the SpiceDB authorization boundary highlighted
  • Added .env.example (the quick-start copies it; placeholder matches run_ui.py's preflight check)
  • ARCHITECTURE.md async note corrected (the ES client and Mistral calls are synchronous)
  • config.py, docker-compose.yml, run_ui.py updated for Elasticsearch + Mistral env vars and services

Tests

  • test_elasticsearch_client.py added; test_milvus_client.py removed; retrieval/config tests updated for the new code paths

Notes

  • The SpiceDB authorization layer is unchanged — it already follows client best practices (bulk checks, TOUCH writes, singleton client, fail-closed).

Replace the Milvus + OpenAI stack with Elasticsearch (dense_vector kNN)
and Mistral (mistral-embed embeddings + mistral-small-latest LLM).

- Add elasticsearch_client singleton; drop milvus_client
- retrieval_node: kNN search over an Elasticsearch dense_vector field
- setup_environment: create the documents index and bulk-index the 50
  docs, embedding them in a single batched embed_documents call
- config / docker-compose / run_ui: Elasticsearch + Mistral env & services
- Rewrite README for the Elasticsearch + Mistral stack, consolidate to the
  web-UI flow, add Mermaid flow diagrams, and add .env.example
- Update tests for the Elasticsearch / Mistral code paths

@tstirrat15 tstirrat15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, see comment

Comment thread agentic-rag-authorization/tests/test_config.py
@sohanmaheshwar
sohanmaheshwar merged commit 708b9c1 into main Oct 6, 2026
7 checks passed
@sohanmaheshwar
sohanmaheshwar deleted the elasticsearch branch October 6, 2026 14:57
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants