friday-memory 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. friday_memory-1.2.0/.env.example +25 -0
  2. friday_memory-1.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +57 -0
  3. friday_memory-1.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  4. friday_memory-1.2.0/.github/PULL_REQUEST_TEMPLATE.md +43 -0
  5. friday_memory-1.2.0/.github/workflows/ci.yml +34 -0
  6. friday_memory-1.2.0/.github/workflows/publish.yml +76 -0
  7. friday_memory-1.2.0/.gitignore +32 -0
  8. friday_memory-1.2.0/CODE_OF_CONDUCT.md +18 -0
  9. friday_memory-1.2.0/CONTRIBUTING.md +60 -0
  10. friday_memory-1.2.0/Dockerfile +34 -0
  11. friday_memory-1.2.0/LICENSE +21 -0
  12. friday_memory-1.2.0/Makefile +33 -0
  13. friday_memory-1.2.0/PKG-INFO +574 -0
  14. friday_memory-1.2.0/README.md +536 -0
  15. friday_memory-1.2.0/benchmarks/benchmark_deepeval.py +175 -0
  16. friday_memory-1.2.0/docker-compose.yml +56 -0
  17. friday_memory-1.2.0/docs/assets/banner.png +0 -0
  18. friday_memory-1.2.0/docs/assets/neural_studio.png +0 -0
  19. friday_memory-1.2.0/docs/assets/synthetic_neural_cortex.png +0 -0
  20. friday_memory-1.2.0/examples/README.md +46 -0
  21. friday_memory-1.2.0/examples/antigravity.json +13 -0
  22. friday_memory-1.2.0/examples/claude_code.json +13 -0
  23. friday_memory-1.2.0/examples/claude_desktop.json +13 -0
  24. friday_memory-1.2.0/examples/cursor.json +13 -0
  25. friday_memory-1.2.0/examples/vscode.json +13 -0
  26. friday_memory-1.2.0/friday/__init__.py +32 -0
  27. friday_memory-1.2.0/friday/client.py +298 -0
  28. friday_memory-1.2.0/friday/exceptions.py +34 -0
  29. friday_memory-1.2.0/friday/integrations/__init__.py +1 -0
  30. friday_memory-1.2.0/friday/integrations/langchain.py +79 -0
  31. friday_memory-1.2.0/friday/types.py +41 -0
  32. friday_memory-1.2.0/friday_logo.jpg +0 -0
  33. friday_memory-1.2.0/gateway/__init__.py +0 -0
  34. friday_memory-1.2.0/gateway/main.py +491 -0
  35. friday_memory-1.2.0/install.sh +147 -0
  36. friday_memory-1.2.0/layers/__init__.py +1 -0
  37. friday_memory-1.2.0/mcp/__init__.py +0 -0
  38. friday_memory-1.2.0/mcp/server.py +234 -0
  39. friday_memory-1.2.0/orchestrator/__init__.py +0 -0
  40. friday_memory-1.2.0/orchestrator/router.py +32 -0
  41. friday_memory-1.2.0/pipelines/__init__.py +0 -0
  42. friday_memory-1.2.0/pipelines/auto_graph.py +133 -0
  43. friday_memory-1.2.0/pyproject.toml +83 -0
  44. friday_memory-1.2.0/requirements.txt +12 -0
  45. friday_memory-1.2.0/seed/blueprints/demo_architecture.md +20 -0
  46. friday_memory-1.2.0/seed/facts.example.json +14 -0
  47. friday_memory-1.2.0/smithery.yaml +25 -0
  48. friday_memory-1.2.0/studio/index.html +1752 -0
  49. friday_memory-1.2.0/tests/__init__.py +0 -0
  50. friday_memory-1.2.0/tests/test_health.py +116 -0
  51. friday_memory-1.2.0/tests/test_sdk.py +283 -0
@@ -0,0 +1,25 @@
1
+ # ==============================================================================
2
+ # Friday — Self-Hosted Configuration
3
+ # ==============================================================================
4
+
5
+ # 1. Friday Server Security (Set your own secret password to protect your server)
6
+ FRIDAY_API_KEY=choose_any_secret_password_you_want
7
+
8
+ # 2. LLM for Autonomous Graph Extraction (Extracts nodes & edges from memories)
9
+ # Get a key at: https://platform.deepseek.com (~$0.14/M tokens)
10
+ DEEPSEEK_API_KEY=sk-your_deepseek_api_key_here
11
+ DEEPSEEK_BASE_URL=https://api.deepseek.com
12
+ DEEPSEEK_MODEL=deepseek-chat
13
+
14
+ # 3. Semantic Memory Layer (Mem0)
15
+ # Get a free key at: https://mem0.ai
16
+ MEM0_API_KEY=m0-your_mem0_api_key_here
17
+
18
+ # 4. Knowledge Graph Database (Neo4j - bundled in docker-compose)
19
+ NEO4J_URI=bolt://neo4j:7687
20
+ NEO4J_USER=neo4j
21
+ NEO4J_PASSWORD=choose_a_strong_password_here
22
+
23
+ # 5. Server Options
24
+ HOST=0.0.0.0
25
+ PORT=8000
@@ -0,0 +1,57 @@
1
+ name: Bug Report
2
+ description: Create a report to help us improve Friday
3
+ labels: ["bug"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for taking the time to fill out this bug report! Please provide as much context as possible.
9
+ - type: textarea
10
+ id: description
11
+ attributes:
12
+ label: Bug Description
13
+ description: A clear and concise description of what the bug is.
14
+ placeholder: Describe the unexpected behavior...
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: reproduction
19
+ attributes:
20
+ label: Steps to Reproduce
21
+ description: Step-by-step instructions to reproduce the issue.
22
+ value: |
23
+ 1. Start Friday via 'docker compose up -d'
24
+ 2. Execute MCP query with '...'
25
+ 3. See error
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: expected
30
+ attributes:
31
+ label: Expected Behavior
32
+ description: What should happen under normal conditions.
33
+ validations:
34
+ required: true
35
+ - type: textarea
36
+ id: logs
37
+ attributes:
38
+ label: Environment Logs & Traceback
39
+ description: Paste any relevant terminal logs, Docker container output, or traceback.
40
+ render: shell
41
+ - type: dropdown
42
+ id: deployment
43
+ attributes:
44
+ label: Deployment Environment
45
+ options:
46
+ - Docker Compose (Localhost)
47
+ - Docker Compose (Cloud / EC2 / VPS)
48
+ - Native Python / Local Virtualenv
49
+ - Other
50
+ validations:
51
+ required: true
52
+ - type: input
53
+ id: client
54
+ attributes:
55
+ label: AI Coding Client
56
+ description: Cursor, Claude Code CLI, Antigravity, VS Code, Windsurf, etc.
57
+ placeholder: e.g. Cursor 0.44 / Claude Code 1.0
@@ -0,0 +1,35 @@
1
+ name: Feature Request
2
+ description: Suggest an idea or enhancement for Friday
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ We welcome architectural proposals, new MCP tools, and integration ideas!
9
+ - type: textarea
10
+ id: problem
11
+ attributes:
12
+ label: Problem Statement
13
+ description: Is your feature request related to a problem or limitation?
14
+ placeholder: I encounter friction when trying to...
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: proposal
19
+ attributes:
20
+ label: Proposed Solution / Architecture
21
+ description: Describe the solution you'd like to see implemented.
22
+ placeholder: Friday should provide an endpoint / tool that...
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: alternatives
27
+ attributes:
28
+ label: Alternatives Considered
29
+ description: Any alternative solutions or workarounds you have considered.
30
+ - type: checkboxes
31
+ id: contribution
32
+ attributes:
33
+ label: Contribution
34
+ options:
35
+ - label: I am willing to submit a pull request implementing this feature
@@ -0,0 +1,43 @@
1
+ ## Description
2
+
3
+ Brief summary of the changes introduced in this pull request and the rationale behind them.
4
+
5
+ Fixes #(issue)
6
+
7
+ ## Type of Change
8
+
9
+ - [ ] `fix`: Bug fix (non-breaking change which fixes an issue)
10
+ - [ ] `feat`: New feature (non-breaking change which adds functionality)
11
+ - [ ] `refactor`: Code refactoring or architectural cleanup
12
+ - [ ] `perf`: Performance improvement
13
+ - [ ] `docs`: Documentation updates or corrections
14
+ - [ ] `chore`: CI, dependency, or tooling updates
15
+
16
+ ## Architecture Impact
17
+
18
+ - [ ] Updates MCP tool schema (`mcp/server.py`)
19
+ - [ ] Modifies database layer (SQLite / Neo4j / ChromaDB)
20
+ - [ ] Modifies Neural Studio visualizer (`studio/`)
21
+ - [ ] None (internal logic / tests only)
22
+
23
+ ## Verification & Testing
24
+
25
+ Explain how the changes were verified:
26
+
27
+ ```bash
28
+ # Example test run
29
+ make test
30
+ make lint
31
+ ```
32
+
33
+ - [ ] Unit tests added / updated and passing green
34
+ - [ ] Smoke tested locally with FastAPI TestClient
35
+ - [ ] Verified live against Docker Compose stack (if applicable)
36
+ - [ ] No regression in token extraction or graph ingestion
37
+
38
+ ## Checklist
39
+
40
+ - [ ] Code follows project style guidelines (`ruff check .`)
41
+ - [ ] All public methods and endpoints have clear docstrings
42
+ - [ ] Relevant documentation updated (README, API reference, or docs)
43
+ - [ ] Commit message follows Conventional Commits format
@@ -0,0 +1,34 @@
1
+ name: Friday CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test & Quality Checks
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - name: Checkout Code
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Set up Python 3.11
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.11"
22
+ cache: "pip"
23
+
24
+ - name: Install Dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -r requirements.txt
28
+ pip install ruff
29
+
30
+ - name: Run Test Suite
31
+ run: python -m pytest tests/ -v --tb=short
32
+
33
+ - name: Code Style & Quality Check
34
+ run: ruff check .
@@ -0,0 +1,76 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution packages
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout Code
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.11"
23
+
24
+ - name: Install build dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install build
28
+
29
+ - name: Build sdist and wheel
30
+ run: python -m build
31
+
32
+ - name: Store distribution packages
33
+ uses: actions/upload-artifact@v4
34
+ with:
35
+ name: python-package-distributions
36
+ path: dist/
37
+
38
+ publish-to-pypi:
39
+ name: Publish to PyPI
40
+ needs: [build]
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: pypi
44
+ url: https://pypi.org/p/friday-memory
45
+ permissions:
46
+ id-token: write
47
+ steps:
48
+ - name: Download distribution packages
49
+ uses: actions/download-artifact@v4
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+
54
+ - name: Publish to PyPI
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+ with:
57
+ skip-existing: true
58
+
59
+ attach-to-release:
60
+ name: Attach assets to GitHub Release
61
+ needs: [build]
62
+ if: github.event_name == 'release'
63
+ runs-on: ubuntu-latest
64
+ permissions:
65
+ contents: write
66
+ steps:
67
+ - name: Download distribution packages
68
+ uses: actions/download-artifact@v4
69
+ with:
70
+ name: python-package-distributions
71
+ path: dist/
72
+
73
+ - name: Upload artifacts to Release
74
+ uses: softprops/action-gh-release@v2
75
+ with:
76
+ files: dist/*
@@ -0,0 +1,32 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.so
5
+ .env
6
+ .env.local
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .venv/
11
+ venv/
12
+
13
+ # Runtime data (never commit these)
14
+ facts/
15
+ vector_db/
16
+ exports/
17
+ logs/
18
+ conversations/
19
+ projects/
20
+ blueprints/*.md
21
+ integrations/*.md
22
+
23
+ # Editor
24
+ .DS_Store
25
+ .idea/
26
+ .vscode/
27
+ *.swp
28
+ *.swo
29
+
30
+ # Docker volumes
31
+ neo4j_data/
32
+ neo4j_logs/
@@ -0,0 +1,18 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+ We pledge to make participation in our project a harassment-free experience for everyone.
5
+
6
+ ## Our Standards
7
+ ✅ Be respectful and constructive
8
+ ✅ Welcome newcomers
9
+ ✅ Focus on what is best for the community
10
+ ❌ No harassment, insults, or personal attacks
11
+ ❌ No discriminatory language
12
+
13
+ ## Enforcement
14
+ Violations may be reported to the project maintainers.
15
+ We will review and respond to all complaints.
16
+
17
+ ---
18
+ Adapted from [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,60 @@
1
+ # Contributing to Friday
2
+
3
+ Thank you for your interest in contributing to Friday. We welcome bug reports, architectural improvements, new integrations, and documentation updates.
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+ - Python 3.11+
9
+ - Docker and Docker Compose
10
+ - Git
11
+
12
+ ### Quick Start
13
+ ```bash
14
+ git clone https://github.com/friday-memory/friday.git
15
+ cd friday
16
+ cp .env.example .env
17
+
18
+ # Install dependencies
19
+ make install
20
+ # or: pip install -r requirements.txt
21
+
22
+ # Run test suite
23
+ make test
24
+ # or: python -m pytest tests/ -v
25
+ ```
26
+
27
+ ## Contribution Workflow
28
+
29
+ 1. **Fork the Repository**: Create your fork on GitHub.
30
+ 2. **Create a Feature Branch**:
31
+ ```bash
32
+ git checkout -b feat/your-feature-name
33
+ ```
34
+ 3. **Write Tests**: Add test coverage under `tests/` for any new functionality or bug fixes.
35
+ 4. **Verify Standards**:
36
+ ```bash
37
+ make test
38
+ make lint
39
+ ```
40
+ 5. **Commit Changes**: Use [Conventional Commits](https://www.conventionalcommits.org/):
41
+ - `feat:` New features or tools
42
+ - `fix:` Bug fixes
43
+ - `docs:` Documentation updates
44
+ - `refactor:` Code restructuring without behavior changes
45
+ - `perf:` Performance improvements
46
+ - `chore:` Dependency or CI updates
47
+ 6. **Open a Pull Request**: Submit your PR with a completed checklist from the PR template.
48
+
49
+ ## Architectural Conventions
50
+
51
+ - **State Persistence**: Memory layers must remain modular:
52
+ - Facts Ledger: Strict deterministic ground truths.
53
+ - Episodic Memory: Semantic vector embeddings.
54
+ - Graph Topology: Relational entity relationships.
55
+ - **Protocol Compliance**: Tool schemas must adhere strictly to the Model Context Protocol (MCP) standard.
56
+ - **Performance**: Operations in the hot path of MCP tool execution should maintain sub-100ms response latencies where possible.
57
+
58
+ ## Questions & Discussions
59
+
60
+ For technical discussions, feature proposals, and architectural questions, visit [GitHub Discussions](https://github.com/friday-memory/friday/discussions).
@@ -0,0 +1,34 @@
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ gcc \
8
+ curl \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements first for layer caching
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy application code
16
+ COPY gateway/ ./gateway/
17
+ COPY layers/ ./layers/
18
+ COPY pipelines/ ./pipelines/
19
+ COPY orchestrator/ ./orchestrator/
20
+ COPY mcp/ ./mcp/
21
+ COPY studio/ ./studio/
22
+
23
+ # Create runtime directories
24
+ RUN mkdir -p /app/facts /app/vector_db /app/logs /app/blueprints /app/seed
25
+
26
+ # Copy seed data
27
+ COPY seed/ ./seed/
28
+
29
+ EXPOSE 8000 8001
30
+
31
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
32
+ CMD curl -f http://localhost:8000/health || exit 1
33
+
34
+ CMD ["uvicorn", "gateway.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Friday Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,33 @@
1
+ .PHONY: help install dev test lint format docker-up docker-down docker-logs clean
2
+
3
+ help: ## Show this help message
4
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
5
+
6
+ install: ## Install Python dependencies
7
+ pip install -r requirements.txt
8
+
9
+ dev: ## Run local development server
10
+ uvicorn gateway.main:app --host 0.0.0.0 --port 8000 --reload
11
+
12
+ test: ## Run test suite
13
+ python -m pytest tests/ -v --tb=short
14
+
15
+ lint: ## Check code formatting and linting
16
+ ruff check .
17
+
18
+ format: ## Auto-format code with ruff
19
+ ruff format .
20
+
21
+ docker-up: ## Launch Friday and Neo4j via Docker Compose
22
+ docker compose up -d
23
+
24
+ docker-down: ## Stop Docker Compose containers
25
+ docker compose down
26
+
27
+ docker-logs: ## View container logs
28
+ docker compose logs -f
29
+
30
+ clean: ## Clean Python caches and temporary files
31
+ find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
32
+ find . -type f -name "*.pyc" -delete 2>/dev/null || true
33
+ rm -rf .pytest_cache .ruff_cache 2>/dev/null || true