Skip to content

Latest commit

 

History

History
190 lines (131 loc) · 4.08 KB

CONTRIBUTING.md

File metadata and controls

190 lines (131 loc) · 4.08 KB

Contributing to Engram

Thanks for your interest in contributing! This document provides guidelines for contributing to Engram.

Development Setup

Prerequisites

  • Go 1.25 or higher
  • An OpenAI-compatible embeddings server (LM Studio, Ollama, ...) with a 768-dim model such as nomic-embed-text
  • Git

Getting Started

  1. Fork and clone the repository:

    git clone https://github.com/OscillateLabsLLC/engram
    cd engram
  2. Install just (task runner):

    # macOS
    brew install just
    # Linux
    cargo install just
    # Windows
    scoop install just
  3. Install dependencies and build:

    just setup

    Or step by step:

    just deps
    just build
  4. Run tests:

    just test

Project Structure

engram/
├── cmd/engram/          # Main application entry point
├── internal/
│   ├── db/              # DuckDB operations
│   ├── embedding/       # OpenAI-compatible embeddings client
│   ├── mcp/             # MCP server implementation
│   └── models/          # Data models
├── docs/                # Architecture and design docs
├── scripts/             # Build and test scripts
├── Dockerfile           # Container image definition
├── justfile             # Task runner commands
└── README.md            # Project documentation

Making Changes

Code Style

  • Follow standard Go conventions
  • Run just fmt before committing
  • Use meaningful variable names
  • Add comments for exported functions

Testing

  • Add tests for new functionality
  • Ensure all tests pass: just test
  • Test cross-platform builds: just build-all

Commits

Use conventional commit messages (release-please depends on this):

feat: add semantic search filtering by tags
fix: handle nil embedding in search results
docs: update MCP configuration examples
chore: update Go dependencies

Pull Requests

  1. Create a feature branch: git checkout -b feature/my-feature
  2. Make your changes
  3. Add tests
  4. Run just test and just fmt
  5. Commit with clear messages
  6. Push to your fork
  7. Open a pull request

Areas for Contribution

High Priority

  • Improve vector search performance
  • Add comprehensive error handling
  • Implement retry logic for embedding failures
  • Add integration tests
  • Performance benchmarks
  • OpenTelemetry observability

Medium Priority

  • HTTP transport for OpenWebUI
  • Backup/restore utilities
  • Memory consolidation strategies
  • Admin/debugging tools

Documentation

  • Tutorial videos
  • More usage examples
  • API documentation
  • Troubleshooting guide

Running Tests

Unit Tests

go test ./...

Integration Tests

Requires an embeddings server running (Ollama shown; any OpenAI-compatible endpoint works):

export EMBEDDING_URL=http://localhost:11434
go test -tags=integration ./...

Manual Testing

# Start server
just dev

# In another terminal, test with MCP client
./scripts/test-mcp.sh

# Or build and run in one command
just run

Architecture Decisions

Event Sourcing

Episodes are the source of truth. Any derived structures (graphs, indices) should be rebuildable from episodes.

No LLM in Write Path

Embeddings can fail, but writes should succeed. If embedding fails, store with NULL and retry later.

DuckDB Choice

Analytical workload (time-range queries, filtering) is DuckDB's strength. Plus it's a single file, making deployment trivial.

Go Language

Official MCP SDK support, fast compilation, cross-platform binaries without runtime dependencies.

Questions?

  • Open an issue for bugs or feature requests
  • Start a discussion for architecture questions
  • Check existing issues before creating new ones

Code of Conduct

Be respectful and constructive. We're all here to build something useful.

License

By contributing, you agree that your contributions will be licensed under the MIT License.