Overview
TheBaseConfig dataclass is the central configuration object for the ReMem framework. It controls all aspects of the system including LLM settings, embedding models, graph construction, retrieval, and evaluation parameters.
Constructor
Example
LLM Parameters
Configuration for language model behavior and API settings.llm_name
Name of the language model to use for general inference.
extract_llm_label
Label for the LLM used in information extraction. Defaults to
llm_name if not specified.qa_llm_label
Label for the LLM used in question answering. Defaults to
llm_name if not specified.llm_base_url
Base URL for the LLM API. If None, uses the default OpenAI service.
max_new_tokens
Maximum number of new tokens to generate in each inference call.
num_gen_choices
Number of chat completion choices to generate for each input message.
seed
Random seed for reproducibility.
temperature
Sampling temperature for LLM generation. 0 means deterministic.
extract_format
Response format specification for extraction tasks.
use_azure
Whether to use Azure OpenAI service instead of standard OpenAI.
max_num_seqs
Maximum number of sequences to generate for vLLM offline mode.
max_model_len
Maximum context length (in tokens) for the model.
max_retries
Maximum number of retry attempts for asynchronous API calls.
Storage & Indexing Parameters
force_openie_from_scratch
If True, ignores existing OpenIE results and rebuilds from scratch.
force_index_from_scratch
If True, ignores all existing storage files and graph data and rebuilds from scratch.
save_openie
Whether to save OpenIE extraction results to disk.
save_dir
Directory to save all related files. If not specified:
- For dataset-specific runs:
outputs/{dataset}/ - For general use:
outputs/
Text Preprocessing Parameters
text_preprocessor_class_name
Name of the text preprocessor class to use.
preprocess_encoder_name
Name of the encoder for tokenization during document chunking.
preprocess_chunk_overlap_token_size
Number of overlapping tokens between consecutive chunks.
preprocess_chunk_max_token_size
Maximum token size for each chunk. If None, treats the entire document as a single chunk.
preprocess_chunk_func
Chunking function to use for document preprocessing.
Information Extraction Parameters
extract_method
Information extraction method:
"openie": Standard open information extraction (entities and triples)"episodic": Episodic memory extraction for conversations"episodic_gist": Episodic extraction with gist summaries"temporal": Temporal event extraction
llm_infer_mode
"online": Use API-based LLM calls"offline": Use vLLM for local batch inference
skip_graph
Whether to skip graph construction. Set to True when running vLLM offline indexing for the first time.
vllm_tensor_parallel_size
Tensor parallel size for vLLM offline mode.
Embedding Parameters
embedding_model_name
Name of the embedding model to use.
embedding_batch_size
Batch size for embedding model calls.
embedding_return_as_normalized
Whether to normalize encoded embeddings.
embedding_max_seq_len
Maximum sequence length for the embedding model.
Graph Construction Parameters
concatenate_gists_per_chunk
For episodic_gist method:
False: Each gist becomes a separate nodeTrue: All gists in a chunk are joined into one node
split_verbatim_per_chunk
For conversation data:
True: Split multi-message conversations into individual message nodesFalse: Keep each verbatim chunk as a single node
synonymy_edge_topk
Number of nearest neighbors (k) for KNN retrieval when building synonymy edges between entities.
synonymy_edge_query_batch_size
Batch size for query embeddings during synonymy edge construction.
synonymy_edge_key_batch_size
Batch size for key embeddings during synonymy edge construction.
synonymy_edge_sim_threshold
Similarity threshold (0-1) for including candidate synonymy edges.
is_directed_graph
Whether to construct a directed or undirected knowledge graph.
graph_type
graph_type
Literal["dpr_only", "facts_and_sim", "facts_and_sim_passage_node_unidirectional"]
default:"\"facts_and_sim_passage_node_unidirectional\""
Type of graph to construct:
"dpr_only": Dense passage retrieval only (no graph)"facts_and_sim": Graph with facts and similarity edges"facts_and_sim_passage_node_unidirectional": Facts, similarities, and unidirectional passage edges
Retrieval Parameters
linking_top_k
Number of linked nodes to consider at each retrieval step.
retrieval_top_k
Number of documents to retrieve for each query.
damping
Damping factor for Personalized PageRank algorithm.
passage_node_weight
Multiplicative weight factor for passage nodes in PageRank.
rerank_dspy_file_path
Path to a DSPy reranker model file for fact filtering.
Question Answering Parameters
qa_top_k
Number of top-ranked documents to feed to the QA model.
qa_passage_prefix
Prefix to add before each passage in the QA context.
qa_prompt_template
Name of the prompt template to use for QA tasks.
qa_reader
QA reader implementation to use.
Agent Parameters
For episodic and temporal extraction methods with agentic reasoning.agent_fixed_tools
True: Agent uses only semantic_retrieve + output_answerFalse: Agent can select from full toolset
agent_max_steps
Maximum reasoning steps for the agent. For fixed_tools mode:
- 1 = semantic_retrieve only
- 2 = semantic_retrieve + output_answer
agent_fixed_retrieval_tool
Which retrieval tool to use in fixed_tools mode:
"semantic_retrieve" or "lexical_retrieve"Evaluation Parameters
do_eval_retrieval
Whether to perform evaluation on retrieval results.
do_eval_qa
Whether to perform evaluation on QA results.
Evaluation requires gold-standard data (
gold_docs for retrieval, gold_answers for QA).Dataset Parameters
dataset
Name of the dataset being used. If specified, customizes the save directory and potentially the prompt templates.
corpus_len
Length of the corpus to use (for testing with subsets).