agentleFS
namboknambok/mentedb/.github/copilot-instructions.md

mentedb

Copilot instructions118 starsChanged 4 months agoApache-2.0View on GitHub

MenteDB is a purpose built Rust database engine for AI agent memory. It includes custom storage (WAL, buffer pool, pages), HNSW vector indexing, CSR/CSC graph, a custom query language (MQL), context assembly with U curve attention layout, and 7 unique cognitive features (stream cognition, write time inference, trajectory tracking, phantom memories, interference detection, pain signals, speculative pre assembly). The SDKs are excluded from the Cargo workspace and build independently. Always run these before committing: The server binary is mentedb-server and…

  • In this repositoryOne other file it gives its agents.

The file

We split this copilot-instructions.md into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always run these before committing:

    line 33
  2. Distinctive:

    All heuristics and thresholds must be in Config structs, never hardcoded magic numbers

    line 63
  3. Very specific:

    Use MenteResult<T> for error handling, no unwrap() in library code

    line 64
  4. Distinctive:

    Commit messages: conventional style (feat:, fix:, chore:), single line, no emojis

    line 65
  5. Distinctive:

    No emojis or em/en dashes in prose anywhere (docs, README, comments).

    line 66
  6. Distinctive:

    Add external database dependencies (this IS the database engine)

    line 81
  7. Distinctive:

    Remove cognitive features or weaken their configurability

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

MenteDB Development Instructions

Project overview

MenteDB is a purpose built Rust database engine for AI agent memory. It includes custom storage (WAL, buffer pool, pages), HNSW vector indexing, CSR/CSC graph, a custom query language (MQL), context assembly with U curve attention layout, and 7 unique cognitive features (stream cognition, write time inference, trajectory tracking, phantom memories, interference detection, pain signals, speculative pre assembly).

Workspace structure

crates/
  mentedb-core/       Core types, config, error, MVCC, multi agent
  mentedb-storage/    Page manager, WAL, buffer pool, backup/restore
  mentedb-index/      HNSW vector index, bitmap, temporal, salience
  mentedb-graph/      CSR/CSC graph, traversal, belief propagation
  mentedb-query/      MQL lexer, parser, planner
  mentedb-context/    U curve attention layout, delta tracker, serializers
  mentedb-cognitive/  Stream cognition, write inference, trajectory, phantoms, interference, pain, speculative
  mentedb-consolidation/ Decay, archival, extraction, compression, GDPR forget
  mentedb-embedding/  Provider trait, hash/HTTP providers, LRU cache
  mentedb-server/     Axum REST API, JWT auth, rate limiting, WebSocket
  mentedb/            Unified facade (MenteDb struct)
sdks/
  python/             PyO3 bindings + pure Python client
  typescript/         napi-rs bindings + TypeScript client
  python/integrations/langchain/  LangChain memory, retriever, chat history
  python/integrations/crewai/     CrewAI memory and tool adapter

The SDKs are excluded from the Cargo workspace and build independently.

Build, test, and lint

Always run these before committing:

cargo fmt --all
cargo clippy --workspace -- -D warnings
cargo test --workspace

The server binary is mentedb-server and runs on axum with JWT auth, rate limiting, and WebSocket support.

Key types

  • MemoryNode: The fundamental storage unit (id, content, memory_type, embedding, metadata, timestamps)
  • MemoryEdge: Typed relationship between memories (caused, contradicts, relates_to, obsoletes, etc.)
  • MenteDb: The unified facade that coordinates all subsystems
  • MenteConfig: Top level config with sub configs for every subsystem
  • MenteError / MenteResult<T>: Error handling throughout

Architecture notes

  • Storage uses 16KB pages with CLOCK eviction buffer pool and WAL with LZ4 + CRC32
  • HNSW index is built from scratch (not a binding), configurable M and ef parameters
  • Graph uses CSR/CSC hybrid with delta log and compact() to merge
  • MQL is a custom query language parsed by hand written recursive descent parser
  • Context assembly uses U curve attention layout (primacy/recency bias) with delta aware serving
  • 7 cognitive features are unique to MenteDB and do not exist in any other database engine

Conventions

  • Rust edition 2024, Apache 2.0 license
  • All heuristics and thresholds must be in Config structs, never hardcoded magic numbers
  • Use MenteResult<T> for error handling, no unwrap() in library code
  • Commit messages: conventional style (feat:, fix:, chore:), single line, no emojis
  • No emojis or em/en dashes in prose anywhere (docs, README, comments). Use commas instead.
  • Trait based design: EmbeddingProvider, storage backends, etc.

Key files

  • crates/mentedb/src/lib.rs: Unified MenteDb facade (open, store, recall, relate, forget, close)
  • crates/mentedb-core/src/config.rs: All configuration (MenteConfig and sub configs)
  • crates/mentedb-core/src/error.rs: MenteError enum
  • crates/mentedb-cognitive/src/: 7 cognitive feature modules
  • crates/mentedb-server/src/main.rs: Axum server entry point
  • .github/workflows/ci.yml: CI pipeline (check, test, fmt, clippy)
  • .github/workflows/release.yml: Release pipeline (crates.io, PyPI, npm)

Do not

  • Add external database dependencies (this IS the database engine)
  • Remove cognitive features or weaken their configurability
  • Hardcode language specific patterns, use config structs
  • Modify SDK Cargo.toml files to join the root workspace

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.