Skip to main content

Turn any code repository into a navigable memory palace for AI agents.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palace_ai-0.2.0.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palace_ai-0.2.0-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file palace_ai-0.2.0.tar.gz.

File metadata

  • Download URL: palace_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for palace_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 85c419a4e44128a1b5e8bb573a3f6516c7d256264c3dc44258029af53b1e2377
MD5 cb1da838bd6b9aba77c94e77ab324cad
BLAKE2b-256 81564b18cb179224f92e957589c8b7925fbd7adda180ad1e147c562e8f26715f

See more details on using hashes here.

Provenance

The following attestation bundles were made for palace_ai-0.2.0.tar.gz:

Publisher: workflow.yml on RhyChaw/palace-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file palace_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: palace_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for palace_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00c32cb606da6cf66446e820efea6eaa6c9015545b6557d862e31a91ee7bd765
MD5 db89b58d36c9b34d6f247cf1e2005c4d
BLAKE2b-256 b61c73e3d4b8d699675b302404b0108309a2b2b8c2aa7a2df01e5cb64b1c20d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for palace_ai-0.2.0-py3-none-any.whl:

Publisher: workflow.yml on RhyChaw/palace-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page