Skip to main content

agit search

Search through your neural commit history to find past reasoning and decisions.

Usage​

agit search query <term>
agit search rebuild

Description​

AGIT maintains a full-text search index of all reasoning traces. Use this to find:

  • Past decisions and their rationale
  • Similar problems you've solved before
  • Context about why code was written a certain way

Subcommands​

query​

Search for entries matching a term:

agit search query <term>

rebuild​

Manually rebuild the search index:

agit search rebuild

Options​

OptionDefaultDescription
--limit, -l10Maximum results to return

Examples​

Search for Past Reasoning​

agit search query "authentication"

Output:

Found 3 results:

[1] 2024-01-15 10:42:18 (score: 2.45)
Category: reasoning
Content: Will implement JWT authentication with refresh token rotation...

[2] 2024-01-10 14:33:02 (score: 1.82)
Category: intent
Content: Add OAuth authentication for third-party login...

[3] 2024-01-08 09:15:44 (score: 1.23)
Category: reasoning
Content: Decided against session-based authentication due to scalability...

Limit Results​

agit search query "refactor" --limit 5

Rebuild Index​

If search results seem stale or incomplete:

agit search rebuild

Output:

Rebuilding search index...
Indexed 247 entries from 52 commits
Search index rebuilt successfully

How It Works​

Indexing​

The search index is automatically updated:

  • On commit: New entries are indexed after agit commit
  • After pull: Incrementally indexes new commits from agit pull

Storage​

The search index is stored locally:

.agit/
└── search_index/ # Tantivy search index

This is not synced between machines. Each clone builds its own index.

What's Indexed​

All fields from your reasoning traces:

  • User intents
  • AI reasoning
  • Error notes
  • Categories and timestamps

Troubleshooting​

No Results Found​

The index may be empty or outdated:

# Rebuild the index
agit search rebuild

Stale Results​

After pulling new commits:

# Pull with auto-index
agit pull

# Or manually rebuild
agit search rebuild

Index Corruption​

If you see errors, delete and rebuild:

rm -rf .agit/search_index
agit search rebuild

Use Cases​

Finding Past Decisions​

"Why did we use Redis instead of Memcached?"

agit search query "redis memcached"

Onboarding​

Help new team members understand architectural choices:

agit search query "architecture decision"

Debugging​

Find context about when a feature was implemented:

agit search query "caching layer"

See Also​