MemWireConfig. Choose your vector store, embedding model, and LLM provider, then tune recall and graph settings to fit your use case.
Components
Vector Databases
Connect to a vector store.
Embedding Models
Choose embedding model.
LLMs
Use any LLM provider with recalled context.
SQL Databases
Choose where to store metadata ledger for memories, graph edges, and categories.
Recall tuning
Recall assembles relevant memories into a formatted context string for injection into LLM prompts.| Parameter | Default | Description |
|---|---|---|
recall_min_relevance | 0.25 | Minimum cosine similarity for a memory to be included in recall. |
recall_max_paths | 10 | Maximum number of memory paths returned per recall call. |
recall_max_depth | 4 | Maximum BFS depth when traversing the memory graph. |
recall_seed_top_k | 5 | Number of top-k seed nodes to start graph traversal from. |
recall_bfs_max_branch | 5 | Maximum branches per node during BFS traversal. |
recall_bfs_max_paths | 200 | Maximum candidate paths evaluated before pruning. |
tension_threshold | 0.6 | Similarity above which two memories are flagged as contradictory. |
recency_weight | 0.3 | Weight given to recency vs semantic relevance when scoring memories. |
recency_halflife | 3600.0 | Half-life in seconds for recency decay. Lower = faster decay. |
Graph construction
MemWire organises memories in a graph. Edges encode semantic relationships between memories.| Parameter | Default | Description |
|---|---|---|
displacement_threshold | 0.15 | Minimum similarity required to create an edge between two memories. |
node_merge_similarity | 0.85 | Similarity above which two memory nodes are merged (deduplication). |
edge_weight_default | 0.5 | Initial weight for new edges. |
edge_weight_min | 0.01 | Floor for edge weights after decay. |
edge_weight_max | 1.0 | Ceiling for edge weights after reinforcement. |
edge_decay_rate | 0.02 | Rate at which unused edges decay per cycle. |
edge_reinforce_amount | 0.1 | Amount added to an edge weight on positive feedback. |
cross_memory_recent_limit | 50 | Number of recent memories considered when building cross-memory edges. |
Memory classification
Memories are automatically classified into categories using zero-shot cosine similarity.| Category | Description |
|---|---|
fact | Factual statements or pieces of information |
preference | Personal preferences or opinions |
instruction | Directives or rules to follow |
event | Things that happened |
entity | Information about a person, place, or organisation |
Feedback loop
| Parameter | Default | Description |
|---|---|---|
feedback_strengthen_rate | 0.1 | Amount to strengthen edges that contributed to a good response. |
feedback_weaken_rate | 0.05 | Amount to weaken edges that did not contribute. |
feedback_align_strengthen | 0.5 | Alignment score threshold above which edges are strengthened. |
feedback_align_weaken | 0.2 | Alignment score threshold below which edges are weakened. |
SQL Databases
MemWire stores memory metadata — content, graph edges, categories, and access counts — in a SQL database, while all embedding vectors live separately in a vector store. SQLite is the default because it requires no server or configuration, letting you run MemWire locally out of the box; switch to PostgreSQL or any other SQLAlchemy-compatible database by settingdatabase_url.
| Parameter | Default | Description |
|---|---|---|
database_url | None | SQLAlchemy-compatible URL. Defaults to sqlite:///memwire_{org_id}.db. |
org_id | "default" | Organisation identifier for multi-tenant isolation. |
Performance
| Parameter | Default | Description |
|---|---|---|
background_threads | 2 | Background threads for async graph and storage writes. |
embedding_cache_maxsize | 10000 | LRU cache size for embedding vectors. |
Search quality
Control how memories are retrieved during search and recall.| Parameter | Default | Description |
|---|---|---|
use_hybrid_search | True | Combine dense and sparse vectors for more accurate retrieval. |
use_reranking | False | Apply a cross-encoder reranker to re-score top candidates. |
reranker_model_name | Xenova/ms-marco-MiniLM-L-6-v2 | Reranker model (used when use_reranking=True). |
Recall tuning
Recall assembles relevant memories into a formatted context string for injection into LLM prompts.| Parameter | Default | Description |
|---|---|---|
recall_min_relevance | 0.25 | Minimum cosine similarity for a memory to be included in recall. |
recall_max_paths | 10 | Maximum number of memory paths returned per recall call. |
recall_max_depth | 4 | Maximum BFS depth when traversing the memory graph. |
recall_seed_top_k | 5 | Number of top-k seed nodes to start graph traversal from. |
recall_bfs_max_branch | 5 | Maximum branches per node during BFS traversal. |
recall_bfs_max_paths | 200 | Maximum candidate paths evaluated before pruning. |
tension_threshold | 0.6 | Similarity above which two memories are flagged as contradictory. |
recency_weight | 0.3 | Weight given to recency vs semantic relevance when scoring memories. |
recency_halflife | 3600.0 | Half-life in seconds for recency decay. Lower = faster decay. |
Graph construction
MemWire organises memories in a graph. Edges encode semantic relationships between memories.| Parameter | Default | Description |
|---|---|---|
displacement_threshold | 0.15 | Minimum similarity required to create an edge between two memories. |
node_merge_similarity | 0.85 | Similarity above which two memory nodes are merged (deduplication). |
edge_weight_default | 0.5 | Initial weight for new edges. |
edge_weight_min | 0.01 | Floor for edge weights after decay. |
edge_weight_max | 1.0 | Ceiling for edge weights after reinforcement. |
edge_decay_rate | 0.02 | Rate at which unused edges decay per cycle. |
edge_reinforce_amount | 0.1 | Amount added to an edge weight on positive feedback. |
cross_memory_recent_limit | 50 | Number of recent memories considered when building cross-memory edges. |
Memory classification
Memories are automatically classified into categories. Classification uses zero-shot cosine similarity against anchor phrases.| Category | Description |
|---|---|
fact | Factual statements or pieces of information |
preference | Personal preferences or opinions |
instruction | Directives or rules to follow |
event | Things that happened |
entity | Information about a person, place, or organisation |
Feedback loop
The feedback loop reinforces graph edges that led to good responses, and weakens edges that did not contribute.| Parameter | Default | Description |
|---|---|---|
feedback_strengthen_rate | 0.1 | Amount to strengthen edges that contributed to a good response. |
feedback_weaken_rate | 0.05 | Amount to weaken edges that did not contribute. |
feedback_align_strengthen | 0.5 | Alignment score threshold above which edges are strengthened. |
feedback_align_weaken | 0.2 | Alignment score threshold below which edges are weakened. |
memory.feedback() after each LLM response to close the loop:
Storage
| Parameter | Default | Description |
|---|---|---|
database_url | None | SQLAlchemy-compatible database URL. Defaults to sqlite:///memwire_{org_id}.db. |
org_id | "default" | Organisation identifier. Used as a namespace for multi-tenant deployments. |
Performance
| Parameter | Default | Description |
|---|---|---|
background_threads | 2 | Number of background threads for async graph and storage writes. |
embedding_cache_maxsize | 10000 | LRU cache size for embedding vectors. Increase for large workloads. |