You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**Best For**| VMs with IPv6, production deployments | Windows, corporate networks, IPv4-only systems |
679
-
|**Universal Compatibility**| No (IPv6 only) | Yes (IPv4 and IPv6) |
680
-
681
-
##### Troubleshooting: "getaddrinfo failed" Error
682
-
683
-
If you see errors like:
684
-
```
685
-
OSError: [Errno -3] Temporary failure in name resolution
686
-
gaierror: [Errno -3] getaddrinfo failed
687
-
```
688
-
689
-
**Cause:** Your system doesn't support IPv6 and you're using Direct Connection method.
690
-
691
-
**Solution:** Switch to Session Pooler method (Connection Method 2 above):
692
-
1. Get Session Pooler connection string from Supabase Dashboard (Connection String → Session pooler)
693
-
2. Update your connection string to use `aws-0-[REGION].pooler.supabase.com` hostname
694
-
3. Update username format to `postgres.[PROJECT-REF]`
695
-
4. Keep port as 5432
696
-
5. Restart server
697
-
698
-
**Important Connection Details:**
699
-
-**Database password is never shown** - you must use your original password or reset it
700
-
-**NOT API keys** - API keys (including service_role) are for REST/GraphQL APIs, not direct database connection
701
-
-**Port 5432** for both connection methods (Transaction Pooler on port 6543 is different - only for serverless functions)
702
-
-**pgvector extension** is available on all Supabase projects - must be manually enabled via Dashboard → Extensions (toggle "vector") or SQL (`CREATE EXTENSION IF NOT EXISTS vector;`) before using semantic search
703
-
-**All PostgreSQL features** work identically - JSONB, transactions, metadata filtering
704
-
705
-
**Why No Special Supabase Support:**
706
-
- Supabase IS PostgreSQL - creating separate abstraction would violate DRY and YAGNI principles
707
-
- Both connection methods use standard PostgreSQL wire protocol - identical to self-hosted PostgreSQL
708
-
- Zero maintenance burden - no Supabase-specific code to maintain
709
-
- Future-proof - works regardless of Supabase changes
710
-
- Clear semantics - users understand they're using PostgreSQL
711
-
712
-
**Testing with Supabase:**
713
-
- Tests use SQLite temporary databases (no Supabase required for testing)
714
-
- Production deployment can use Supabase via standard PostgreSQL configuration (either connection method)
715
-
- All PostgreSQL backend features tested with SQLite work identically on Supabase
522
+
**Quick Reference:**
523
+
- Use `STORAGE_BACKEND=postgresql` with `POSTGRESQL_CONNECTION_STRING`
524
+
- Two connection methods: Direct (IPv6 required) or Session Pooler (IPv4 compatible)
525
+
- Enable pgvector via Dashboard → Extensions for semantic search
526
+
- "getaddrinfo failed" error = switch from Direct to Session Pooler
716
527
717
528
### StorageBackend Protocol
718
529
@@ -813,6 +624,32 @@ Both mypy and pyright are configured:
813
624
3.**Return types must be serializable dicts/lists** - use TypedDicts from `app/types.py`
814
625
4.**Tool decorators require specific imports**: Use `Annotated` and `Field` from `typing` and `pydantic`
815
626
627
+
### Adding New MCP Tools
628
+
629
+
When adding a new tool to the server, follow this pattern:
630
+
631
+
```python
632
+
# In app/server.py
633
+
@mcp.tool()
634
+
asyncdefmy_new_tool(
635
+
required_param: Annotated[str, Field(description='Description for MCP clients')],
-`metadata_filters` (list, optional): Advanced metadata filters with operators
514
+
-`start_date` (str, optional): Filter entries created on or after this date (ISO 8601 format)
515
+
-`end_date` (str, optional): Filter entries created on or before this date (ISO 8601 format)
513
516
-`limit` (int, optional): Maximum results (default: 50, max: 500)
514
517
-`offset` (int, optional): Pagination offset
515
518
-`include_images` (bool, optional): Include image data in response
@@ -545,6 +548,28 @@ All string operators support `case_sensitive: true/false` option.
545
548
546
549
For comprehensive documentation on metadata filtering including real-world use cases, operator examples, nested JSON paths, and performance optimization, see the [Metadata Filtering Guide](docs/metadata-filtering.md).
547
550
551
+
**Date Filtering:**
552
+
553
+
Filter entries by creation timestamp using ISO 8601 format:
**Note:** Date-only `end_date` values automatically expand to end-of-day (`T23:59:59.999999`) for intuitive "entire day" behavior. Naive datetime (without timezone) is interpreted as UTC.
572
+
548
573
**Returns:** List of matching context entries with optional query statistics
549
574
550
575
#### get_context_by_ids
@@ -649,6 +674,8 @@ Note: This tool is only available when semantic search is enabled via `ENABLE_SE
649
674
-`top_k` (int, optional): Number of results to return (1-100) - defaults to 20
650
675
-`thread_id` (str, optional): Filter results to specific thread
651
676
-`source` (str, optional): Filter by source type ('user' or 'agent')
677
+
-`start_date` (str, optional): Filter entries created on or after this date (ISO 8601 format)
678
+
-`end_date` (str, optional): Filter entries created on or before this date (ISO 8601 format)
652
679
653
680
**Returns:** Dictionary with:
654
681
- Query string
@@ -660,6 +687,17 @@ Note: This tool is only available when semantic search is enabled via `ENABLE_SE
660
687
- Find related work across different threads based on semantic similarity
661
688
- Discover contexts with similar meaning but different wording
662
689
- Concept-based retrieval without exact keyword matching
690
+
- Find similar content within a specific time period using date filters
691
+
692
+
**Date Filtering Example:**
693
+
```python
694
+
# Find similar content from the past week
695
+
semantic_search_context(
696
+
query="authentication implementation",
697
+
start_date="2025-11-22",
698
+
end_date="2025-11-29"
699
+
)
700
+
```
663
701
664
702
For setup instructions, see the [Semantic Search Guide](docs/semantic-search.md).
0 commit comments