The Epistemic Me server is a Go-based backend service that provides belief and dialectic management capabilities through a gRPC interface.
- Go 1.21 or later
- Protocol Buffers compiler (
protoc) - OpenAI API key for AI-powered features
- Docker for containerization
- Docker Compose v2.22.0 or later for local development (required for watch/hotreload mode)
- Install the Protocol Buffers compiler and Go plugins:
brew install protobuf
brew install protoc-gen-go
brew install protoc-gen-go-grpc
brew install protoc-gen-connect-go- Initialize the git submodules (proto):
git submodule init && git submodule update- Set your OpenAI API key in an
.envfile at the Epistemic Me project root(should be in a directory above the Server folder) with the following:
OPENAI_API_KEY=your_api_key_here- Start the development server with hot reload:
# Using Docker Compose v2.22.0+ with watch mode
docker compose up --watch
# For older Docker Compose versions, use:
docker compose up- Set your OpenAI API key in an
.envfile at the Epistemic Me project root(should be in a directory above the Server folder) with the following:
OPENAI_API_KEY=your_api_key_here- Run the server using the
run.shscript:
./run.sh [flags]The server will start on port 8080 by default.
The run.sh script is the main entry point for building, running, and testing the server. Before executing any command, it automatically runs a pre-build step using build.sh which:
- Generates protobuf files
- Fixes import paths
- Builds the Docker image
- No flags: Just builds and runs the server
--daemon: Runs in daemon mode with live reload on code changes--test: Runs both integration and SDK tests--integration-test: Runs only integration tests--sdk-test: Runs only SDK tests
# Just run the server
./run.sh
# Run in daemon mode with live reload
./run.sh --daemon
# Run all tests (integration and SDK)
./run.sh --test
# Run only integration tests
./run.sh --integration-test
# Run only SDK tests
./run.sh --sdk-test- Run SDK tests:
docker build --target sdktest -t sdk-tests . && docker run --env-file <path_to_.env> sdk-tests- Run integration tests:
docker build --target inttest -t int-tests . && docker run --env-file <path_to_.env> int-tests- Run all tests:
# Build and run both test stages
docker build --target sdktest -t sdk-tests . && \
docker build --target inttest -t int-tests . && \
docker run --env-file <path_to_.env> sdk-tests && docker run --env-file <path_to_.env> int-testsThe run.sh script provides convenient test execution:
# Run all tests
./run.sh --test
# Run only integration tests
./run.sh --integration-test
# Run only SDK tests
./run.sh --sdk-testWhen running tests:
- The script first builds the project using
build.sh - Starts the server in a Docker container
- Waits for the server to be ready
- Executes the specified test suite(s)
- Reports test results
- Exits with appropriate status code
- Build the Docker image:
docker build --target dev -t epistemic-me-core .- Run the container:
docker run --env-file <path_to_.env> -p 8080:8080 epistemic-me-coreproto/: Protocol Buffer definitionspb/: Generated Go code from Protocol Bufferssvc/: Core service implementationsserver/: gRPC server implementationtests/: Integration and unit testsintegration/: Integration testssdk/: SDK tests
ai/: AI helper implementationsdb/: Database and storage implementations
- Make changes to the Protocol Buffer definitions in
proto/ - Run
./build.shto regenerate the Go code - Implement your changes in the relevant service package
- Add tests for your changes
- Run tests to verify everything works
- Submit your PR
The API is defined using Protocol Buffers. You can find the service definitions in the proto/ directory.
For detailed API documentation, please refer to the proto files:
proto/models/*.proto: Data modelsproto/service.proto: Service definitions