Setup guide
Codebase memory for Codex
Connect Lybrary once. Start its index in each repository where you want Codex to query code locations.
For a setup skill that Codex can invoke when you ask for local repository memory, install Lybrary's plugin:
codex plugin marketplace add vibhu-dixit/lybrary
codex plugin add lybrary@lybrary
The plugin provides setup guidance. Connect the local MCP server in step 2 to make memory_query available.
1. Install and index
pip install lybrary
cd /path/to/your/repo
lybrary start
lybrary status
2. Register the MCP server
codex mcp add lybrary -- lybrary mcp
codex mcp list
Register once per machine. Start a new Codex session in the indexed repository and ask it to call memory_status. Check that it reports the intended root and a populated index.
3. Tell Codex when to use it
Add this to the repository's AGENTS.md:
When .lybrary/index.db exists, use Lybrary memory_query before broad code searches
or reading multiple files. Inspect returned paths and lines before editing.
If the index is absent or the tool fails, use normal search.
Ask a conceptual question such as “Where is login token validation handled?” The agent can use the returned file and line numbers to inspect current source. Exact known symbols may be quicker to find with ordinary text search.
Use it across folders
Run lybrary start once in each repository. Lybrary keeps a separate index and configuration in each folder. If Codex starts above the indexed folder, pass its absolute path as repo_root to memory_query.
If memory_status or memory_query errors, run lybrary status and lybrary query "your question" in a terminal first. A newly registered or updated stdio server may require a fresh Codex session.
See the measurement guide for comparing agent runs. For Codex MCP configuration details, see the official OpenAI documentation.