A context and memory management system for business AI agents that stores business memories, assigns dynamic trust scores that decay over time, and surfaces contextually relevant memories for business decisions.
- Entity Management: Create and manage business entities (suppliers, customers, warehouses, people)
- Memory Storage: Store business memories with financial impact, volatility classification, and tags
- Dynamic Trust Scoring: Trust scores decay over time based on volatility class and recency
- Trajectory Detection: Analyze entity performance trends (IMPROVING, DECLINING, VOLATILE, STABLE)
- Contextual Decision Support: Get relevant memories based on decision type and context budget
- Backend: Node.js, Express, MongoDB Atlas, Mongoose
- Frontend: React, Tailwind CSS, Axios
- Trust Engine: Custom mathematical models for trust scoring and trajectory analysis
- Node.js (v14 or higher)
- MongoDB Atlas account
- Git
- Clone the repository
- Navigate to the project directory
- Install dependencies for both server and client
# Install root dependencies
npm install
# Install server dependencies
cd server && npm install
# Install client dependencies
cd ../client && npm install- Create a
.envfile in the root directory - Add your MongoDB Atlas connection string:
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/memorymesh?retryWrites=true&w=majority
PORT=5001
Run the seed script to populate the database with sample data:
npm run seedThis will create:
- XYZ Corporation (supplier) with quality incidents, delivery issues, and recent improvements
- TechCorp Inc. (customer) with contract renewals, technical issues, and leadership preferences
Start both the server and client concurrently:
npm run devOr run them separately:
# Start backend server (port 5001)
npm run server
# Start frontend client (port 3000)
npm run clientPOST /api/entities- Create a new entityGET /api/entities- List all entities
POST /api/memories- Add memory to an entityGET /api/memories/:entityId- Get all memories for an entity
POST /api/context- Get contextual memories for decision makingGET /api/context/dashboard- Get dashboard statistics
The trust score is calculated using:
trust_score = base_weight × recency_decay × consistency_factor × source_reliability
- Base Weight: Normalized financial impact (0-1)
- Recency Decay: Exponential decay based on volatility class
- STRUCTURAL: λ = 0.0019 (half-life ~365 days)
- BEHAVIORAL: λ = 0.0077 (half-life ~90 days)
- ENVIRONMENTAL: λ = 0.0231 (half-life ~30 days)
- Consistency Factor: Sentiment analysis against recent memories
- Source Reliability: Reliability score of the information source
Entity trajectories are determined by comparing average trust scores:
- IMPROVING: Recent trust > Previous trust + 0.1
- DECLINING: Recent trust < Previous trust - 0.1
- VOLATILE: High variance in trust scores
- STABLE: Neither improving nor declining significantly
memorymesh/
├── server/
│ ├── models/ # Mongoose schemas
│ ├── services/ # Business logic (trust engine)
│ ├── routes/ # API routes
│ ├── seed.js # Database seeding
│ └── index.js # Express server
├── client/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ └── api/ # API client
│ └── package.json
├── .env # Environment variables
└── package.json # Root package.json
- View Entities: Browse all entities in the left panel
- Explore Memories: Click an entity to view its memory timeline
- Get Context: Use the decision briefing panel to get relevant memories for specific decisions
- Trust Analysis: View trust scores and trajectory indicators for each entity
MIT License