Thanks for your interest in contributing to Cognis! This document covers the basics. The full contributor docs live at the docs site under Contribute.
- Fork the repository and clone your fork.
- Install Rust (stable, 1.75+).
- Build the workspace:
cargo build --workspace. - Run tests:
cargo test --workspace.
cognis/
├── crates/
│ ├── cognis-core/ # Foundation. Zero internal-crate deps.
│ ├── cognis-llm/ # LLM clients + providers (feature-gated).
│ ├── cognis-rag/ # Embeddings, vector stores, retrievers, splitters.
│ ├── cognisgraph/ # Stateful Graph<S>, Pregel engine, checkpointers.
│ ├── cognis-trace/ # Pluggable observability.
│ ├── cognis-macros/ # Proc macros: #[tool], #[derive(GraphState)].
│ └── cognis/ # Umbrella + agent layer. Re-exports the four siblings.
├── examples/ # Runnable demos under examples/<category>/
├── docs/mintlify/ # The docs site.
└── Cargo.toml # Workspace root.
- Check existing issues and discussions.
- For large changes, open an issue or discussion first to align on approach.
-
Create a feature branch from
main. -
Make your changes.
-
Ensure the pre-push checklist passes:
cargo fmt --all cargo clippy --workspace --features all-providers -- -D warnings cargo test --workspace -
Write tests for new functionality.
-
Submit a pull request.
- Dependency boundaries:
cognis-coremust have zero internal-crate dependencies. The four sibling capability crates (cognis-llm,cognis-rag,cognisgraph,cognis-trace) depend only oncognis-core(andcognis-macroswhere they use a derive). - Feature flags: Use them for any external integration (providers, vector stores, exporters).
- Error handling:
thiserrorper crate; cross-crate viaFromconversions. The umbrellacogniscrate hand-rolls errors instead. - Async: All I/O traits via
#[async_trait]. - Documentation:
///doc comments on every public type, trait, and function. - Testing: Tests next to the code; integration tests behind
#[cfg(feature = "integration_tests")].
Conventional commits:
feat(crate): description— new featuresfix(crate): description— bug fixesdocs(crate): description— documentationrefactor(crate): description— code refactoringtest(crate): description— testschore: description— maintenance
For changes spanning multiple crates, drop the (crate) suffix.
Each LLM provider should:
- Be gated behind a feature flag (e.g.
features = ["anthropic"]). - Implement the
LLMProvidertrait fromcognis-llm. - Include tests with mocked HTTP responses.
- Include an example under
examples/models/.
The full step-by-step is in the docs: Contribute → Adding a new provider.
- Bugs: Use the Bug Report template.
- Features: Use the Feature Request template.
- Questions: Use Discussions.
Be respectful and constructive. We're building something together. The full code of conduct is in docs/mintlify/contribute/code-of-conduct.mdx.
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT).