Skip to main content

PCI Agent

Layer 2: Local AI agent for Personal Context Infrastructure.

Overview

The PCI Agent provides:

  • Local AI Processing - Run language models on your device
  • Context Retrieval - Query encrypted context store
  • Policy Enforcement - Validate requests against S-PAL policies
  • Decision Support - AI-powered assistance without data leakage

Installation

# Clone and install
git clone https://github.com/peteski22/pci-agent.git
cd pci-agent
uv sync

# With LLM support (llama-cpp-python)
uv sync --extra llm

Quick Start

from pci_agent import Agent, AgentConfig

# Initialize agent
agent = Agent(AgentConfig(
    model_path="models/phi-3-mini-q4.gguf",
))

# Process a request with policy enforcement
response = await agent.process(
    query="What are my upcoming appointments?",
    policy_id="calendar-access",
)

print(response.content)

Architecture

flowchart TB
    subgraph Agent["PCI Agent"]
        QH["Query Handler"]
        QH --> PC["Policy Checker"]
        QH --> CR["Context Retriever"]
        QH --> LLM["LLM Inference"]
    end

    PC --> SPAL["S-PAL Policy"]
    CR --> CS["Context Store"]

Supported Models

The agent works with GGUF-format models:

Model Parameters RAM Required Quality
Phi-3 Mini 3.8B 4GB Good
Llama 3.2 3B 3GB Good
Mistral 7B 8GB Better
Llama 3.1 8B 10GB Best

Environment Variables

Variable Default Description
PORT 8082 HTTP server port
ZKP_SERVICE_URL http://localhost:8084 ZKP service endpoint
CARDANO_API_URL http://localhost:8080 Cardano devnet API endpoint

Development

# Install with dev dependencies
uv sync --group dev

# Run tests
uv run pytest

# Type check
uv run mypy src/

# Lint
uv run ruff check src/

# Run the agent
uv run python -m pci_agent

Related Packages

License

Apache 2.0

Metadata

Release files for pci-agent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pci-agent 0.1.0
File Size Uploaded
pci_agent-0.1.0.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pci-agent 0.1.0
File Interpreter ABI Platform
pci_agent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / pci_agent-0.1.0.tar.gz

Download URL pci_agent-0.1.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
175b46879044abaceed15ebcee45eea4fe7e3973bb5fe5cf74056b976f58b655
BLAKE2b-256 checksum
How to use checksums
7fc83b6d5d2f593840b439f0815821a5b27b81abde6b5f9efcab64c23d955629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pci_agent-0.1.0-py3-none-any.whl

Download URL pci_agent-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7ae4b2a7bd1549e2a1933c93b6321017c464c4c46f94bb9857a858dde79fc54
BLAKE2b-256 checksum
How to use checksums
51b65d6e5b69fe75983518be9f5024b7ac86dc65e96bed326cd926ab57875b0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page