Skip to main content

palace-ai

AI agents navigate code the way humans remember — by association, not search.

palace-ai visualizer
pip install palace-ai
palace build .
palace query "auth flow"
palace learn --task "..." --outcome success   # v2: record what worked

Build a traversable memory palace for any repository.
palace-ai turns a codebase into rooms and typed relationships so agents orient before opening raw files.

AST-only by default — no API key. Use --llm plus ANTHROPIC_API_KEY for richer room summaries.


What it does

Instead of dumping tens of thousands of tokens of source into context, an agent can read:

  1. palace-out/PALACE.md — map of rooms
  2. One room file — structure, exports, call hints
  3. Only the source files it actually needs

On medium-to-large repos, navigation via the palace is often 10–42× smaller in tokens than reading the full tree (run palace stats after a build).

v2 — institutional memory: After tasks, run palace learn so the palace remembers patterns, failures, and codebase “game state.” New sessions read an enriched PALACE.md (what works, what to avoid, what’s incomplete). Use palace reflect periodically to re-derive patterns from the append-only attempt log.


Quick start

pip install palace-ai
palace build .
palace query "your topic"
palace serve                    # optional: graph visualizer
palace install claude           # Claude Code: CLAUDE.md + PreToolUse hook
palace learn --task "..." --outcome success --notes "..."   # v2 memory
palace reflect                  # v2: re-analyze all attempts
palace status                   # v2: game state summary

Explicit AST-only (same as default):

palace build . --no-llm

LLM-enriched rooms:

export ANTHROPIC_API_KEY=sk-...
palace build . --llm

Repo layout

Path Purpose
palace/ Python package
palace-out/ Small checked-in sample (from tests/fixture)
examples/worked/ Larger pre-built palaces (e.g. requests) for demos
tests/fixture/ Tiny JS/Python fixtures for local builds

2-minute demo

After clone — sample palace is at ./palace-out/:

pip install palace-ai
git clone https://github.com/RhyChaw/palace-ai.git && cd palace-ai
palace query "main" --threshold 0.05
palace serve

Larger graph — pre-built requests palace:

git clone https://github.com/RhyChaw/palace-ai.git && cd palace-ai
palace query "auth flow" --path examples/worked/requests
palace serve --path examples/worked/requests

License

MIT — see LICENSE.

Metadata

Release files for palace-ai 0.2.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 palace-ai 0.2.0
File Size Uploaded
palace_ai-0.2.0.tar.gz 39.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for palace-ai 0.2.0
File Interpreter ABI Platform
palace_ai-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 94.4 kB

Release files / palace_ai-0.2.0.tar.gz

Download URL palace_ai-0.2.0.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
85c419a4e44128a1b5e8bb573a3f6516c7d256264c3dc44258029af53b1e2377
BLAKE2b-256 checksum
How to use checksums
81564b18cb179224f92e957589c8b7925fbd7adda180ad1e147c562e8f26715f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 20, 2026.

Transparency log

Release files / palace_ai-0.2.0-py3-none-any.whl

Download URL palace_ai-0.2.0-py3-none-any.whl
Size 54.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00c32cb606da6cf66446e820efea6eaa6c9015545b6557d862e31a91ee7bd765
BLAKE2b-256 checksum
How to use checksums
b61c73e3d4b8d699675b302404b0108309a2b2b8c2aa7a2df01e5cb64b1c20d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

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