Constructivist Agentic Memory
October 8, 2025 ยท View on GitHub
[๐ Paper] CAM: A Constructivist View of Agentic Memory for LLM-Based Reading Comprehension
CAM (Constructivist Agentic Memory) is a constructivist-inspired memory framework that improves long-form reading comprehension for LLM-based agents. This is an early-stage release, and we plan to extend CAM with more advanced capabilities in our future work.
๐ ๏ธ Requirements
- python == 3.9.19
- numpy == 1.26.4
- tqdm == 4.66.1
- datasets == 2.20.0
- networkx == 3.4.2
- openai == 0.28.0
- rouge-score == 0.1.2
- scikit-learn == 1.6.1
๐ Datasets
| Dataset | Task | Access |
|---|---|---|
| NovelQA | Narrative QA | Request Access |
| FABLES | Claim Verification | Request Access |
| QMSum | Query-Based Summarization | GitHub |
| ODSum | Query-Based Summarization | GitHub |
| MultiHop-RAG | Multi-Hop Reasoning | GitHub |
QMSum, ODSum, and MultiHop-RAG are publicly available. For NovelQA and FABLES, full documents and ground truth labels are not released to prevent data contamination. Please contact the original authors to request access.
๐ Quick Start
1. Document chunking:
python prototype/chunks.py --dataset <dataset_name> --chunk_size <maximum number of tokens per chunk>
2. Generate chunk embeddings and extract salient entities (optional) using an LLM:
python prototype/preprocess_chunks.py --dataset <dataset_name> --model <LLM model to use> --embedding model <embedding model to use> --generate_gist --extract_entity
This step creates a folder ./processed_data/ containing chunk embeddings and metadata.
3. Constructivist memory construction:
python prototype/constructivist_memory.py --dataset <dataset_name> --chunk_size <maximum number of tokens per chunk> --threshold <edge activation threshold> --weight <weight for text similarity vs proximity> --sigma <sigma for Gaussian proximity similarity> --k <top-k neighbors per node> --max_cluster_size <maximum nodes allowed in one cluster> --max_hierarchy_level <maximum hierarchy levels> --model <LLM model to use> --embedding model <embedding model to use>
This step creates ./super_graphs/ (memory structures) and ./super_embeddings/ (node embeddings).
4. Prune-and-Grow inference for NovelQA (multichoice setting):
python prototype/tasks/question_answering.py --dataset NovelQA --mode MC
Outputs are stored in the ./output/ directory.
๐ Acknowledgement
This project builds on insights from developmental cognitive theory, graph learning, and long-context LLM research. We thank the authors of the benchmark datasets for their valuable contributions.