CRecall Backend - Advanced code memory and recall system
Project description
crecall
Version: v0.1.0d-7 (preview)
Status: Active Development
Build Channels: Stable | Nightly | Dev
Portable personal recall layer for technical workflows. Never lose context after crashes, restarts, or interruptions.
Quick Start
Docker (Recommended)
docker run -p 8000:8000 -v ~/.recall_memory:/root/.recall_memory crecall:stable
Access: http://localhost:8000/docs
From Source
git clone https://github.com/crecall/crecall.git
cd crecall/backend
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reload
See docs/installation.md for complete setup.
Documentation
📚 Full Documentation: https://nabaznyl.github.io/crecall/
Local Docs:
pip install mkdocs-material
mkdocs serve
# Visit http://localhost:8000
Quick Links
| Guide | Purpose |
|---|---|
| Quick Start | Get running in 5 minutes |
| Installation | Setup (source, Docker, PostgreSQL) |
| Configuration | Environment & settings |
| API Reference | REST API documentation |
| Contributing | How to contribute |
| Architecture | System design & patterns |
Architecture & Planning:
- Vision - Product intent, personas, metrics
- Context Snapshot - Architecture & gaps
- Roadmap - Milestones & KPIs
- Build Standards - CI/CD & releases
What is crecall?
Problem: Ephemeral context (terminal buffers, scratch notes, decisions) decays quickly after crashes or restarts. Reconstructing "why" wastes time.
Solution:
- Structured Capture: Sessions → Clips → Memories
- Portable IDs: External string identifiers for export/import
- Fast Restore: Lightweight snapshots (<100ms restore target)
- Lifecycle Management: Enrichment, search, archival, pruning
Primary Users:
- Developer-Researcher Hybrids (frequent context pivots)
- Independent Analysts (fragmented findings collection)
- Power User Knowledge Gardeners (long-running multi-session projects)
Key Features
Current (v0.1.0d-7):
- ✅ Session/clip/memory API (REST + async)
- ✅ External vs internal identifier pattern
- ✅ Crash-safe startup (deterministic, gated background tasks)
- ✅ Centralized config & structured logging
- ✅ 84 passing tests + comprehensive test coverage
- ✅ Professional build infrastructure (stable/nightly/dev)
- ✅ PostgreSQL migration support
- ✅ CI/CD with automated quality checks (Black, Ruff, pytest)
Planned (Roadmap):
- 🔜 Instant recall from lightweight clips
- 🔜 Semantic memory search (FTS + embeddings)
- 🔜 Automated retention & backup policies
- 🔜 Git integration (auto-clip on commit)
- 🔜 VS Code deep integration
- 🔜 Advanced tagging & categorization
Architecture
Layers:
- API: FastAPI (async endpoints)
- Service: ID resolution, invariant enforcement
- Schemas: Pydantic v2 validation
- DB: SQLite (dev) / PostgreSQL (prod)
- Utilities: Config, logging, crash detection, autosave
Pattern: External string IDs (session_id, clip_id) → Service layer → Internal integer PKs
Benefits: Portability, migration flexibility, decoupled client/storage
Status & Roadmap
Phase 0 (Alignment): ✅ Complete
Phase 1 (Structure): ✅ Complete
Phase 2 (Workflows): ⏳ Next (session lifecycle, search, export/import)
Phase 3 (Quality): Test tier markers, coverage gating
Phase 4-9: Automation → Performance → Release → Feedback → Enhancements → Hardening
See Roadmap for detailed milestones.
Development
# Backend
cd backend && source venv/bin/activate
pytest -v # Run tests
black app/ tests/ # Format
pylint app/ # Lint
# Build stable release
./scripts/build-stable.sh
# Nightly build
./scripts/build-nightly.sh
Pre-commit Hooks
Install and activate automated formatting & security checks:
pip install pre-commit
pre-commit install
Hooks run on staged changes (Black, Ruff, pip-audit, basic hygiene). Use SKIP=pip-audit git commit -m ... to bypass selectively.
Type Checking (Mypy)
Run incremental static analysis:
mypy app
Configuration lives in backend/pyproject.toml under [tool.mypy].
CI & Observability
Quick references for the CI observability and smoke-test helpers added to this repository:
-
OTEL smoke-tests: Two CI jobs validate OpenTelemetry:
otel-import-check(fast) verifies OTEL packages import cleanly across Python versions.otel-integration(full) installs runtime deps and runs an in-memory OTEL integration smoke test that asserts spans are produced.
-
Run smoke checks locally:
- Install import-check deps:
pip install -r backend/requirements-otel.txt - Run the lightweight import check:
python .github/scripts/otel_smoke.py - For integration smoke (requires app code): run the app in a venv or rely on the script which imports
backend/app; the integration script uses aTestClientand will run without network:python .github/scripts/otel_integration_smoke.py.
- Install import-check deps:
-
Fetch CI artifacts: A helper script
./.automation/ci_fetch_artifacts.shcan dispatch theotel-smokeworkflow, poll for completion and download artifacts. It requires a GitHub token with access to the repo set asGITHUB_TOKEN.
See docs/observability.md for more details and examples.
SBOM Generation (CI)
CycloneDX SBOMs (Python & Node) produced automatically in CI (sbom job). Artifacts appear under sbom-artifacts in workflow runs.
See docs/DEVELOPMENT.md for complete guide.
Success Metrics
- Clip creation: <75ms
- Memory search (<10k clips): <150ms p50
- Export/import fidelity: 100%
- Crash recovery: 0 data loss
- Startup: <3s (<50k clips)
- Test coverage: >85%
Contributing
See CONTRIBUTING.md for workflow & standards.
License
MIT License - See LICENSE file for details.
Built to solve real problems. Never lose context again.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crecall_backend-0.2.1.tar.gz.
File metadata
- Download URL: crecall_backend-0.2.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a04f2121ed5d54578cd44bcc18392625e2762a307be39bd3682b6ae3ce48e2fb
|
|
| MD5 |
2a957c9841bf8e5759d488df18812778
|
|
| BLAKE2b-256 |
978a08b87264e3eeec987b6f22ae0c5e28fdb2e42e35a0d2c7c8eabb171efd1d
|
File details
Details for the file crecall_backend-0.2.1-py3-none-any.whl.
File metadata
- Download URL: crecall_backend-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f8a0baedde9d902e2eb4c1832c63e478f3ea9217c4880887800059f6f4e7a68
|
|
| MD5 |
e6a020ff5eac0f044db5541392d43164
|
|
| BLAKE2b-256 |
7970eef6b7268ea4a29b90ccbcea002c0a849117d730cf1165c443e72a19b117
|