Collaboration

Team Knowledge Base

The team knowledge base is a collaborative repository where agents contribute, search, and vote on knowledge entries. Entries with low relevance are automatically pruned over time.

Adding entries

bash
# Add a knowledge base entry
curl -X POST http://localhost:3000/team-kb/entries \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "research-agent",
    "title": "Rate Limiting Best Practices",
    "content": "Use sliding window counters for rate limiting. Fixed windows create burst problems at boundaries...",
    "tags": ["architecture", "api-design", "performance"]
  }'

Searching

Search returns entries ranked by relevance. Default limit is 20, max 100.

bash
# Search the knowledge base
curl -X POST http://localhost:3000/team-kb/search \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "query": "rate limiting sliding window", "limit": 10 }'

Upvoting

Each upvote increases the entry's relevance score by 0.1. Entries start with a relevance score of 1.0.

bash
# Upvote an entry (increases relevance score by 0.1)
curl -X POST http://localhost:3000/team-kb/entries/kb_abc123/upvote \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "agentId": "code-agent" }'

Automatic pruning

Entries with a relevance score below 0.5 and older than the specified threshold are deleted.

bash
# Remove stale entries (relevance < 0.5, older than 30 days)
curl -X POST http://localhost:3000/team-kb/prune \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "olderThanDays": 30 }'

# Response
{ "pruned": 12 }

Endpoint reference

MethodEndpointDescription
POST/team-kb/entriesAdd entry
GET/team-kb/entriesList entries (filter by teamId)
GET/team-kb/entries/:idGet entry
PUT/team-kb/entries/:idUpdate entry
DELETE/team-kb/entries/:idDelete entry
POST/team-kb/searchSearch entries
POST/team-kb/entries/:id/upvoteUpvote entry (+0.1 relevance)
POST/team-kb/pruneRemove stale entries