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
- pci-spec - S-PAL schema and protocols
- pci-context-store - Layer 1: Context Store
- pci-contracts - Layer 3: Smart Contracts
- pci-zkp - Layer 4: Zero-Knowledge Proofs
- pci-identity - Layer 5: DID Management
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pci_agent-0.1.0.tar.gz | 14.6 kB | Without provenance | Details for pci_agent-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pci_agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pci_agent-0.1.0-py3-none-any.whl |
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}
|
Security for pci-agent 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.