Contributions are welcome! By submitting a pull request you agree that your contributions will be licensed under the Elastic License 2.0.
Please read our Code of Conduct before contributing.
git clone https://github.com/graphmemory/graphmemory.git
cd graphmemory
npm install
npm run dev # tsc --watch
npm test # run all tests
npm run build # production build# Zero-config: indexes current directory
npm run cli:dev -- serve
# With config file
npm run cli:dev -- serve --config graph-memory.yamlOpen http://localhost:3000 for the web UI.
src/
├── api/ # MCP tools + REST API + WebSocket
│ ├── tools/ # MCP tool handlers (one file per tool)
│ └── rest/ # Express routers
├── cli/ # CLI entry point (commander)
├── graphs/ # Graph managers (docs, code, knowledge, files, tasks, skills)
├── lib/ # Core libraries (parsers, embedder, config, access control)
└── tests/ # Jest test suites
ui/src/ # React + MUI web interface
docs/ # Documentation (markdown)
- Create a branch from
main - Make your changes
- Add or update tests
- Run
npm test— all tests must pass - Run
npm run build— must compile without errors - Submit a pull request
- Tests use Jest with ts-jest
- Test files go in
src/tests/with.test.tsextension - MCP tool tests use
InMemoryTransport.createLinkedPair()+Clientfrom the MCP SDK - REST tests use supertest with
createRestApp() - Use
unitVec()andembedFnPair()fromsrc/tests/helpers.tsfor fake embeddings
// Example: MCP tool test
import { setupMcpClient, type McpTestContext } from '@/tests/helpers';
let ctx: McpTestContext;
beforeAll(async () => { ctx = await setupMcpClient(); });
afterAll(async () => { await ctx.cleanup(); });
it('should list tools', async () => {
const { tools } = await ctx.client.listTools();
expect(tools.length).toBeGreaterThan(0);
});- TypeScript strict mode — no implicit
any, no unused variables - Follow existing code patterns and naming conventions
- Keep PRs focused — one feature or fix per PR
- Add tests for new features and bug fixes
- Update docs if you change public APIs or behavior
- Don't add unnecessary dependencies
Open an issue on GitHub with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Node.js version and OS
See SECURITY.md for how to report vulnerabilities privately.