Rust implementation of a cognitively-grounded agent memory system, extended into a broader Agent architecture (not memory-only).
This repository is a Rust-first implementation inspired by CogMem design ideas, with a practical workspace structure for building:
- Long-term memory and retrieval
- Knowledge graph activation
- LLM-driven memory extraction
- Agent runtime components (skills, runtime orchestration, CLI, storage)
Reference to original CogMem source repository:
Cognition is not only a memory library.
In addition to cognitive memory components, the project includes Agent-oriented modules for:
- Runtime and orchestration
- Skill integration
- LLM provider abstraction
- CLI-driven operations and debugging
- Python binding pathway (planned via cognition-py)
- Language: Rust (Edition 2024)
- Workspace: Cargo Workspace (multi-crate)
- Graph engine: petgraph
- Async runtime: tokio
- Storage: SQLite via sqlx
- Serialization: serde, serde_json
- Time and IDs: chrono, uuid
- crates/cognition-core: Shared contracts, types, model schemas, error/result abstractions
- crates/cognition-graph: Unified graph model and spreading activation logic
- crates/cognition-storage: Durable memory persistence (nodes, edges, migration)
- crates/cognition-memory: Memory extraction pipeline and prompt registry
- crates/cognition-llm: LLM integration layer (scaffold)
- crates/cognition-runtime: Agent runtime layer (scaffold)
- crates/cognition-skills: Skill subsystem (scaffold)
- crates/cognition-py: Python interoperability layer (scaffold)
- cognition-cli: Command-line entrypoint for local workflows
- 2-layer node schema for retrieval + lossless context:
- narrative_fact (gist)
- raw_snippet (verbatim)
- Intention lifecycle support:
- status: planning, fulfilled, abandoned
- deadline field for prospective memory
- Expanded memory network types:
- world, experience, opinion, habit, intention, actioneffect
- Expanded edge types for cognitive transitions:
- entity, temporal, semantic, causal, sr_link, ao_causal, transition
- SUM-based spreading activation with edge-type multiplier
Beyond memory, the project is structured to evolve into an end-to-end Agent system:
- Ingestion and extraction from conversational input
- Retrieval and activation-guided recall
- Runtime decision loop and tool/skill execution
- Multi-provider LLM integration
- Cross-language integration for Python ecosystems
- Rust toolchain (stable)
- Cargo
Run from repository root:
cargo check --workspacecargo runcargo run -p cognition-cliThis codebase is under active development.
Some crates are production-oriented while others are scaffolded for upcoming Agent features. The workspace layout is intentionally modular to support iterative evolution from memory core to full Agent runtime.
- Base config file: config/default.yaml
- Environment file: .env (local)
Project documents are available in docs, including:
- CogMem.md
- cognition-core.md
- coginition-storage.md
- Project-Structure.md
- Project-Proposal.md
Contributions are welcome.
Recommended flow:
- Open an issue describing the change
- Create a focused branch
- Add tests for behavior changes
- Submit a PR with clear rationale and impact notes
No license file is currently declared in this repository. Please add a LICENSE file before public distribution.