How ren-97/shopmind works
ShopMind is a conversational shopping assistant that grounds recommendations in a product catalog and supports cart-to-checkout actions in chat. The main flow is client → chat API → agent/tool loop → query planning and retrieval → reranking and catalog-backed results → streamed cards. Catalog ingestion and balanced review summaries are separate supporting capabilities. Some API, Android, and retrieval-stage links rely on README or SOURCE INDEX references rather than sampled implementation excerpts; those evidence limits are noted on the relevant edges.
Main entry points: orchestrator.py Agent Orchestrator · catalog_repo.py Catalog Repository · search.py Search Tool · strategies Retrieval Strategies
Components 23
Client and API
- Android Client
client/ShopMind - Chat API
server/api/chat.py - SSE Streaming
server/api/sse.py - Cart and Order APIs
server/api/cart.py
Conversation and Tools
- Agent Orchestrator
server/agent/orchestrator.py - Session Context
server/agent/session_state.py - Tool Runtime
server/tools/base.py - Commerce Tools
server/tools/cart.py
Product Discovery
- Search Tool
server/tools/search.py - Query Planner
server/llm/planner.py - Retrieval Dispatcher
server/rag/retrieval/dispatcher.py - Retrieval Strategies
server/rag/retrieval/strategies - Embedding Providers
server/rag/embedders - Reranking
server/rag/reranking/llm_reranker.py
Catalog and State
- Catalog Repository
server/storage/catalog_repo.py - Catalog Database
server/storage/models.py - Vector Index
server/storage/vector_index.py - User State Repository
server/storage/user_repo.py - Postgres
- Qdrant
Catalog Ingestion
- Catalog Ingestion
server/indexing/ingest.py - Review Summaries
server/llm/review_summarizer.py
Other components
- Shopper
Connections 28
- Shopper → Android Client: asks
- Android Client → Chat API: sends chat
- Chat API → Agent Orchestrator: handles turn
- Agent Orchestrator → Session Context: loads context
server/agent/orchestrator.py - Agent Orchestrator → Tool Runtime: executes tools
server/agent/orchestrator.py - Tool Runtime → Search Tool: dispatches
server/tools/base.py - Search Tool → Query Planner: plans query
server/tools/search.py - Search Tool → Retrieval Dispatcher: dispatches plan
server/tools/search.py - Retrieval Dispatcher → Retrieval Strategies: selects strategy
server/rag/retrieval/dispatcher.py - Retrieval Strategies → Embedding Providers: embeds query
server/rag/retrieval/strategies/filtered_semantic.py - Retrieval Strategies → Vector Index: retrieves chunks
server/rag/retrieval/strategies/filtered_semantic.py - Retrieval Strategies → Catalog Repository: filters catalog
server/rag/retrieval/strategies/filtered_semantic.py - Search Tool → Reranking: reranks hits
server/tools/search.py - Reranking → Catalog Repository: loads product facts
server/rag/reranking/llm_reranker.py - Catalog Repository → Catalog Database: reads catalog
server/storage/catalog_repo.py - Agent Orchestrator → SSE Streaming: streams events
- SSE Streaming → Android Client: streams cards
- Android Client → Cart and Order APIs: manages cart
- Cart and Order APIs → User State Repository: reads and writes
server/api/cart.py - Cart and Order APIs → Catalog Repository: loads products
server/api/cart.py - Agent Orchestrator → Commerce Tools: invokes commerce
- Commerce Tools → User State Repository: updates user state
- User State Repository → Postgres: persists state
- Catalog Database → Postgres: stores catalog
- Vector Index → Qdrant: stores vectors
server/storage/vector_index.py - Catalog Ingestion → Catalog Repository: writes products
server/indexing/ingest.py - Catalog Ingestion → Vector Index: indexes chunks
server/indexing/ingest.py - Catalog Ingestion → Review Summaries: summarizes reviews
server/indexing/ingest.py