projects¶
Package github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/projects
The projects client manages Emergent projects — the primary unit of organization for graph data, documents, and agents.
Methods¶
func (c *Client) List(ctx context.Context, opts *ListOptions) ([]Project, error)
func (c *Client) Get(ctx context.Context, id string, opts *GetOptions) (*Project, error)
func (c *Client) Create(ctx context.Context, req *CreateProjectRequest) (*Project, error)
func (c *Client) Update(ctx context.Context, id string, req *UpdateProjectRequest) (*Project, error)
func (c *Client) Delete(ctx context.Context, id string) error
func (c *Client) ListMembers(ctx context.Context, projectID string) ([]ProjectMember, error)
func (c *Client) RemoveMember(ctx context.Context, projectID, userID string) error
Key Types¶
Project¶
type Project struct {
ID string
Name string
OrgID string
Description string
Status string
TemplatePack *TemplatePack
Stats *ProjectStats
CreatedAt time.Time
UpdatedAt time.Time
}
ProjectStats¶
ProjectMember¶
CreateProjectRequest¶
UpdateProjectRequest¶
ListOptions¶
GetOptions¶
Example¶
// List all projects
projects, err := client.Projects.List(ctx, &projects.ListOptions{
OrgID: "org_abc123",
})
// Get a project with stats
proj, err := client.Projects.Get(ctx, "proj_xyz", &projects.GetOptions{
IncludeStats: true,
})
fmt.Printf("%s: %d objects, %d documents\n",
proj.Name, proj.Stats.ObjectCount, proj.Stats.DocumentCount)
// List members
members, err := client.Projects.ListMembers(ctx, "proj_xyz")