Skip to content

CottageLabs/re-mind

Repository files navigation

Re-Mind

Retrieval-enhanced mind — RAG toolkit High-level wrapper around LangChain to help build RAG applications.

Dependencies


Dependency Description
Librarian Used to load the vector store and perform retrieval
LLMChat Builds a chat interface for LLMs

Setup uv environment

For development

uv venv && uv sync

For Application

uv tool install -e .

Environment Variables

Variable Name Description
QDRANT_DATA_URL URL to connect to Qdrant server, QDRANT_DATA_PATH will be ignored if this variable is set
QDRANT_DATA_PATH Path to store Qdrant vector database data

LLM workflow

                    ┌─────────┐
                    │  START  │
                    └────┬────┘
                         │
                         ▼
                 ┌────────────────┐
                 │ route_retriever│
                 │  (query_mode)  │
                 └───────┬────────┘
                         │
          ┌──────────────┼──────────────┐
          │              │              │
          ▼              ▼              ▼
     ┌─────────┐    ┌─────────┐    ┌──────────┐
     │  quick  │    │ rerank  │    │ complex  │
     │retrieve │    │retrieve │    │ retrieve │
     └────┬────┘    └────┬────┘    └────┬─────┘
          │              │              │
          └──────────────┼──────────────┘
                         │
                         ▼
                  ┌────────────┐
                  │ synthesize │
                  └──────┬─────┘
                         │
                         ▼
                    ┌────────┐
                    │  END   │
                    └────────┘

Query mode

  • quick - Fast direct similarity search. Retrieves documents based on embedding similarity without additional processing. Best for simple queries where speed is important.

  • rerank - Retrieves more candidate documents and reranks them using a cross-encoder model (BGE-reranker). Improves relevance at the cost of slightly longer processing time.

  • complex (default) - Uses LLM to extract multiple search queries from your question, retrieves documents for each query, then aggregates and reranks results. Best for complex or multi-faceted questions.


How to use

Select vector store

Use QDRANT_DATA_URL or QDRANT_DATA_PATH to specify the vector store location

Using remind-chat

# run remind-chat to enter interactive chat mode
remind-chat

[gemma-3-1b (cuda)][debug]>  
  • gemma-3-1b is the current model used; it's a local model, and cuda means it uses GPU.
  • debug is the current output style
  • You can switch the output style and device using commands like /configs device cuda

Configs

/configs shows detailed configuration

[gemma-3-1b (cuda)][debug]>  /configs

             Examples:
             /configs n_top_result 8   # change configs
             ```

                 Vectorstore Configuration
 Qdrant data path  /home/kk/.local/opt/re-mind/qdrant-data
 Collection name   testrag

  Attached Items
 No items attached

                                       Configuration Commands

     Current Configuration
 collection_name    testrag
 device             cuda
 max_width          100
 model_option_name  gemma-3-1b
 n_top_result       auto
 output_mode        debug
 return_full_text   False
 temperature        1.2
  • Qdrant data path: the current vector store used for retrieval, only changeable via environment variables
  • Collection name: the current collection, can be changed via /configs collection_name <name>

The query_mode configuration controls the retrieval strategy used when searching the vector store. You can set it using /configs query_mode <mode>.

detail about each mode is described in the "Query mode" section above.

# Use complex mode for complex questions (default)
/configs query_mode complex

Other commands

Command Description
/attach Open an editor to manage attached items (files/sources) for filtering vector store searches
/reset_config Reset all configuration settings to default values
/search Perform a complex retrieval search and display retrieved documents without generating a response
/summary Retrieve relevant context and generate a summary based on the query
/models List available models or switch to a different model (e.g., /models gemma-3-1b)

Chat

After you choose your model, device, collection, and query mode, you can start chatting with the LLM

[gemma-3-1b (cuda)][debug]>  list story or novel and write as points format and some description for each story 
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃        list story or novel and write as points format and some description for each story        ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Okay, here’s a breakdown of the provided text, formatted as requested, with descriptions for     │
│ each story/novel:                                                                                │
│                                                                                                  │
│ 1. The Little Prince by Antoine de Saint-Exupéry                                                 │
│                                                                                                  │
│  • Genre: Philosophical Children’s Novel                                                         │
│  • Description: A poignant and allegorical story about the importance of imagination,            │
│    friendship, and seeing beyond the surface of things. It follows a pilot stranded in the       │
│    desert who encounters a young prince from a tiny asteroid. The prince teaches him about the   │
│    value of relationships, the nature of truth, and the beauty of simple experiences. It’s a     │
│    story about finding meaning in life, even when it seems lost.                                 │
│                                                                                                  │
│ 2. The House on Mango Street by Sandra Cisneros                                                  │
│                                                                                                  │
│  • Genre: Coming-of-Age Novel                                                                    │
│  • Description: This novel follows Esperanza Cordero, a young Latina girl growing up in          │
│    Chicago’s inner city. It depicts her journey of self-discovery, neighborhood dynamics, and    │
│    the challenges of navigating a world that often feels hostile and oppressive. It explores     │
│    themes of identity, poverty, and the struggle for agency.                                     │

...


About

Retrieval-enhanced mind --- rag toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages