Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d4cab8
chore: enable .idea/ directory ignore
Calvinxc1 Mar 21, 2026
1dc27c5
docs: add AGENTS.md with GitFlow and contribution policies
Calvinxc1 Mar 21, 2026
34b7cd5
docs: add project README with architecture overview
Calvinxc1 Mar 21, 2026
f590745
chore: add initial pyproject.toml configuration
Calvinxc1 Mar 21, 2026
50c08c1
ci: add GitHub Actions workflows for CI/CD
Calvinxc1 Mar 21, 2026
6c79459
feat: add Docker Compose setup for databases
Calvinxc1 Mar 21, 2026
6edb262
refactor: connect docker-compose.yml with .env variables
Calvinxc1 Mar 21, 2026
a5a18f9
feat: add playground notebook with PydanticAI agent setup
Calvinxc1 Mar 21, 2026
1925e72
feat: implement vector-graph memory system with flexible providers
Calvinxc1 Mar 21, 2026
242bd14
refactor: use PydanticAI native embedding models
Calvinxc1 Mar 21, 2026
934d1db
refactor: make models API parameters not config
Calvinxc1 Mar 21, 2026
5fb16e5
refactor: reorganize package structure and remove outdated docs
Calvinxc1 Mar 22, 2026
1bd7a57
feat: implement core vector-graph memory system
Calvinxc1 Mar 22, 2026
f1bf5ec
feat: add configuration system for memory behavior
Calvinxc1 Mar 22, 2026
dbaf627
feat: add audit logging system with multiple backends
Calvinxc1 Mar 22, 2026
9e65401
feat: add OpenAI-compatible REST API
Calvinxc1 Mar 22, 2026
903c31a
chore: add Docker containerization and deployment setup
Calvinxc1 Mar 22, 2026
b25bf61
chore: update project dependencies and build configuration
Calvinxc1 Mar 22, 2026
bb8c31f
docs: update README and add API documentation
Calvinxc1 Mar 22, 2026
309ba7c
fix: resolve lint and type-check failures
Calvinxc1 Mar 24, 2026
4976584
ci: install extras for pull request checks
Calvinxc1 Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
ENV/
env/
.venv

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# Jupyter
.ipynb_checkpoints/
*.ipynb

# Environment
.env
.env.local

# Documentation
*.md
docs/

# Git
.git/
.gitignore

# Docker
Dockerfile
docker-compose.yml
.dockerignore

# Logs and data
logs/
*.log
.vgm/

# Database storage
qdrant_storage/
janusgraph_storage/
mongodb_storage/

# Scripts
start_api.sh
scripts/

# JanusGraph config
janusgraph-config.properties
janusgraph-init.groovy
68 changes: 68 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Vector Graph Memory - Environment Configuration

# === Database Configuration ===
# NOTE: When running API via Docker, these are overridden in docker-compose.yml
# to use container names (qdrant, janusgraph) instead of localhost.
# These localhost values are for local development only.
QDRANT_HOST=localhost
QDRANT_HTTP_PORT=6333
QDRANT_GRPC_PORT=6334
JANUSGRAPH_HOST=localhost
JANUSGRAPH_PORT=8182

# === LLM Configuration ===
# OpenAI API Key (required)
OPENAI_API_KEY=your_openai_api_key_here

# LLM Model (supports PydanticAI format: openai:gpt-4o-mini, anthropic:claude-3-5-sonnet-20241022, etc.)
LLM_MODEL=openai:gpt-4o-mini

# === Memory Configuration ===
# Project identifier (unique namespace for memory storage)
PROJECT_ID=default

# Use case description (guides the agent's memory behavior)
MEMORY_USE_CASE=General purpose conversational memory

# Memory threshold description (what should be stored)
MEMORY_THRESHOLD=Store important facts, decisions, and context from conversations

# Similarity threshold for duplicate detection (0.0-1.0)
SIMILARITY_THRESHOLD=0.85

# === Memory Trigger Configuration ===
# Trigger mode: 'ai_determined', 'phrase', or 'interval'
TRIGGER_MODE=ai_determined

# Trigger phrase (only used if TRIGGER_MODE=phrase)
# TRIGGER_PHRASE=save this to memory

# Trigger interval in messages (only used if TRIGGER_MODE=interval)
# TRIGGER_INTERVAL=5

# === System Prompt ===
SYSTEM_PROMPT=You are a helpful AI assistant with persistent memory capabilities.

# === Audit Configuration ===
# Audit backend: 'jsonl' or 'mongodb'
AUDIT_BACKEND=jsonl

# Audit log directory (for JSONL backend)
AUDIT_LOG_DIR=~/.vgm/logs

# MongoDB connection (only if AUDIT_BACKEND=mongodb)
# AUDIT_MONGODB_URI=mongodb://localhost:27017
# AUDIT_MONGODB_DATABASE=vgm_audit
# AUDIT_MONGODB_COLLECTION=logs

# === API Configuration ===
# API server host and port
API_HOST=0.0.0.0
API_PORT=8000

# === Docker Configuration ===
# Qdrant version
QDRANT_VERSION=v1.12.5

# JanusGraph version
JANUSGRAPH_VERSION=latest
115 changes: 115 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CD

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
push:
branches:
- main

jobs:
check-branch:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.event_name == 'push'
outputs:
is_release_or_hotfix: ${{ steps.check.outputs.is_release_or_hotfix }}
steps:
- name: Check if PR is from release or hotfix branch
id: check
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
SOURCE_BRANCH="${{ github.head_ref }}"
else
# For push events, check the commit message or use a different strategy
# This assumes the branch name is preserved in merge commits
SOURCE_BRANCH="${{ github.ref_name }}"
fi

if [[ "$SOURCE_BRANCH" == release/* ]] || [[ "$SOURCE_BRANCH" == hotfix/* ]]; then
echo "is_release_or_hotfix=true" >> $GITHUB_OUTPUT
else
echo "is_release_or_hotfix=false" >> $GITHUB_OUTPUT
fi

dry-run:
needs: check-branch
if: github.event_name == 'pull_request' && needs.check-branch.outputs.is_release_or_hotfix == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync

- name: Build package
run: |
uv build

- name: Check package metadata
run: |
uv run twine check dist/*

- name: Dry-run publish
run: |
echo "Dry-run: Would publish to PyPI"
ls -lh dist/

publish:
needs: check-branch
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check-branch.outputs.is_release_or_hotfix == 'true'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync

- name: Build package
run: |
uv build

- name: Get version from pyproject.toml
id: get_version
run: |
VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
pull_request:
branches:
- dev
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync --all-extras

- name: Run ruff check
run: |
uv run ruff check .

- name: Run ruff format check
run: |
uv run ruff format --check .

type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync --all-extras

- name: Run mypy
run: |
uv run mypy .
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
Expand Down Expand Up @@ -205,3 +205,7 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/


## Custom Ignores
uv.lock
Loading
Loading